rbragg Posted August 6, 2007 Share Posted August 6, 2007 The problem: Why isn't my table being updated with $details?? During testing, I successfully echo $old, $new, and $details ... yet, $details is not updating my table. <?php # select old details for appending $queryDetails = " SELECT details, time_update FROM call WHERE call_num = '$callID' "; $detailsResults = mysql_query($queryDetails); $oldDetails = mysql_fetch_assoc($detailsResults); $old = $oldDetails['details']; # get new details $new = mysql_real_escape_string($_SESSION['tDetails']); $newTime = date('M j, y @ h:i a' ); if ( empty($old) ) # if no old details { $details = $new; } else { $details = $old . "<br><br>" . $newTime . ": " . $new; } # only if new details were entered, then update; if not then do not update if ( !empty($details) ) { $queryUpdateDetails = " UPDATE call SET details = '$details' WHERE call_num = '$callID' "; $updateDetails = mysql_query($queryUpdateDetails); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/63575-value-not-being-stored-in-db/ Share on other sites More sharing options...
micah1701 Posted August 6, 2007 Share Posted August 6, 2007 change: $updateDetails = mysql_query($queryUpdateDetails); to: $updateDetails = mysql_query($queryUpdateDetails) or die(mysql_error()); does that help? Quote Link to comment https://forums.phpfreaks.com/topic/63575-value-not-being-stored-in-db/#findComment-316814 Share on other sites More sharing options...
rbragg Posted August 6, 2007 Author Share Posted August 6, 2007 Well, I have this later down the page: <?php if ( (!$updateStatus) || (!updateDetails) || (!updateTech) ) { die("A query failed: " . mysql_error() ); } ?> So, no. Quote Link to comment https://forums.phpfreaks.com/topic/63575-value-not-being-stored-in-db/#findComment-316818 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.