Jump to content

MYSQL Update


cdoggg94

Recommended Posts

Is there something seriously wrong with this code that im missing ?

 

I have written it at least 10-12 different ways and it will NOT update my db..

 

<?php 
mysql_connect('localhost','root','');
mysql_select_db('myDB');

$dates = $_POST['date']; 
$store = $_POST['store'];  // these actually display the correct information

mysql_query = ("UPDATE Agency Stores - Table 1 SET date = '".$date."' WHERE F3 = '".$store."' ");

?>

 

 

there are several other columns in the table.  I have tried to put them in as the value they already have and it still didnt work...

 

any ideas ?

Link to comment
https://forums.phpfreaks.com/topic/252999-mysql-update/
Share on other sites

"Agency Stores - Table 1" - is there name of your table ?

Also not initialized variables $dates and $store will cause Notice with error_reporting(E_ALL)

You must initialize their

mysql_connect('localhost','root','');
mysql_select_db('myDB');

$dates = isset($_POST['date']) ? $_POST['date'] : NULL; 
$store = isset($_POST['store']) ? $_POST['sotore'] : NULL;  // these actually display the correct information

mysql_query("UPDATE `Agency Stores - Table 1` SET `date` = '".$date."' WHERE `F3` = '".$store."' ") or die(mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/252999-mysql-update/#findComment-1297108
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.