ignite Posted May 29, 2007 Posted May 29, 2007 I have recntly add some new collums to my users table like msn age etc. Now my register does not work and i don't no why. Any ideas ? I have put all the information like msn and that in there. Quote
Ghetto Posted May 29, 2007 Posted May 29, 2007 Re: Register You need to add it to the query aswell . $db->query("INSERT INTO users (username, login_name, userpass, realname, lastname, age, aog, msn, aim, aol, yahoo, pers, level, money, points, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup) VALUES( '{$username}', '{$username}', ('{$_POST['password']}'), '{$_POST['realname']}', '{$_POST['lastname']}', '{$_POST['age']}', '{$_POST['aog']}', '{$_POST['msn']}', '{$_POST['aim']}', '{$_POST['aol']}', '{$_POST['yahoo']}', '{$_POST['pers']}', 1, $sm, 0, 0, 1, 100, 100, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP')"); Like that but oviously change them to what yours are called. Quote
ignite Posted May 29, 2007 Author Posted May 29, 2007 Re: Register mysql_query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, name, age, homelocation, hobby, msn, occupation, promo ) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, 'male', unix_timestamp(), '{$_POST['email']}', -1, '$ip','{$_POST['name']}','{$_POST['age']},'{$_POST['homeloaction']}','{$_POST['hobby']}','{$_POST['msn']}','{$_POST['occupation']}','{$_POST['promo']}'", $c); Thats what i have at the moment Quote
ignite Posted May 29, 2007 Author Posted May 29, 2007 Re: Register None the user just doesn't insert into the database Quote
ignite Posted May 29, 2007 Author Posted May 29, 2007 Re: Register Everthing in the users table if it helps userid username userpass level exp money crystals laston lastip job energy will maxwill brave maxbrave maxenergy hp maxhp lastrest_life lastrest_other location hospital jail fedjail user_level gender daysold signedup gang daysingang course cdays jobrank donatordays email login_name display_pic duties bankmoney cybermoney staffnotes mailban mb_reason hospreason voted honor turns cars_owned cars_won cars_lost cars_challs_sent cars_challs_accpt cars_challs_decln cars_races_won cars_races_lost cars_races_income cars_races_friendly cars_races_betted forums_avatar forums_signature posts forumban fb_reason valog valfail valid jailreason crimecount warnings wreason attackslost attackswon crimecountf signature usernotes validation valtries honored new_annoucement mine_level mine_exp mine_needed power max_power gems name age realage homelocation hobby msn occupation married Quote
Decepti0n Posted May 29, 2007 Posted May 29, 2007 Re: Register change it to: mysql_query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, name, age, homelocation, hobby, msn, occupation, promo ) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, 'male', unix_timestamp(), '{$_POST['email']}', -1, '$ip','{$_POST['name']}','{$_POST['age']},'{$_POST['homeloaction']}','{$_POST['hobby']}','{$_POST['msn']}','{$_POST['occupation']}','{$_POST['promo']}'", $c) or die(mysql_error()); and see what comes up Quote
ignite Posted May 29, 2007 Author Posted May 29, 2007 Re: Register Ok thanks well i typed in blah for everything and got this error: 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 'blah','blah','blah','blah'' at line 1 Quote
Decepti0n Posted May 29, 2007 Posted May 29, 2007 Re: Register ,'{$_POST['age']},'{$_POST['homeloaction']}', Need another quote after that, like this: ,'{$_POST['age']}','{$_POST['homeloaction']}', Quote
ignite Posted May 29, 2007 Author Posted May 29, 2007 Re: Register Ok thanks man i think were getting their i now get this error 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 '' at line 1 Quote
Decepti0n Posted May 29, 2007 Posted May 29, 2007 Re: Register lol that error sucks ,'{$_POST['age']}','{$_POST['homeloaction']}', I just noticed, is that meant to be homelocation? Dont know if that'll fix the error tbh but it's worth a shot Quote
ignite Posted May 29, 2007 Author Posted May 29, 2007 Re: Register Oh yer lol spelling error there but i still get the same error i think it maybe becuase of a " or two 'of them in the wrong place Quote
Decepti0n Posted May 29, 2007 Posted May 29, 2007 Re: Register try changing '{$_POST['promo']}'", $c) to '{$_POST['promo']}')", $c) Quote
ignite Posted May 29, 2007 Author Posted May 29, 2007 Re: Register I tied that before and i got Parse error: syntax error, unexpected T_STRING in /home/criminal/public_html/register.php on line 75 Quote
Decepti0n Posted May 29, 2007 Posted May 29, 2007 Re: Register that wouldn't result in a t_string error, since it's only adding a character inside a string already Try it again, otherwise im just blind/dont have enough to find it all out :P Just make sure you test it with proper things (values you'd expect people to put in when registering) Quote
ignite Posted May 29, 2007 Author Posted May 29, 2007 Re: Register Thanks so much i had a look at other querys and found out i need a closing bracket after the speach mark so it looks like this {$_POST['promo']}')",$c); But i don't need the promo bit as there isn't a promo collum. Thanks again +1 for you. Quote
webster2001 Posted May 31, 2007 Posted May 31, 2007 My authenticate.php does not work! help me please some1?1?!? When i put the code in and log on when it goes to authenticate it shows the code... I had to take the code off. Can someboy help me or give me a code that wont do that? Quote
webster2001 Posted May 31, 2007 Posted May 31, 2007 authenticate I go on log in and then on the next page when its loaded it shows the code up on screen. try it the game is called bloodycity.sitesfree.com register with name as test an any pass then log in Quote
webster2001 Posted May 31, 2007 Posted May 31, 2007 Re: Register But i have now changed the code so it shows somthing different. This is what it shows. Access denied for user 'root'@'localhost' (using password: YES) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.