suttercain Posted April 20, 2007 Share Posted April 20, 2007 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 More sharing options...
ataria Posted April 20, 2007 Share Posted April 20, 2007 Nothing is wrong with your line, your just not running a query. $update = mysql_query($sql) or die(mysql_error()); Put that line below $sql. Link to comment https://forums.phpfreaks.com/topic/47946-basic-update-mysql-not-working-for-me/#findComment-234304 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.