LRM_php Posted April 10, 2008 Share Posted April 10, 2008 Hey Guyz Im tryin to do an update in my table from my php page heres my code: function UpdateOwn($Title,$Name,$Address,$Phone,$OwnID) { $updateQuery = "UPDATE tblOwner SET Title = $Title, Name = $Name, Address = $Address, Phone = $Phone WHERE OwnerID = $OwnID"; $result = mysql_query($updateQuery); if (!$result) { $errorString = mysql_error(); echo("<br> The error was, $errorString <br>"); } } UpdateOwn($OwnTitle,$OwnName,$OwnAddress,$OwnPhone,$PatOwner);//from form data i keep getting this error: The error was, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Jump St, Phone = 0210220345 WHERE OwnerID = 1005' at line 4 Link to comment https://forums.phpfreaks.com/topic/100468-mysqlphp/ Share on other sites More sharing options...
paul2463 Posted April 10, 2008 Share Posted April 10, 2008 the error does not match the query you dont have a Phone or OwnerID in your query, which query is throwing that error?? Link to comment https://forums.phpfreaks.com/topic/100468-mysqlphp/#findComment-513786 Share on other sites More sharing options...
DyslexicDog Posted April 10, 2008 Share Posted April 10, 2008 You need to add some quotes around your different column values. Link to comment https://forums.phpfreaks.com/topic/100468-mysqlphp/#findComment-513788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.