0

I have no idea why this query doesnt work? the WHERE part will work if I put the value in of the rowset, but I can echo out the variable $faultid and its the same? it executes the query but doesnt change the record? all the variables are declared before this statement?

thanks

$result = "UPDATE  faults SET dslam='$dslam', hsl='$hsl',psba='$psba',hostname='$hostname',sitename='$sitename',postcode='$postcode',bandwidth='$bandwidth',live='$live', remedy='$remedy',changeofservice='$changeofservice',
serviceaffecting='$serviceaffecting',comments='$comments',tiepair='$tiepair',circuit='$circuit',faulttype='$faulttype',bttest='$bttest',btref='$btref',assigned='$assigned' WHERE faultid= '$faultid'";
mysql_query($result);
4
Contributors
6
Replies
7
Views
4 Years
Discussion Span
Last Post by websponge
0

Do this and find out:

$response = mysql_query($result) or die(mysql_error() . '<br/>' . $result);

Are you sure none of the variables contains a single quote, messing up your query?

0

nothing gets returned with the above code, there are no errors in the variables, as if I change the where clause to the actual value, i.e 1, it corrects ammends the record where the id is 1.. it just doesnt like the variable in the where clause..

0

before running query echo its output and run in phpmyadmin or observe prepared query statment

echo $result;

mysql_query($result);

0

Dude, thank you, just needed another brain on it! the $faultid wasnt being posted to the page, so it had no idea what it was, I wrapped without quotes when posting it to the page.. works now. thank you for your time :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.