0
   $do_select = mysql_query("SELECT EnquiryId FROM formsubmission WHERE name='$name' AND phone='$phone' AND email='$email' AND message='$message'") or die(mysql_error());
 if ($do_select)
{

while ($selected_data = mysql_fetch_assoc($do_select))
{
    // Show status


echo "<center>Your Enquiry was successfully submitted and your enquiry id   is </center> ";


 echo "<center><b>" .$selected_data['EnquiryId'] ."</b></center>";

}

}

enquiryid 是自动递增并从我的 sql 表中获取的,我尝试在 if(do_select) 条件后回显,它有效,这意味着查询正在从数据库中选择查询 id,但不打印 enquiryid,while 条件有一些问题 ??

4

1 回答 1

0

我不知道你为什么这样做如果陈述。而你已经有了or die声明。

尝试这个。

      $do_select = mysql_query("SELECT EnquiryId FROM formsubmission WHERE name='$name' AND phone='$phone' AND email='$email' AND message='$message'") or die(mysql_error());

 while ($selected_data = mysql_fetch_array($do_select))
 {
  // Show status


 echo "<center>Your Enquiry was successfully submitted and your enquiry id   is </center> ";


 echo "<center><b>" .$selected_data['EnquiryId'] ."</b></center>";

  }
于 2013-08-01T17:48:28.943 回答