Friday, January 29, 2010

Database handle in PHP-mysql

This is the two line code i use to connect to database through PHP:

$dbhandle = mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

The great thing about this code is that once dbhandle is created then any call to mysql_connect will reuse the old dbhandle. This is very nice abstraction provided by PHP-mysql connector. I dont know if this is same with other connection object or not...

SJ

Thursday, January 28, 2010

A brief on web related technology

http://sharat.wordpress.com/
This page explains some of the web concept in brief ...
Some of them are useful...

SJ

After a month

Sorry i was on vacation lately so had nothing much to post...

Recently i was working on database part of my project...
I had a doubt about auto-increment primary keys that what happen if some fields are deleted in future {which will happen in 99.99% of scenarios } then primary key does not remain sequential and those gaps will never be filled and eventually when project scale heavily then auto-increment field will reach its maximum and project will crash...

I discussed it with friend and in his opinion, auto-increment field is automatically taken care by the database so nothing to worry,... Moreover one should keep in practice to not write program to access primary key sequentially.

He also mentioned that i could use LDAPs for authentication of my system...
Will write rest later...

SJ