MySQL server version for the right syntax to use near '' at line 1 5
DbError:YouhaveanerrorinyourSQLsyntax;checkthemanualthatcorrespondstoyourMySQLserverv...
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 = ";
求大神! 展开
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 = ";
求大神! 展开
展开全部
把实际出错的语句输出,才比较容易看到问题出在哪。
更多追问追答
追问
我在phpmyadmin里面执行,出来这个
#1064 - 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 '<?php
追答
您在phpmyadmin里边执行的什么啊?怎么会有<?php呢?
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |