Current location: Hot Scripts Forums » Programming Languages » PHP » Warning: Wrong parameter count for mysql_error()


Warning: Wrong parameter count for mysql_error()

Reply
  #1 (permalink)  
Old 04-05-06, 09:47 AM
deeps_ar deeps_ar is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Question Warning: Wrong parameter count for mysql_error()

I'm getting the error: Warning: Wrong parameter count for mysql_error() in the following code at line in bold (first one) and Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource at the line in bold (second occurence).

Any help please?

Quote:
function & getData($sql)
{
$this->data_array = array();
$pageno= $this->pageno;
$rows_per_page = $this->rows_per_page;
$this->lastpage = 0;
if ($pageno == '' || $pageno <= '1')
$pageno = 1;

$sql = $sql;
$result = mysql_query($sql, $this->db) or mysql_error("SQL", E_USER_ERROR);
if( strtolower($this->paging_require) =="yes")
{
if ($rows_per_page > 0)
$limit_str = "LIMIT " .($pageno - 1) * $rows_per_page ."," .$rows_per_page;
else
$limit_str = NULL;
}

if($result && mysql_num_rows($result))
{
$this->total_rows=mysql_num_rows($result);
}
else
$this->total_rows=0;
if( strtolower($this->paging_require) =="yes")
{
$query_sql ="$sql $limit_str";
$result=mysql_query($query_sql, $this->db);
}
if(mysql_num_rows($result) <= 0)
{
$this->pageno =1;
$this->total_page=1;
$error_msg=$this->errors;
return 0;
}
else
{
if ($rows_per_page > 0 && strtolower($this->paging_require) =="yes")
$this->total_page = ceil($this->total_rows/$rows_per_page);
else
$this->total_page = 1;

$this->last_page =$this->total_page;
$query_data = mysql_fetch_row($result);

if ($pageno > $this->last_page)
$pageno = $this->last_page;

$this->pageno = $pageno;
mysql_data_seek($result, 0);
while ($row = mysql_fetch_assoc($result))
{
$this->data_array[] = $row;
}
mysql_free_result($result);

return $this->data_array;
}
}
Deep
Reply With Quote
  #2 (permalink)  
Old 04-05-06, 12:58 PM
deeps_ar deeps_ar is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
unknown problem - probably $session issue clantron PHP 6 03-19-06 01:36 PM
Warning: mysql_connect() wzzly PHP 7 02-17-06 05:09 AM
Warning: Wrong parameter count... Tim Mousel PHP 5 01-23-06 12:10 PM
what am i doing wrong? mixx PHP 3 01-02-06 06:47 PM
Wrong parameter count for mysql_fetch_assoc() altlprsn PHP 1 05-26-04 09:40 PM


All times are GMT -5. The time now is 07:07 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.