Query the database in PHP and display $ cur_roomID =$ _ GET ['roomid']; & nbsp; $ query = "SELECT & nbsp; * FROM & nbsp; room & nbsp; WHERE & nbsp; query and display the database in roo PHP
$ Cur_roomID = $ _ GET ['roomid'];
$ Query = "SELECT * FROM room WHERE roomID =". $ cur_roomID ."";
$ Result = mysql_query ($ query );
$ Row = mysql_fetch_row ($ result );
$ Cur_roomtype = $ row ['roomtype '];
$ Cur_roomsize = $ row ['roomsize'];
Why can't I find the result?
I want to get the value of the "roomtype" and "roomsize" from the database, and share it with PHP MySQL:
------ Solution --------------------
In addition, I generally have a habit of using PHP to generate SQL statements that are never directly executed using mysql_query. I will first display it with echo, copy the displayed SQL statement, and paste it to phpmyadmin for execution. I will execute mysql_query in php only after I confirm it is correct.
------ Solution --------------------
$ Result = mysql_query ($ query) or die (mysql_error ());
Is there any problem?