Issues related to multiple tables in PHP

Source: Internet
Author: User
Problems associated with multiple tables in PHP
Previous page: rem_list.php

<title></title>



Session_Start ();
Include_once (".. /include/conn.php ");
$rem _id=$_session["rem_id"];
$rem _name=$_session["Rem_name"];
$sql = "Select Order_number from Rem_table, order_table where rem_table.rem_id=order_table.rem_id and Rem_table.rem_name = ' $rem _name ' ";
$mysql =mysql_query ($sql) or Die ("Could not query.". Mysql_error ());
$info =mysql_num_rows ($mysql);
if ($info = = "") {
$html _info= "There are no orders for the moment. " ;
}
else{
$str =mysql_fetch_array ($mysql);
$html _info= "
      " ;
      do{
      $html _info.= "
    • ". $str [" Order_number "]."
    • " ;
      }while ($str =mysql_fetch_array ($mysql));
      $html _info.= "
" ;
}
?>


Welcome Landing







after Link: order_list.php

<title></title>



Session_Start ();
Include_once (".. /include/conn.php ");
er _number=$_get["Order_number"];
$rem _name=$_session["Rem_name"];
$sql = "SELECT * from Order_table, deal_table where deal_table.order_id=order_table.order_id, order_table.order_number= ' er _number ' ";
Var_dump ($sql);
$mysql =mysql_query ($sql) or Die ("Could not query.". Mysql_error ());
$str =mysql_fetch_array ($mysql);
$html _info= "











" ; do{$html _info.= " "; $html _info.=" "; $html _info.=" "; $html _info.=" "; $html _info.=" "; $html _info.=" "; $html _info.=" "; $html _info.=" "; $html _info.=" " ; } while ($str =mysql_fetch_array ($mysql)); $html _info.= "
Order number ". $str [" Order_number "]."
Order Time ". $str [" Order_date "]."
Order Status ". $str [" Deal_information "]."
" ;
?>


Welcome Landing






------Solution--------------------
$sql = "SELECT * from Order_table, deal_table where deal_table.order_id=order_table.order_id andOrder_table.order_number= ' er _number ' "; Missing join condition for where
  • 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.