vForums Support Banner


Visit Base Classics - Gaming Chairs

 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Programming Discussion :: Updating a row - View Topic
Topic Rating: *****
Printable View
Dylan
Junior Member
**

[Avatar]

Posts: 136
Status: Offline
Gender: Male
Joined:  
Reputation: 0%  


pmwwwmsnaimxfire
Updating a row (8th Feb 08 at 2:52am UTC)
Could I do this?
mysql_query("UPDATE users SET something+1 WHERE username='1'");

I'm trying to do something like that and it's not working.


Image
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 8 11
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
Re: Updating a row (8th Feb 08 at 11:35am UTC)
It'd be:

Code:
 
  1. mysql_query("UPDATE users SET something=something+'1' WHERE username='1'");
 

Image
Dylan
Junior Member
**

[Avatar]

Posts: 136
Status: Offline
Gender: Male
Joined:  
Reputation: 0%  


pmwwwmsnaimxfire
Re: Updating a row (8th Feb 08 at 12:21pm UTC)
Thanks rosss


Image
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 32
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Updating a row (8th Feb 08 at 8:43pm UTC)
 
It'd be:

Code:
 
  1. mysql_query("UPDATE users SET something=something+'1' WHERE username='1'");
 


Actually, it should be:

Code:
 
  1. mysql_query("UPDATE users SET something=something+1 WHERE username='1'");
 


Numbers shouldn't be inside quotes. {Wink}

rroll.to— Shorten a link, rickroll your friends.
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 8 11
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
Re: Updating a row (8th Feb 08 at 9:22pm UTC)
I've always used them in quotes and it works fine. In fact I think I had errors last time I tried with no quotes.

Image
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 32
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Updating a row (9th Feb 08 at 4:33am UTC)
 
I've always used them in quotes and it works fine. In fact I think I had errors last time I tried with no quotes.


That's odd. {Unsure} I'm sure that I saw on PHP's site that quotes take more time to process than without. {Unsure}

I shall search for it again and see what I find. {Smile}

rroll.to— Shorten a link, rickroll your friends.
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 8 11
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
Re: Updating a row (9th Feb 08 at 10:23am UTC)
I'll have to try no quotes next time then and see if that helps {Smile}

Image
 Printable View

All times are GMT+0 :: The current time is 8:22am
Page generated in 0.7245 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums