nathan1 Posted August 19, 2008 Share Posted August 19, 2008 Hi guys, i have an error and i dont have a clue why...any ideas would be appreciated! cheers... if(isset($_POST['event_add'])) { $user_id = $_POST['user_id']; $date_pz = date("d.m.y"); $debit_pz = '0'; $event_desc = '0'; $transp = $_POST['price_two']; $query = "INSERT INTO hdebit (user_id, date_p, debit, desc, price_two) VALUES ('$user_id', '$date_pz', '$debit_pz', '$event_desc', '$transp')"; $result = mysql_query($query) or die(mysql_error()); echo 'added.'; } Link to comment https://forums.phpfreaks.com/topic/120311-solved-syntax-error/ Share on other sites More sharing options...
Andy-H Posted August 19, 2008 Share Posted August 19, 2008 And the error is?... Link to comment https://forums.phpfreaks.com/topic/120311-solved-syntax-error/#findComment-619835 Share on other sites More sharing options...
Fadion Posted August 19, 2008 Share Posted August 19, 2008 As we are on a guessing game here , the "desc" column you have there is prohibited. "DESC" is a reserved word in MySQL as it is used for DESCending order. Change it to a different column, something like: "event_desc" for example. Link to comment https://forums.phpfreaks.com/topic/120311-solved-syntax-error/#findComment-619940 Share on other sites More sharing options...
nathan1 Posted August 19, 2008 Author Share Posted August 19, 2008 Yes that was it, thanks SooOO much !!! Link to comment https://forums.phpfreaks.com/topic/120311-solved-syntax-error/#findComment-620586 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.