
![]() |
vsloathe
Alright so I've got a table with 4 fields, looks like this
TABLE `unique` ( `id` int(11) NOT NULL auto_increment, `ip` varchar(20) NOT NULL default '', `regid` varchar(50) NOT NULL default '', `num` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) Why the hell would the query $query="INSERT INTO unique (ip, regid, num) VALUES ('$ip','$key','1')"; Not work? I have checked, and it will not work if I fill in the values manually either, so it has nothing to do with the variables, I confirmed they're both being pro perly set.vsloathe
Nevermind. Like an idiot I was using reserved words - in one table as the actual name, in another as a name of the attribute. I'm used to being pampered by MSSQL and flat out told I can't create a table with that name, lol.
![]() arms
also you don't need to quote the ints but i don't know if that causes an error.
nutballs
$query="INSERT INTO unique (ip, regid, num) VALUES ('$ip','$key','<>1>')";
the bold part should not be quoted. the field is INT but you are passing a string it would seem. Unless oracle doesnt care. But yea, the unique part seemed kinda like an odd table name. To avoid the reserved names I always name my tables Application_Tablename Also means that if you need to combine apps into 1 DB, you wont have problems. vsloathe
Yeah I realized that soon after I posted, that I was putting the 1 in quotes. Thanks for pointing that out guys.
Finally got it to work correctly. |

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads