Jump to content

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

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.