我想在单击指向包含php代码的页面的href链接时提交用户id和产品id

我想在单击指向包含php代码的页面的href链接时提交用户id和产品id,php,mysql,sql,Php,Mysql,Sql,这是store.php页面 <a href=\"order.php?id=".$row[prod_id]."\">Order</a> 而order.php包含 <?php $email = "mis@es-tg.com"; #add your code here now or later to connect to the MySQL database. error_reporting(E_ERROR | E_PARSE); $con = mysql_pco

这是store.php页面

<a href=\"order.php?id=".$row[prod_id]."\">Order</a>

而order.php包含

<?php

$email = "mis@es-tg.com";
#add your code here now or later to connect to the MySQL database.
error_reporting(E_ERROR | E_PARSE);
$con = mysql_pconnect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  mysql_set_charset('utf8',$con); 

$charset = mysql_client_encoding($con);

mysql_select_db("scientology", $con);
$sql = "Insert into requested_product values (stdid,prod_id) where prod_id=".$_GET['prod_id']  , stdid=".$_GET['stdid'];
$result = mysql_query ("$sql");
if(!($result))
   echo "<BR><font color=red>Thank you for ordering</font>";
echo $sql;
header("Location: store.php");
?>

在store.php中,您正在发送
id
,但您正在order.php中读取
$\u GET['prod\u id']
。将
$\u GET['prod\u id']
替换为
$\u GET['id']

替换为检查插入查询语法!!它类似于
插入到表中\u名称值(value1、value2、value3,…)我们在insert QUERY中不使用
WHERE
子句。您需要基本教程。充满语法错误。