hello!
i have the below problem.I have a form wich works fine but my php script doesn't do it's work.Well i'm trying to insert the data from my form to my database(this works,i've tested it).Further more i want to take the id where name=$POST[nameval] from my table and then print in my screen the value of the id(my table is:eleni(id int auto_increment primary key,name varchar(20)).Th e result that i'm taking back is Resource id #3 and is always the same!!!
Can somebody help me?Thank you!
[PHP]$sql = mysql_query("IN SERT INTO elen VALUES ('','$_POST[nameval]')");
$res_id=mysql_q uery("SELECT id FROM elen WHERE name='$_POST[nameval]'"); /*Here is the problem*/
echo $res_id;[/PHP]
i have the below problem.I have a form wich works fine but my php script doesn't do it's work.Well i'm trying to insert the data from my form to my database(this works,i've tested it).Further more i want to take the id where name=$POST[nameval] from my table and then print in my screen the value of the id(my table is:eleni(id int auto_increment primary key,name varchar(20)).Th e result that i'm taking back is Resource id #3 and is always the same!!!
Can somebody help me?Thank you!
[PHP]$sql = mysql_query("IN SERT INTO elen VALUES ('','$_POST[nameval]')");
$res_id=mysql_q uery("SELECT id FROM elen WHERE name='$_POST[nameval]'"); /*Here is the problem*/
echo $res_id;[/PHP]
Comment