How to read the database from the PHP drop-down menu

Source: Internet
Author: User
How to read the database from the PHP drop-down menu


Now click on the line to isolate the line from the database, but 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 route

$link =mysql_connect ("127.0.0.1", "root", "12345678"); if (! $link) echo "Not connected successfully!"; mysql_select_db ("Busap", $link); Select database//control query condition $q = "SELECT * From line ORDER by linename ASC"; mysql_query ("SET NAMES GB2312"); Prevent garbled $rs = mysql_query ($q); Gets the data set $assoc = Mysql_num_rows ($RS);////The number of rows affected, originally used Mysql_fetch_assoc $row =mysql_fetch_array ($RS); Just add back to this line. $XL = $row [Linename]?>Select route



Vehicle self-numbering

$link =mysql_connect ("127.0.0.1", "root", "12345678"); if (! $link) echo "Not connected successfully!"; mysql_select_db ("Busap", $link); Select database//control query condition $q = "SELECT * from ' {$_request[' select '} ' ORDER by linename ASC"; mysql_query ("SET NAMES GB2312"); Prevent garbled $rs = mysql_query ($q); Gets the data set $assoc = Mysql_num_rows ($RS);////The number of rows affected, originally used Mysql_fetch_assoc $row 1=mysql_fetch_array ($RS); Just add back to this line. ?>Select vehicle


Reply to discussion (solution)

      Select route               
  
              Select route    
  
              
   
         
  
                            Vehicle self-numbering        
  
              Select vehicle    
  
              
   
         
  
                    
  • Related Article

    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.