How to hide the value of the drop-down box-php Tutorial

Source: Internet
Author: User
How to hide the value of the drop-down box?

Select Service Manufacturing Advertising



If there is a service class record in the database

So hide it when you submit the form next time. ServiceThis

How to implement it?


Reply to discussion (solution)

 Select
  Service
  
  Manufacturing
  
  Advertising
  

 Select
  Service
  
  Manufacturing
  
  Advertising
  



How smart are you? I never thought of the in_array () function.

But why can't I set the value?

Suppose my data TABLE is a TABLE with three pieces of information.
Id uid name
1, 2, 3
2 8 Li Si
3 9 Wang 'er

$ Result = mysql_query ("SELECT * FROM uid", TABLE );
$ Row = mysql_num_rows ($ result );
Incorrect output $ row

$ Result = mysql_query ("SELECT * FROM uid", TABLE );
Obvious problems with the from uid


Change
$ Uid = xxx; // The uid to be queried
$ Result = mysql_query ("SELECT * from table where uid = '". $ uid. "'") or die (mysql_error ());
Try

$ Result = mysql_query ("SELECT * FROM uid", TABLE );
Obvious problems with the from uid


Change
$ Uid = xxx; // The uid to be queried
$ Result = mysql_query ("SELECT * from table where uid = '". $ uid. "'") or die (mysql_error ());
Try




I didn't want to query a piece of information, didn't you say it on the second floor upstairs? I want to use this method to get all the uid data output results: 2, 8, 9 arrays of this type
Use in_array () to determine the drop-down list.

That's simpler.

$query = mysql_query("select uid from TABLE") or die(mysql_error());$result = array();while($thread=mysql_fetch_assoc($query)){    $result[] = $thread['uid'];}

$ Result contains the existing uid.

That's simpler.

$query = mysql_query("select uid from TABLE") or die(mysql_error());$result = array();while($thread=mysql_fetch_assoc($query)){    $result[] = $thread['uid'];}

$ Result contains the existing uid.



Output is Array
Solution

That's simpler.

$query = mysql_query("select uid from TABLE") or die(mysql_error());$result = array();while($thread=mysql_fetch_assoc($query)){    $result[] = $thread['uid'];}

$ Result contains the existing uid.



Is there a way to use the while loop or while external output?

Why not bring $ result into $ exists?

Why not bring $ result into $ exists?



No.


That's simpler.

$query = mysql_query("select uid from TABLE") or die(mysql_error());$result = array();while($thread=mysql_fetch_assoc($query)){    $result[] = $thread['uid'];}

$ Result contains the existing uid.



Output is Array
Solution



Array output is of course Array

So you should understand.
$ Query = mysql_query ("select uid from TABLE") or die (mysql_error (); $ result = array (); while ($ thread = mysql_fetch_assoc ($ query )) {$ result [] = $ thread ['uid'] ;}?>Select
  Service
  
  Manufacturing
  
  Advertising
  



That's simpler.

$query = mysql_query("select uid from TABLE") or die(mysql_error());$result = array();while($thread=mysql_fetch_assoc($query)){    $result[] = $thread['uid'];}

$ Result contains the existing uid.



Output is Array
Solution



Array output is of course Array

So you should understand.
$ Query = mysql_query ("select uid from TABLE") or die (mysql_error (); $ result = array (); while ($ thread = mysql_fetch_assoc ($ query )) {$ result [] = $ thread ['uid'] ;}?>Select
  Service
  
  Manufacturing
  
  Advertising
  



Thank you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.