Jump to content

value not being stored in db


rbragg

Recommended Posts

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);
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.