Jump to content

How do i check if a query has been executed ?


jamesxg1

Recommended Posts

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 ? :confused:

 

Many thanks

 

James.

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"  :confused::shrug:

 

Many thanks

 

James.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.