forumnz Posted December 31, 2007 Share Posted December 31, 2007 Heres the code: <?php include('dbcon.php'); $catid=$_POST['value']; $name=$_POST['name']; $z = "0"; mysql_query("INSERT INTO cmcats (catid, catup, name) VALUES ('$catid', '$z', '$name')"); ?> Any idea what could be wrong? Thanks, Sam. Link to comment https://forums.phpfreaks.com/topic/83782-solved-prob-with-insert/ Share on other sites More sharing options...
papaface Posted December 31, 2007 Share Posted December 31, 2007 try: <?php include('dbcon.php'); $catid=$_POST['value']; $name=$_POST['name']; $z = "0"; mysql_query("INSERT INTO cmcats (catid, catup, name) VALUES ('{$catid}', '{$z}', '{$name}')"); ?> Link to comment https://forums.phpfreaks.com/topic/83782-solved-prob-with-insert/#findComment-426289 Share on other sites More sharing options...
revraz Posted December 31, 2007 Share Posted December 31, 2007 Nope, but it would help if you used error reporting and told us what the error was. Link to comment https://forums.phpfreaks.com/topic/83782-solved-prob-with-insert/#findComment-426291 Share on other sites More sharing options...
btherl Posted December 31, 2007 Share Posted December 31, 2007 Doing this will give you a helpful error message: mysql_query("INSERT INTO cmcats (catid, catup, name) VALUES ('$catid', '$z', '$name')") or die("Mysql error: " . mysql_error()); Note that I have removed the ";" from the end of the first line when I added the "or die" Link to comment https://forums.phpfreaks.com/topic/83782-solved-prob-with-insert/#findComment-426300 Share on other sites More sharing options...
forumnz Posted December 31, 2007 Author Share Posted December 31, 2007 Thanks! All fixed! Sam. Link to comment https://forums.phpfreaks.com/topic/83782-solved-prob-with-insert/#findComment-426302 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.