How to Read database from the php drop-down menu how to read database from the php drop-down menu
Now you can click the line to find the line from the database, but you want to read the vehicle through the selected line
Table line
Linename
213
223
225
267
Table busname
Linename busname
213 781
213 782
213 783
223 817
223 818
225 901
267 100
The code is as follows:
Select line
$ Link = mysql_connect ("127.0.0.1", "root", "12345678 ");If (! $ Link) echo "no connection successful! ";Mysql_select_db ("busap", $ link); // select a database// Control query conditions$ Q = "SELECT * FROM line order by linename asc ";Mysql_query ("set names GB2312"); // prevents garbled characters$ Rs = mysql_query ($ q); // Obtain a dataset$ Assoc = mysql_num_rows ($ rs); // The number of affected rows. mysql_fetch_assoc was used.$ Row = mysql_fetch_array ($ rs); // you only need to add this row back.$ Xl = $ row [linename]?> Select line
Vehicle ID
$ Link = mysql_connect ("127.0.0.1", "root", "12345678 ");If (! $ Link) echo "no connection successful! ";Mysql_select_db ("busap", $ link); // select a database// Control query conditions$ Q = "SELECT * FROM '{$ _ REQUEST ['select']} 'Order BY linename asc ";Mysql_query ("set names GB2312"); // prevents garbled characters$ Rs = mysql_query ($ q); // Obtain a dataset$ Assoc = mysql_num_rows ($ rs); // The number of affected rows. mysql_fetch_assoc was used.$ Row1 = mysql_fetch_array ($ rs); // you only need to add this row.?> Select vehicle
Reply to discussion (solution)
Select line
Select line
Vehicle ID
Select vehicle