Xtremer360 Posted April 18, 2011 Share Posted April 18, 2011 I'm trying to make sure if this block of code makes sense to everyone and if not what am I doing wrong? if (isset($_POST['editbio'])) { $defaultCharID = (int)$_POST['defaultCharID']; foreach($_POST as $fieldID => $value) { if($bioFieldID != "submitBio" || "defaultCharID") { $query = "UPDATE `fieldContents` SET `content` = '".$value."', `fieldID` = '".$fieldID."' WHERE `characterID` = '".$defaultCharID."'"; mysqli_query($dbc,$query); $result = "good"; } } } Quote Link to comment https://forums.phpfreaks.com/topic/234105-bio-update/ Share on other sites More sharing options...
cyberRobot Posted April 19, 2011 Share Posted April 19, 2011 If you're trying to make the block of code easier to understand for other people, you should look into adding comments. http://php.net/manual/en/language.basic-syntax.comments.php Quote Link to comment https://forums.phpfreaks.com/topic/234105-bio-update/#findComment-1203298 Share on other sites More sharing options...
KevinM1 Posted April 19, 2011 Share Posted April 19, 2011 Where does $bioFieldID come from? You also have a syntax error in your if-conditional. Quote Link to comment https://forums.phpfreaks.com/topic/234105-bio-update/#findComment-1203306 Share on other sites More sharing options...
Xtremer360 Posted April 19, 2011 Author Share Posted April 19, 2011 Sorry I fixed it all. Quote Link to comment https://forums.phpfreaks.com/topic/234105-bio-update/#findComment-1203307 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.