whats wrong with my php/sql?

funny t

New member
I get a blank screen when these statements are run. they are part of a larger program. the values of $userid and $parent_id are retrieved by the mysql_insert statements.
The query3=sprintf(...= seems to be the problem:

$userid= mysql_insert_id();
$parent_id= mysql_insert_id();
var_dump($parent_id);
var_dump($userid);
query3= sprintf("insert into parent_user values(null, '$parent_id','$userid')");
var_dump($query3);


i have 3 tables for simplicity i will only list a few fields:
user
userid PK
first_name
last_name

parent
parent_id PK
parent_first_name
parent_last name

parent_user
parent_user_id PK
parent_id FK
userid FK
$query2 = sprintf("insert into parent values(null,'$parent_first_name','$parent_last_name')");
this line works and is sent to mysql
mysql_query($query2,$mysql_link) or die(mysql_error());
these two statments are working perfectly
 
Back
Top