NoMansLand Posted February 20, 2009 Share Posted February 20, 2009 Hello, What im trying to do is quite simple, add in some text into the same row. I have one that doesnt work this al uses $_GET[] $sql = "UPDATE reciept SET model='$model', cost ='$cost', paid='$paid', WHERE docket = '$docket')"; Please help Quote Link to comment https://forums.phpfreaks.com/topic/146058-update-mysql-database-with-php/ Share on other sites More sharing options...
JoeBuntu Posted February 20, 2009 Share Posted February 20, 2009 I think you need to drop the comma between '$paid' and WHERE Quote Link to comment https://forums.phpfreaks.com/topic/146058-update-mysql-database-with-php/#findComment-766748 Share on other sites More sharing options...
Maq Posted February 20, 2009 Share Posted February 20, 2009 Get rid of that last comma, right before the WHERE clause. Other than that your syntax looks correct. Are you echoing out $sql to ensure you have the correct values? Are you using or die(msyql_error()) at the end of your query execution? If these don't work we need all the relevant code... Quote Link to comment https://forums.phpfreaks.com/topic/146058-update-mysql-database-with-php/#findComment-766749 Share on other sites More sharing options...
Q695 Posted February 20, 2009 Share Posted February 20, 2009 remove the , before WHERE so it reads: $sql = "UPDATE reciept SET model='$model', cost ='$cost', paid='$paid' WHERE docket = '$docket'"; There is also a misspelling in there Quote Link to comment https://forums.phpfreaks.com/topic/146058-update-mysql-database-with-php/#findComment-766818 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.