UPDATE help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
spitfire_esquive
Forum Commoner
Posts: 37
Joined: Sun Nov 06, 2005 6:46 am

UPDATE help

Post 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!
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

That code looks fine. Have you escaped all the input data correctly? Are the column names right? What does mysql_error() say?
spitfire_esquive
Forum Commoner
Posts: 37
Joined: Sun Nov 06, 2005 6:46 am

Post 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!
Post Reply