views:

112

answers:

0

I am building an object oriented wrapper for sql using mysqli - thats neither here nor there. I'm trying to use error numbers to detect if a database/table/column doesn't exist. Things would all be fine and dandy if I didn't receive error number 656434540.... Of course the error message is "bo.boo' doesn't exist". Its SUPPOSED to read "Table 'garbo.boo' doesn't exist" - but it seems all my mysqli error messages get truncated off the front (another question all together).

I have already successfully used the error number for "database not found" as documented here: http://dev.mysql.com/doc/refman/5.0/en/error-messages-server.html

So my question is, why in gods name am I receiving a biazzare error number? Could it be a corrupted installation? If anyone could answer the truncated error messages question, that would be nice too.

Heres some pared down code that produces both pecularities:

$blah = new mysqli("localhost", "root", "", "garbo");

$resultSet = array();
if($blah->multi_query('INSERT INTO boo (whatever) VALUES (34);'))
{  do /* store first result set */
   {  if($result = $blah->store_result())
      {  $results = array();
         while($row = $result->fetch_row())
         {  $results[] = $row;
         }
         $result->free();
         $resultSet[] = $results;
      }else
      { $resultSet[] = array();
      }
   }while($blah->next_result());
}

if($blah->errno)
{ echo "* The error is: ERROR(".$blah->errno.") ".$blah->error . "\n";
}