943,735 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Marked Solved
  • Views: 582
  • MySQL RSS
Aug 17th, 2009
0

simple mysql question/problem

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
arunner is offline Offline
3 posts
since Aug 2009
Aug 17th, 2009
0

Re: simple mysql question/problem

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.
Sponsor
Featured Poster
Reputation Points: 550
Solved Threads: 728
Bite my shiny metal ass!
pritaeas is offline Offline
4,166 posts
since Jul 2006
Aug 17th, 2009
0

Re: simple mysql question/problem

Click to Expand / Collapse  Quote originally posted by pritaeas ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
arunner is offline Offline
3 posts
since Aug 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: uheight table
Next Thread in MySQL Forum Timeline: Decimal data type problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC