| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| New Member Join Date: Jan 2006 Location: the Netherlands
Posts: 7
![]() | |
| |
| | #2 (permalink) |
| NamePros Member Join Date: May 2006
Posts: 160
![]() | Not knowing your database schema doesn't help, but I'm wondering: is your 'Permission' column a number type or a string type? I'm assuming it's a number type, in which case you shouldn't have those single quotes around the permission value you are trying to set. That could be a problem... For example, change: PHP Code: PHP Code: |
| |
| | #3 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,556
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | It could be a problem with magic_quotes not enabled on the new server http://www.php.net/magic_quotes Are you trying to insert a string which contains a ' by chance ?
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| |
| | #4 (permalink) |
| Eating Pie Join Date: Nov 2004 Location: Canada
Posts: 2,272
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Try printing your querys and see what you get? I suspect there is a problem with your query somewhere.. Either a mis-named column or a missing one. I suggest you check your names and make sure everything is spelt right. Generally where it stops off is where the problem is. - Steve
__________________ I feel old. |
| |
| | THREAD STARTER #5 (permalink) |
| New Member Join Date: Jan 2006 Location: the Netherlands
Posts: 7
![]() | Thanks for replies guys. I printed the query, it looked as follows: PHP Code: Twisty: the field is indeed an integer, so I shouldn't use the quotes. Still though, in other partsd of the script, I used quotes for integers as well and they don't give out an error. I'll check and see if it works, though. ????: NamePros.com http://www.namepros.com/showthread.php?t=225527 EDIT: Nope, that wasn't the problem. Using the code you suggested, it still gives out the same error message. Any ideas?
__________________ |
| |
| | #6 (permalink) |
![]() Join Date: Jul 2005 Location: Coffs H, Australia
Posts: 3,456
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Well first off, MySQL considers columns with names Username and username to be different (notice the capitals, so I would siggest first removing the capitals from the column names, so your code would become this: ????: NamePros.com http://www.namepros.com/showthread.php?t=225527 Code: $q = "INSERT INTO User(username,password,permission) VALUES(
'" . $_POST['form_user'] . "','" . $pass . "','1'
)"; Code: $pass = md5($_POST['form_pass']);
$fUser=$_POST['form_user']
$q = "INSERT INTO User(Username,Password,Permission) VALUES('" .$fUser . "','" . $pass . "','1')";
__________________ Free Forums / GoDaddy Coupon Codes (NEW DOMAIN!) / Free Arcade Script / <?='Your computer is '.(1?fine:broken).'.'?> |
| |
| | THREAD STARTER #8 (permalink) |
| New Member Join Date: Jan 2006 Location: the Netherlands
Posts: 7
![]() | Thanks for the help guys, a friend of mine solved the problem. It turned out the User tablename is reserved on this server while it probably wasn't on the old. Thanks for the support anyway!
__________________ |
| |