php mysql_fetch_array()和 mysql_fetch_row()的报错的问题···新手求教
嗨wqe 2015-02-26 09:52:12 这是我分页代码
function setSQL($sql){
$awal=(!empty($_GET[$this->param1]) && is_numeric($_GET[$this->param1])) ? intval($_GET[$this->param1]) : 0;
$hal =(!empty($_GET[$this->param2]) && is_numeric($_GET[$this->param2])) ? intval($_GET[$this->param2]) - 1 : 0;
$src = (preg_match("/.+FROM.+/",$sql)) ? "FROM" : "from";
$expsql = substr( $sql , strpos($sql,$src) + strlen($src) , strlen($sql) - 1 );
$koneksi = mysql_query("SELECT COUNT(*) FROM ".$expsql);
$having = strpos(strtolower($expsql), $condition_sql);
if($having===false)
{
list($jumlah) = mysql_fetch_row($koneksi) //这里报错显示
}
else
{
$jumlah = mysql_num_rows($koneksi);
}
$this->numRows = $jumlah;
$koneksi = mysql_query($sql." LIMIT $awal,$this->totalRecordPage");
$data = array();
while($row = mysql_fetch_array($koneksi)){ //这里报错显示[/color]
$data[] = $row;
}
这里调用分页的
if($day==6){//21
$date1=date("Y-m-d",mktime(0, 0, 0,date("m"),date("d")-date("w")-0,date("Y")));
$date2=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-date("w")+0,date("Y")));
$sql="SELECT a.period,a.type1,a.type2,a.result,a.open_time FROM mme1_
}
if($day==7){//22
$date1=date("Y-m-d",mktime(0, 0, 0,date("m"),date("d")-date("w")-0,date("Y")));
$date2=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-date("w")+0,date("Y")));
$sql="SELECT a.period,a.type1,a.type2,a.result,a.open_time FROM mme2_
}
$pg = new Pagging("resulttext2.php?page=".$_GET['page']."");
$pg->totalRecordPage = 25;
$pg->setSQL($sql);
好像