Ive been attempting to update a table field using the code below. this page is informed by the previous page which carries a number of values.
when i use:
$query2 = "UPDATE payment_details SET payment_details.custid = $custid ";
the custid field in the DB is updated, however this is obviously useless, as it sets every custid record in the table to the value passed,whereas i just need the one particular record affected.
Ive tried referencing it with other table fields and have even tried passing unneeded values to try and assist.
As you can see below i tried a number of other query variations, which have also failed abysmally!
What am i doing wrong?
any help is very much appreciated.
tia
rob
the relevant code>>>>>>>>>>
$query2 = "UPDATE payment_details SET payment_details.custid = $custid WHERE payment_details.name = $name AND payment_details.payid = $payid";
/*
this one also failed $query2 = "update payment_details set payment_details.custid = $custid WHERE payment_details.name = $name";
oh dear this failed too $query2 = "update payment_details set custid = $custid WHERE customers.custid = $custid AND customers.name = name";
this doesnt work either $query2 = "update payment_details set payment_details.custid = $custid WHERE customers.custid = $custid AND customers.name = payment_details.name";
ive got the hump now $query2 = "update payment_details set custid = $custid WHERE customers.custid = $custid AND customers.name = payment_details.name";
*/
echo "$query2" ;
//$result = mysql_query(query);
$result = mysql_query($query2);
when i use:
$query2 = "UPDATE payment_details SET payment_details.custid = $custid ";
the custid field in the DB is updated, however this is obviously useless, as it sets every custid record in the table to the value passed,whereas i just need the one particular record affected.
Ive tried referencing it with other table fields and have even tried passing unneeded values to try and assist.
As you can see below i tried a number of other query variations, which have also failed abysmally!
What am i doing wrong?
any help is very much appreciated.
tia
rob
the relevant code>>>>>>>>>>
$query2 = "UPDATE payment_details SET payment_details.custid = $custid WHERE payment_details.name = $name AND payment_details.payid = $payid";
/*
this one also failed $query2 = "update payment_details set payment_details.custid = $custid WHERE payment_details.name = $name";
oh dear this failed too $query2 = "update payment_details set custid = $custid WHERE customers.custid = $custid AND customers.name = name";
this doesnt work either $query2 = "update payment_details set payment_details.custid = $custid WHERE customers.custid = $custid AND customers.name = payment_details.name";
ive got the hump now $query2 = "update payment_details set custid = $custid WHERE customers.custid = $custid AND customers.name = payment_details.name";
*/
echo "$query2" ;
//$result = mysql_query(query);
$result = mysql_query($query2);