如何在PHP和&amp ;;中为同一列添加两个不同的自动增量数字? MySQL的?

时间:2012-01-04 07:12:30

标签: php mysql

mysql_select_db('bestfood123');
$user=$_POST['t4'];

$result = mysql_query("SELECT * FROM login WHERE username='$user'");

$info = mysql_fetch_array($result);


if($info['section']=="delhi")
{
  mysql_query("insert into support values('a.','$status','$sbj','$message','$userid','$user','','','$date')");
  printf("<h2>your incident id is: %d\n</h2>", mysql_insert_id());    
  $inci=mysql_insert_id();
}
else
{     
  mysql_select_db('bestfood123');

  mysql_query("insert into support  values('b.','$status','$sbj','$message','$userid','$user','','','$date')");
  printf("<h2>your incident id is: %d\n</h2>", mysql_insert_id());    
  $inci=mysql_insert_id();
}

1 个答案:

答案 0 :(得分:0)

如何添加两个不同的自动增量编号。到php mysql中的同一列

您无法在1个表格中创建2个主键。