//echo $material_name;
$m= "select material_id from abranch_table where material_name='$material_name';
$res=db_fetch_object($m);
//echo $res;
$q="insert into amain_table(Roll_id,Name,material_id)
values
('$no','$name','$res')";
$req=db_query($q);
?>
<br>
<br>
<br>
<h2><center>inserted</h2></center>
<br>
<br>
<a href="table_primarytest.php"> Home </a>
Among these 2 php files,first file works properly and the queries in test_appln.php is working. But the Database table is not getting updated... I tried to echo the 'echo $res;' and
'echo $material_name;' but dat too is not working...
Can u help me?
Veselin
2008-04-18 15:32:06
Re:
I think you should use $_POST["no"], $_POST["name"], $_POST["material_name"] to get the values of the submitted form.
Nandhu
2008-04-22 12:40:35
Re:
I've tried as follows... But i cud not get it...
Is there anything wrong with my coding?
echo $material_name;
$m= "select material_id from abranch_table where material_name='$material_name';
$res=db_fetch_object($m);
//echo $res;
$q="insert into amain_table(Roll_id,Name,material_id)
values
('$no','$name','$res')";
$req=db_query($q);
?>
<br>
<br>
<br>
<h2><center>inserted Posted</h2></center>
<br>
<br>
<a href="table_primarytest.php"> Home </a>
Veselin
2008-04-22 13:12:31
Re:
please try this
$q = "insert into amain_table(Roll_id,Name,material_id) values ('".mysql_escape_string($no)."','".mysql_escape_string($name)."','".mysql_escape_string($res)."')";
$req = mysql_query ($q) or die ('request "Could not execute SQL query" '.mysql_errno($req));
and let me know if you see any error message
Nandhu
2008-04-22 13:30:07
Re:
Sorry... I don't recieve any error message.
Nothing is displayed in the browser...
Nandhu
2008-04-22 13:43:14
Re: Hi I got it ! Thanks a lot...
echo $material_name;
$m= "select material_id from abranch_table where material_name='$material_name';
---
$res=db_fetch_object($m);
See i've made a syntax error at the place ive underlined... Ive missed the close quotes...