Re: DB will INSERT wont UPDATE..error in code?
| From: | Matthew Kiehne | Date: | Wed, 13 Oct 2004 02:26:28 +0000 |
| Subject: | Re: DB will INSERT wont UPDATE..error in code? | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-36765@lists.php.net to get a copy of this message | ||
sorry this is the output i meant to post
SQL statement = UPDATE badges SET staff = '1' ttlpst = '1' mnthpst =
'1'
ttlicon = '/trophies' mnthicon = '/ribbons' WHERE fid = 61
and this is the error i get....yet i still cant for the life of me find a
problem
Update query = UPDATE badges SET staff = '1' ttlpst ='1' mnthpst = '1'
ttlicon = 'trophies' mnthicon = 'medals' WHERE fid = 61Query3 failed: You
have an error in your SQL syntax near 'ttlpst ='1' mnthpst = '1' ttlicon =
'trophie' at line 3
thanks for your help
--
Advanced Forums, For Free! - Speak EZ forums (
http://www.speakezforums.com )
"Jason Wong" <php-db@gremlins.biz> wrote in message
news:200410130711.00490.php-db@gremlins.biz...
> On Wednesday 13 October 2004 04:08, Matthew Kiehne wrote:
>
> > database, however when i want to update the SQL query returns an output
> > like this 'SQL statement = UPDATE badges
> > (staff,ttlpst,mnthpst,ttlicon,mnthicon) VALUES
> > ('1','1','1','/ribbons','/ribbons')
> > WHERE fid=2' but when i try to pull
the
> > information from the database it hasnt updated, can someone help me out
> > with this...im not sure why it wouldnt update even though the statement
> > looks correct.
>
> I don't see how you get the above output when $sql is defined like so:
>
> > $sql = "UPDATE badges SET staff =
> > '".$HTTP_POST_VARS["staff"]."' ttlpst
=
> > '".$HTTP_POST_VARS["ttlpst"]."' mnthpst =
'".$HTTP_POST_VARS["mnthpst"]."'
> > ttlicon = '".$HTTP_POST_VARS["ttlicon"]."' mnthicon =
> > '".$HTTP_POST_VARS["mnthicon"]."' WHERE fid = $fid";
>
> echo $sql;
>
> Make use of mysql_error().
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-db
> ------------------------------------------
> /*
> There are three things I always forget. Names, faces -- the third I
> can't remember.
> -- Italo Svevo
> */
>