simple mysql question/problem

Thread Solved

Join Date: Aug 2009
Posts: 3
Reputation: arunner is an unknown quantity at this point 
Solved Threads: 0
arunner arunner is offline Offline
Newbie Poster

simple mysql question/problem

 
0
  #1
Aug 17th, 2009
Hi people,

I have run across this website many times, with the first impression that it was a website to ask a guy named 'Dani' questions about code *snicker*.

I haven't introduced myself. Maybe I will. But I have a question.
In building a program, I'm running mysql code. In a certain instance that's not foreign to the others, I try to update an id of a row where the id is set to something. (UPDATE page2module SET id = "0" WHERE id = "13")
it simply won't work. Can I not change the same field in which I get the row from?
I'm confused.

Help is appreciated,

-Josh
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 880
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 142
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark

Re: simple mysql question/problem

 
0
  #2
Aug 17th, 2009
Yes, you can, but mysql won't accept the double quotes. If the id field is an integer, you can remove them. If it is a string field, use single quotes instead.

There may be an issue when the id field is an auto-increment field. I think you're not allowed to update it, if it is.
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 3
Reputation: arunner is an unknown quantity at this point 
Solved Threads: 0
arunner arunner is offline Offline
Newbie Poster

Re: simple mysql question/problem

 
0
  #3
Aug 17th, 2009
Originally Posted by pritaeas View Post
Yes, you can, but mysql won't accept the double quotes. If the id field is an integer, you can remove them. If it is a string field, use single quotes instead.

There may be an issue when the id field is an auto-increment field. I think you're not allowed to update it, if it is.
hm. I find that strange. maybe that's for the older version of sql, bc I use double quotes all the time, just bc that's how my sql class handles it, but I'll make sure to correct.

THANKYOU. that must be it! though...I kinda hate that since that's how I organize.

thanks man!

-Josh
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the MySQL Forum
Thread Tools Search this Thread



Tag cloud for MySQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC