MySQL server version for the right syntax to use near '' at line 10
DbError:YouhaveanerrorinyourSQLsyntax;checkthemanualthatcorrespondstoyourMySQLserverversionfortherightsyntaxtousenear''atline1publicstaticfunctiongetCount($table,$conditi... Db Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
public static function getCount( $table, $condition = NULL )
{
self::getinstance( "read" );
if ( !empty( $condition ) || is_array( $condition ) )
{
$where = "";
foreach ( $condition as $key => $val )
{
self::parsekey( $key );
$val = self::parsevalue( $val );
$where .= " AND ".$key."=".$val;
}
$where = " WHERE ".substr( $where, 4 );
}
else if ( is_string( $condition ) )
{
if ( strtoupper( substr( trim( $condition ), 0, 3 ) ) == "AND" )
{
$where = " WHERE ".substr( trim( $condition ), 4 );
}
---------------------------------------------------------------------------------------------------
log里面报错是:
$where = ";
求大神! 展开