Page 1 of 1

Error message in submitting a support ticket

Posted: Thu Mar 03, 2005 8:14 am
by Ladylogic
I'm using a support ticket script and am getting an error at time ticket is submitted which reads:

Warning: extract(): First argument should be an array; line 776

I viewed the coding and below are a few of the lines:

774 $result = @mysql_query($query);
775 $row = @mysql_fetch_array($result);
776 extract($row);

Not knowing any PHP, I am hoping someone can help. It doesn't seem to hurt the submission; however, as a would-be hosting company, an error like this just isn't cool. :(

Posted: Thu Mar 03, 2005 8:17 am
by CoderGoblin
The sql query is failing. The row is empty and therefore the code is failing.

I would suppose the database has not been set up correctly or access is denied.

The php script itself could be enhanced to show more meaningful messages.

Example:

Code: Select all

$result = @mysql_query($query);
if ($result) {
  $row = @mysql_fetch_array($result);
  extract($row); 
} else {
  die("sql Error "+mysql_error());
}
It doesn't seem to hurt the submission;
Without seeing the rest of the code there is no way of knowing what knock on effects would be somewhere down the line. What may not be visible now may be things like errors in reporting or statistics.

SOLVED

Posted: Thu Mar 03, 2005 9:17 am
by Ladylogic
Thank you.