last_trace Posted December 18, 2006 Share Posted December 18, 2006 I'm on my dev server right now but..I keep getting an error "DB Error: syntax error"[code]<?php$sql = "INSERT INTO `links` (`email`, `website`, `website_name`, `button`, `accepted`) VALUES('$email','$website','$website_name','$button','0')"; $result = $db->query($sql); if (DB::isError($result)) { die ($result->getMessage()); } else { echo 'You have successfully applied and I will review your submission.'; }?>[/code]any ideas? Link to comment https://forums.phpfreaks.com/topic/31035-pear-db-abstraction/ Share on other sites More sharing options...
btherl Posted December 18, 2006 Share Posted December 18, 2006 If you have a syntax error, try printing out [code=php:0]$sql[/code]. My guess is that one of your variables contains the ' character.You should always use mysql_real_escape_string() on any data you are putting into an SQL query. Link to comment https://forums.phpfreaks.com/topic/31035-pear-db-abstraction/#findComment-143290 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.