hasek522 Posted July 9, 2008 Share Posted July 9, 2008 Are there any flaws with the sql UPDATE statement below? I believe all my other code is working fine and there is just a problem with the sql statement below. Any help would be greatly appreciated. $sql = "UPDATE pictures SET file_name ='". $_POST['filename']."', description='". $_POST['description']."' WHERE id ='". $_POST['picid']. "';"; Link to comment https://forums.phpfreaks.com/topic/113855-problem-with-phpdatabase/ Share on other sites More sharing options...
cooldude832 Posted July 9, 2008 Share Posted July 9, 2008 why not make sure you have a error check on the query? <?php $sql = "UPDATE pictures SET file_name ='". $_POST['filename']."', description='". $_POST['description']."' WHERE id ='". $_POST['picid']. "';"; $r = mysql_query($sql) or die(mysql_error()."<br /><br />".$sql); ?. Link to comment https://forums.phpfreaks.com/topic/113855-problem-with-phpdatabase/#findComment-585076 Share on other sites More sharing options...
hasek522 Posted July 9, 2008 Author Share Posted July 9, 2008 uhh what is that and how do i do that? Sorry im very new to php. Link to comment https://forums.phpfreaks.com/topic/113855-problem-with-phpdatabase/#findComment-585081 Share on other sites More sharing options...
Bendude14 Posted July 9, 2008 Share Posted July 9, 2008 you must already have this line to execute the query $r = mysql_query($sql) adding this to the end will show you any errors or die(mysql_error() Link to comment https://forums.phpfreaks.com/topic/113855-problem-with-phpdatabase/#findComment-585089 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.