0

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

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by arunner
0

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.

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.