|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Web Coding | |
[MySQL] Insert query error!
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | |
|
Programmer
|
Code:
mysql_query("INSERT INTO `table` ( `url` , `ip` ) VALUES('http://mysite.com' , '0.0.0.0')");
Quote:
Thanks! |
|
|
|
|
|
|
#2 (permalink) | |||||||||||
|
Database Developer
|
In your "insert into" statement, you shouldn't need the quotes around the table and column names. Try this:
INSERT INTO table ( url , ip ) VALUES('http://mysite.com' , '0.0.0.0') Also, your table name really isn't called "table", right? If so, you should really change your database schema. If for some reason you do need your table called "table", enclose it in square brackets like this: [table]. Hope that helps!
|
|||||||||||
|
|
|
|
|
#3 (permalink) | |||||||||||||
|
AMD Overclocker
|
mysql_query("INSERT INTO `table` (`url`,`ip`) VALUES ('http://mysite.com','0.0.0.0')");
Works perfectly fine for me. I'm sure you have one of your table/row names messed up.
__________________
My s939 rig build log thread - 4600+ @ 2.8Ghz stable ![]() Aumotocnic "An unfortunate member of the overclock.net insomnia club" Quebec Overclockers - 8019 in 3dMark06s939 Manny 4600+ @ 2809Mhz @ 1.425V (9 hours Orthos blend test stable - 24/7 Usage) - http://valid.x86-secret.com/show_oc.php?id=289741 @ 2945Mhz @ 1.45V (YAY! - Not stable, doh!) - http://valid.x86-secret.com/show_oc.php?id=276669
Last edited by Starholdest : 02-11-08 at 01:24 PM. |
|||||||||||||
|
|
|
|
#4 (permalink) | |||||||||||||
|
Overclocker
|
Your code is fine. I imagine it is the database itself. Have you got the ip row set up as an integer? If so, I don't think it will work due to the .'s, change it to VARCHAR(15).
__________________
|
|||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|