1

Hello the first query is executed fine.. the second one is failing.. why?, i think its ok..

I know the first part its ok , because this data its saved in the database, the second query isn´t.

//insert the row into the database

    $res2 = mysql_query("INSERT INTO `users` (`username`, `password`, `email`, `rtime`, `ms`, `ms2`) VALUES('".$username."','".$password."','".$email."','".$registerTime."','".$ms."','".$ms2."')");

    $userid = mysql_insert_id();


    $sql17 = mysql_query("INSERT INTO `jugadores` (`userid`, `name`, `lastname`) VALUES('".$userid."','".$name."','".$lastname."')");
Jules Martinez
  • 682
  • 1
  • 6
  • 23

2 Answers2

1

User ID is an integer so this is making a problem

'".$userid."'

The correct syntax for int. numbers is

".$userid."
Jules Martinez
  • 682
  • 1
  • 6
  • 23
0

I think your userid is a primary key . So you got the problem .you can put your error in google and search the answer