Jump to content

Basic UPDATE MySQL not working for me...


suttercain

Recommended Posts

Good afternoon,

 

I thought I would have this but after repeated attempts I can't get it.

 

I am trying to update a record but it doesn't want to take.

 

<?php error_reporting(E_ALL); ?>
<?php

require ('get_connected.php');
if (isset($_GET['id'])) {
$record_id = $_GET['id'];
$letter_sent = date('F jS, Y');
    $sql = "UPDATE canada SET letter_sent='" . $letter_sent . "' WHERE record_id='" . $record_id . "'";
echo "<a href='admin_canada.php>Go Back to the Admin Panel</a>";
       
  } else {
  echo " Something Went Wrong!"; }
?>

 

I echoed both $record_id and $letter_sent to verify they were set and they both worked.

 

Is something wrong with my UPDATE line?

Link to comment
https://forums.phpfreaks.com/topic/47946-basic-update-mysql-not-working-for-me/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.