Link to home
Start Free TrialLog in
Avatar of MrTV
MrTVFlag for Thailand

asked on

varia ble problem

when i  run the code below it not work but when I cahnge $Code02 to 12423 it work  But I try to check value of $Code02 by echo it get  12423


The code that not work

if($submit04)
{
echo $Code02 ;
include ("aut.inc");
$link_id1 = db_connect($default_dbname);

$sql = "UPDATE `sellhead`
                  SET `PayDate` ='$datedue01'

              WHERE Code= '$Code02' ";

$result = mysql_query($sql,$link_id1);
mysql_close($link_id1);


After I change  $Code02 to 12423  it can up date database

$sql = "UPDATE `sellhead`
                  SET `PayDate` ='$datedue01'

              WHERE Code= '12423 ' ";
 
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MrTV

ASKER

the data type of feild Code is double
Did you try my 2 suggestions?
Avatar of MrTV

ASKER

yes i try it not work

The feild PayDate is date  
and varia ble $datedue01 like 20060519

I try but  it put  0000-00-00 00:00:00 in field PayDate
The the problem is the $datedue01 variable, which needs to be in this format: 1997-10-04 22:23:00

$datedue01 = '2006-05-19';

and the query will work
Avatar of aminerd
aminerd

Try putting var_dump($sql); on the line right before you execute the query. Then paste what's printed here.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial