I run the code below with cli (no web server)
it works fine on my xampp setup but will not work on my php standalone setup on another machine.
I am not getting any errors (yes error reporting is on), it just wont update the row.
it works if I type the sql straight into mysql query browser.
the funny thing is, if I remove the single quotes from the variables it will work.
fld1 is TINYINT(1) with unsigned unchecked
fld2 is INTEGER()
I thought php can convert strings into the appropriate data type if needed.
any ideas why its working on xampp and not on a php standalone install?
Thanks for any help!
it works fine on my xampp setup but will not work on my php standalone setup on another machine.
Code:
$var1 = "-1"; $var2 = 7; $q="update `table1` set `fld1` = '$var1' where `fld2` = '$var2'"; mysql_query($q);
it works if I type the sql straight into mysql query browser.
Code:
update `table1` set `fld1` = '-1' where `fld2` = '7';
Code:
$q="update `table1` set `fld1` = $var1 where `fld2` = $var2";
fld2 is INTEGER()
I thought php can convert strings into the appropriate data type if needed.
any ideas why its working on xampp and not on a php standalone install?
Thanks for any help!
Comment