ac1982 Posted October 7, 2008 Share Posted October 7, 2008 Hi I ll like some help with the following. $con = mysql_connect("localhost", "root" , ""); mysql_select_db("dabasename", $con); mysql_query("SELECT * FROM type"); $t = mysql_info(); echo $t; I tried the above code but I cannot see any information when I echo mysql_info(); Can you please tell me what am i doing wrong. Thank you Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 7, 2008 Share Posted October 7, 2008 From the mysql_info section of the php manual - Return Values Returns information about the statement on success, or FALSE on failure. See the example below for which statements provide information, and what the returned value may look like. Statements that are not listed will return FALSE. Examples Example 1455. Relevant MySQL Statements Statements that return string values. The numbers are only for illustrating purpose; their values will correspond to the query. INSERT INTO ... SELECT ... String format: Records: 23 Duplicates: 0 Warnings: 0 INSERT INTO ... VALUES (...),(...),(...)... String format: Records: 37 Duplicates: 0 Warnings: 0 LOAD DATA INFILE ... String format: Records: 42 Deleted: 0 Skipped: 0 Warnings: 0 ALTER TABLE String format: Records: 60 Duplicates: 0 Warnings: 0 UPDATE String format: Rows matched: 65 Changed: 65 Warnings: 0 A SELECT query is not among that list and would cause the mysql_info() statement to return a false value. Please read the php manual section for any function you are attempting to use, especially when it does not work or when ti produces and error. Quote Link to comment Share on other sites More sharing options...
DjMikeS Posted October 7, 2008 Share Posted October 7, 2008 From the manual: http://nl2.php.net/mysql_info string mysql_info ([ resource $link_identifier ] ) so you should try: <?php $con = mysql_connect("localhost", "root" , ""); mysql_info($con); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.