Hi the code below works:
private function doPreEventStart {
$row = db_fetch_item("SELECT resultid FROM ResultPackage
where ResultPackage.slotid like {$this->curSlotId}
ORDER BY RAND() LIMIT 1");
$this->curResultId = $row['resultid'];
However when I add in the following lines:
private function doPreEventStart($this->myusers as $user) {
$row = db_fetch_item("SELECT resultid FROM ResultPackage
where ResultPackage.slotid like {$this->curSlotId}
and ResultPackage.PackageID like {$user->packageid}
ORDER BY RAND() LIMIT 1");
$this->curResultId = $row['resultid'];
It no longer runs on the server. I checked the SQL database and the tables do exist. What could possibly be wrong? Thanks Dobro
I'm pretty sure that the assignment of the parameter in your function is causing issues. Try setting it as a simple parameter in the function definition but use the $this->myUsers
etc when you call the function.
private function doPreEventStart($user) {
$row = db_fetch_item("SELECT resultid FROM ResultPackage
where ResultPackage.slotid like '%{$this->curSlotId}%'
and ResultPackage.PackageID like '%{$user->packageid}%'
ORDER BY RAND() LIMIT 1");
$this->curResultId = $row['resultid'];
}