How can I display the php query value in the drop-down box? I want to display the queried value in the drop-down box.
This value can only be upper, middle, and lower.
Add me
But in this case, there will be two identical values.
I don't know how to write if I only show one
$ SQL = "select * from 'XX '";
$ Query = mysql_query ($ SQL );
$ Rs = mysql_fetch_array ($ query );
?>
Upper Medium Lower
Reply to discussion (solution)
I don't know what it means,
Isn't there only one option here? how can there be two identical values.
$ Rs = mysql_fetch_array ($ query );
This function is incorrect. it has ASSOC, NUM, and BOTH returned methods. your return method is BOTH, that is, one key name and one subscript each, so there will be two.
Let's take a look at the differences between mysql_fetch_arry and mysql_fetch_row.
I don't know what it means,
Isn't there only one option here? how can there be two identical values.
There are three data records, which are read from the upper, lower, and lower layers. $ rs ['type'], $ rs [0], and each has one data record. Therefore, six data records are read.
This code should be the same as his own results. Replace mysql_fetch_assoc ($ query) with your desired result.
I don't know what it means,
Isn't there only one option here? how can there be two identical values.
There are three data records, which are read from the upper, lower, and lower layers. $ rs ['type'], $ rs [0], and each has one data record. Therefore, six data records are read.
Take a closer look at his code. do you have $ rs [0?
I understood it wrong.
I don't know what it means,
Isn't there only one option here? how can there be two identical values.
There are three data records, which are read from the upper, lower, and lower layers. $ rs ['type'], $ rs [0], and each has one data record. Therefore, six data records are read.
Take a closer look at his code. do you have $ rs [0?
In this case, if the value returned by my code is
The drop-down box is displayed.
Upper
Upper
Medium
Lower
If the returned value is
Yes
Lower
Upper
Medium
Lower
There will be duplicates
I don't know what your intention is. I don't know what you want.
Because I wrote a form. this item is fixed with three values: top, bottom, and bottom.
Select one of the single INSERT drop-down tables
Form 2 select the value of this item first and then select another UPDATE from the drop-down list.
Poor language organization capability...
It's easy. use the condition to determine whether $ rs ['type'] is equal to one of the upper and lower layers. useThe selected attribute control is displayed.
> Above> Medium> Bottom
$ Rs = mysql_fetch_array ($ query );
Print it out and see what it is.