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
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"){

Link to comment
Share on other sites

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"){

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.