PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
This is probably something really simple I just can't see. This is just for an admin page of a script I am working on. This part is supposed to create a table (from a variable), grab the files names of a directory on my server, then insert the file names into the new table.
It is creating the table, but not inserting the data. Before I had it creating the table, it was inserting the data into existing tables fine. So its some conflict or something but I just don't see it.
1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''110' VALUES('0', '001.jpg')' at line 1
Can you use a period with VARCHAR? I've never needed to put periods in text fields before.
You most likely need to run mysql_real_escape_string() on your variables to escape quotes before sending the SQL query. If that's not it, echo $query to see if the SQL is what you think it should be.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
table, database, and field references should be in backticks not single quotes. The latter tells MySQL it's a string, which is the error in your syntax.
table, database, and field references should be in backticks not single quotes. The latter tells MySQL it's a string, which is the error in your syntax.