Comment out the mysql field & lt ;? Phpinclude (& quot; conn. php & quot;); & nbsp; $ query & quot; select * frommenu & quot; & nbsp; $ resultmysql_query ($ query); & nbsp; for ($ i0; $ I & lt; mysql_num_fields ($ resu comment out mysql fields
Include ("conn. php ");
$ Query = "select * from menu ";
$ Result = mysql_query ($ query );
For ($ I = 0; $ I {
$ Temp = mysql_field_name ($ result, $ I );
Echo $ temp .":";
$ Query_1 = "select column_comment from INFORMATION_SCHEMA.Columns where table_name = 'admin' and table_schema = 'phpdata' and column_name like '$ temp '";
$ Result_1 = mysql_query ($ query_1 );
$ Row_1 = mysql_fetch_row ($ result_1 );
Echo $ row_1 [0]."
";
}
?>
This code can be run locally.
However, you can only retrieve the field name on the server, not the comment.
The table name and database name are correct.
What is the reason? is there any permission to activate it?
Id:
Warning: mysql_fetch_row (): supplied argument is not a valid MySQL result resource in/www/users/swd888.com/1.php on line 11
------ Solution --------------------
You failed to run this sentence.
$ Result_1 = mysql_query ($ query_1 );
After outputting the $ query_1 statement, copy it to the database and run it.
Or add an or die ($ mysql_error () after the query. see the error message.
------ Solution --------------------
Wrong password? Why is it rejected?
I forgot to ask, is your database connected? why is there no mysql_connect?
------ Solution --------------------
You are not authorized to access the INFORMATION_SCHEMA database. Try it with the root user.
------ Solution --------------------
Check your conn. php function, and add
PHP code
If (! $ Con) {die ('could not connect: '. mysql_error ());}
------ Solution --------------------
Show full fields from table // try this way
------ Solution --------------------
$ Query_1 = "show full columns from phpdata from admin like '$ temp '";
$ Result_1 = mysql_query ($ query_1 );
$ Row_1 = mysql_fetch_row ($ result_1 );
Echo $ row_1 ['comment']."
";
Try it