jamesxg1 Posted January 17, 2010 Share Posted January 17, 2010 Hiya, This is really annoying me, I have this code. if($this->password !== $this->passwordconf): return 'Registration Failed!'; else: $this->time = date('H:i:s'); $this->date = date('Y-m-d'); $this->road = mysql_real_escape_string(trim($road)); $this->registerInsert = "INSERT INTO `members` (`emailaddress`, `firstname`, `lastname`, `password`, `housenumber`, `road`, `city`, `county`, `postcode`, `time`, `date` `refcount`, `earnings`) VALUES('$this->emailaddress', '$this->firstname', '$this->lastname', '$this->password', '$this->housenumber', '$this->road', '$this->city', '$this->county', '$this->postcode', '$this->time', '$this->date', '0', '0') LIMIT 1"; $this->referrerInsert = "INSERT INTO `referrals` (`referrer`, `member`, `time`, `date`) VALUES('$this->refer', '$this->time', '$this->date') LIMIT 1"; if(mysql_query($this->registerInsert) == FALSE): return 'Registeration failed!'; else: if(mysql_query($this->referrerInsert) == FALSE): return 'Registeration failed!'; else: $this->levelOne($this->refer); echo 'done'; endif; endif; endif; It's returning the return value for the first if statment if(mysql_query($this->registerInsert) == FALSE): but whats wrong with the query if its not executing ? Many thanks James. Link to comment https://forums.phpfreaks.com/topic/188745-how-do-i-check-if-a-query-has-been-executed/ Share on other sites More sharing options...
Buddski Posted January 17, 2010 Share Posted January 17, 2010 return 'Registeration failed!' . mysql_error(); Its not working because, im guessing, your 'LIMIT 1' on the insert statements.. They aren't needed.. Link to comment https://forums.phpfreaks.com/topic/188745-how-do-i-check-if-a-query-has-been-executed/#findComment-996353 Share on other sites More sharing options...
jamesxg1 Posted January 17, 2010 Author Share Posted January 17, 2010 return 'Registeration failed!' . mysql_error(); Its not working because, im guessing, your 'LIMIT 1' on the insert statements.. They aren't needed.. Hiya mate, I took the LIMIT's out and i set the error level I now get "Column count doesn't match value count at row 1" Many thanks James. Link to comment https://forums.phpfreaks.com/topic/188745-how-do-i-check-if-a-query-has-been-executed/#findComment-996362 Share on other sites More sharing options...
Buddski Posted January 17, 2010 Share Posted January 17, 2010 Your referrer query isnt passing in a member value.. either specify a value or remove the field name from the query. Link to comment https://forums.phpfreaks.com/topic/188745-how-do-i-check-if-a-query-has-been-executed/#findComment-996363 Share on other sites More sharing options...
jamesxg1 Posted January 17, 2010 Author Share Posted January 17, 2010 Fixed! lol. Cheers for your help and time mate. Many thanks James. Link to comment https://forums.phpfreaks.com/topic/188745-how-do-i-check-if-a-query-has-been-executed/#findComment-996365 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.