Hi,
I want to insert and select the data from the same table.I am using following query to insert and select the data from the same table. However, I am not able to insert the data.
Is there any method to do this?
$sql=mysql_query("INSERT INTO users (name,ref_no) VALUES( '$name', (SELECT id FROM users WHERE name='$name') )");
id is AUTO_INCREMENT
Would greatly appreciate your help.
Thank you.