php mysql_error function

mysql_error

php mysql_error function

<?php
$link = mysql_connect(“localhost”, “mysql_username”, “mysql_password”);

mysql_select_db(“nonexistentdb”, $link);
echo mysql_error($link);
// output of this echo will be: Unknown database ‘nonexistentdb’

mysql_select_db(“existentdb”, $link);
mysql_query(“SELECT * FROM nonexistenttable”, $link);

echo mysql_error($link);
// output of this echo will be: Table ‘existentdb.nonexistenttable’ doesn’t exist
?>

php help system

Advertisements

1 Comment »

  1. Sammy said

    It is really a nice and helpful piece of info. I’m glad that you just shared this helpful info with us. Please stay us informed like this. Thank you for sharing.

RSS feed for comments on this post · TrackBack URI

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: