NYCPHP Meetup

NYPHP.org

[nycphp-talk] mysqli errors

Michael Sims jellicle at gmail.com
Wed Sep 28 17:41:46 EDT 2005


The mysqli extension works nicely for accessing MySQL from PHP.  However, 
it throws warnings like a Mardi Gras float throws beads.

"Warning: mysqli::query(): No index used in query/prepared statement ..."

Some SELECT statements cannot use an index.  "SELECT foo FROM bar" doesn't 
use an index, because you want all the rows.  That doesn't stop mysqli 
from giving this warning, though.  Sometimes mysqli gives this warning 
even when MySQL is apparently using an index (i.e. the same query, 
executed with EXPLAIN, says it's using an index).  Shouldn't this be a 
notice rather than a warning anyway?  It's not an error that your query 
isn't using an index...

Question: what's the easiest and best way to get mysqli to shut up about no 
index being used?  I generally want to see errors, other warnings and 
notices, so I can't just turn them off.


Michael Sims



More information about the talk mailing list