Page 1 of 1

UPDATE help

Posted: Mon Feb 27, 2006 6:05 am
by spitfire_esquive
hello guys, i figured that a fresh set of eyes could maybe find the error in this syntax :

Code: Select all

$upd_ebakresolved="UPDATE clientquery SET
            date_received='".$upddate_received."',
            time_received='".$updtime_received."',
            application='".$updapplication."',
            issue='".$updissue."',
            thru='".$updthru."',
            sources='".$updsources."',
            datacountry='".$updcountry."',
            nature='".$updnature."',
            escalated='".$updescalated."',
            resolved='".$updresolved."',
            project_request='".$updproject_request."',
            media_request='".$updmedia_request."',
            date_res='".$upddate_res."',
            time_res='".$updtime_res."',
            date_dump='".$upddate_dump."',
            time_dump_m='".$updmin_dump."',
            prep_by='".$updprep_by."'
            WHERE queryid='".$updqueryid."'";

            $updunresolved=mysql_query($upd_ebakresolved);

            if ($updunresolved)
            {
              echo "Record Updated.";
            }
            else
            {
              echo "Could not update record. ";
              exit;
            }
whatever i do i couldn't seem to update the record even if i just copy pasted the update syntax from a working update script in the same php file. It always says "Could not update record."

thanks in advance!

Posted: Mon Feb 27, 2006 6:19 am
by onion2k
That code looks fine. Have you escaped all the input data correctly? Are the column names right? What does mysql_error() say?

Posted: Mon Feb 27, 2006 8:14 am
by spitfire_esquive
thanks for that onion2k. i'll do it tomorrow at the office :) i'm definitely going to use the mysql_error() option!