Posted by: h4ck@lyst | December 13, 2007

php mysql functions

I ll put the last thing first


Why I put this last thing as the first is this:

Last year in pragyan 07, I was with the Dalal Street team.

And during runtime of the game I created a miniature admin module that did various functions like user add, activation etc etc etc.

I did it all. I did it all beautifully.

Except one thing. mysql_close(connection identifier).

Nothing much happened. Other than the servers handling the mysql (and they were in triplicate with mysql replication along with load balancing) crashed. 🙂  ouch

So, please do close the mysql connection that you open. :0

Ok, now the first thing

$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
or die('Could not connect: ' . mysql_error());

where $link is the returned value. Its a MySQL link identifier on success, or FALSE on failure.

It opens a connection to a MySQL Server.

more later.

you can always refer to php manual available from here.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: