and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello
I am currently using learning PHP MySQL and apache in 24 hours by Sams publishing
Here is my script
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]2.[/b] Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.[/quote]
[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]1.[/b] Select the correct board for your query. Take some time to read the guidelines in the sticky topic.[/quote]
What column types are you using? It is very likely that your first column is the Primary Key, which probably requires an integer. You are trying to set it to ''. A better query would be:
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I tried what you suggested with the columns but the same message came up.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
#1. You really shouldn't be trying to insert a value into an auto_increment field. The purpose of auto_increment is to automatically assign a value to the field each time you insert a record.
#2. I would strongly advise you NOT to remove the strict mode from your database system! That's one of the best protections you have against poor syntax (such as your leaving out the names of the columns you want to update) and potential corruption of your data.
Your right I probably shouldn't be inserting data in the auto_increment field. So this book I'm going through doesn't seem to be very good. (Learning PHP, MySQL and Apache in 24 hours by Sams)
So does anyone know some good tutorials I could use instead to learn these applications.
INSERT INTO testTable (id, testField) VALUES ('NULL', '12')
I'm at work right now and won't be home till late and I'm wondering if I change anything in the my.ini file in the Mysql directory when I get home will I have to restart my computer for changes to take effect.
The reason I'm asking is I want to turn strict mode back on as per advice I was given earlier.
I've always left out the auto-incrementing column from the insert query, if it's not included, mysql will treat it as null, and use the next incremented value.