How can I get something from the database? database name: xl table: page has five fields: ID-name-title-text-time. After I connect to the database, how to construct a table with an SQL statement query ID greater than 0? the IDs in the database are automatically added. SQL = & quot; SELECT * FROMxl. how to get something from the database
Database name: xl table: five page fields, ID-name-title-text-time
After I connect to the database, how can I create a table with the SQL statement query ID greater than 0? the IDs in the database are automatically added.
SQL = "SELECT * FROM xl. page WHERE id> 0"; // You do not know this.
How can I display data to the page? I only know a function, but I don't know how to use it.
$ Res = mysql_query ($ SQL); // assign the obtained data to a variable.
Then, what about mysql_num_rows ($ res); //? I tried this. no data is displayed.
How to do the time in the field. Thank you.
------ Solution --------------------
Mysql_query returns the result set.
PHP code
$ Res = mysql_query ($ SQL); while ($ row = mysql_fetch_assoc ($ res) {echo $ row ["time"];}