Jump to content

php not supporting mysql query


thinakaran

Recommended Posts

i am using php 4.4.7 and mysql 5 in a suse 10.2 mechine. i am having error while running a php script.

" warning  mysql_data_seek() supplied argument is not valid MYSQL on line 494"

"warning mysql_fetch_assoc() supplied argument is not valid MYSQL on line 498"

this is the part of my script:

 

if($this->dbType == "mysql"){

                if($this->getRowCount($result) > $rowNum){

 

                    mysql_data_seek($result, $rowNum);--------------line 494

                }

                $this->lastmysqlrow = $rowNum;

 

                $row = mysql_fetch_assoc($result);

 

                if($encode && $this->encode && is_array($row))return array_map('to_html', $row);

                return $row;

anyone please help me.

 

Link to comment
https://forums.phpfreaks.com/topic/64797-php-not-supporting-mysql-query/
Share on other sites

this is my class

  function fetchByAssoc(&$result, $rowNum = -1, $encode=true){

if(isset($result) && $result && $rowNum < 0){

if($this->dbType == "mysql"){

$row = mysql_fetch_assoc($result);

 

if($encode && $this->encode&& is_array($row))return array_map('to_html', $row);

return $row;

}

            else if ($this->dbType == 'oci8') {

            }

            return $row;

//$row = $result->fetchRow(DB_FETCHMODE_ASSOC);

}

if($this->dbType == "mysql"){

if($this->getRowCount($result) > $rowNum){

 

mysql_data_seek($result, $rowNum);

}

$this->lastmysqlrow = $rowNum;

 

$row = mysql_fetch_assoc($result);

 

if($encode && $this->encode && is_array($row))return array_map('to_html', $row);

return $row;

 

}

        else if($this->dbType == "oci8"){

A bit more of the script please, maybe the whole class.

 

this is my class

  function fetchByAssoc(&$result, $rowNum = -1, $encode=true){

      if(isset($result) && $result && $rowNum < 0){

        if($this->dbType == "mysql"){

            $row = mysql_fetch_assoc($result);

 

            if($encode && $this->encode&& is_array($row))return array_map('to_html', $row);

            return $row;

        }

            else if ($this->dbType == 'oci8') {

            }

            return $row;

        //$row = $result->fetchRow(DB_FETCHMODE_ASSOC); 

      }

      if($this->dbType == "mysql"){

            if($this->getRowCount($result) > $rowNum){

 

              mysql_data_seek($result, $rowNum);

            }

            $this->lastmysqlrow = $rowNum;

 

            $row = mysql_fetch_assoc($result);

 

            if($encode && $this->encode && is_array($row))return array_map('to_html', $row);

            return $row;

 

      }

        else if($this->dbType == "oci8"){

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.