Jump to content

Need help with mysql_info()


ac1982

Recommended Posts

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

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.