Jump to content

Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given


Recommended Posts

Pls help not sure how to fix: I put the 410 just to mark the line in question Thanks In Advance

 

    function sql_escapestring($string)

    {

        return $this->sql_addq($string);

    }

    function sql_addq($string)

    {

        static $magic_quotes;

        if (!isset($magic_quotes)) $magic_quotes = get_magic_quotes_gpc();

        if ($magic_quotes) $string = stripslashes($string);

410  return (version_compare(phpversion(), '4.3.0', '>=')) ? mysqli_real_escape_string($string) : mysqli_escape_string($string);

 

    }

    function sql_error($query_id = 0)

    {

        return array('message' => @mysqli_error($this->db_connect_id), 'code' => @mysqli_errno($this->db_connect_id));

    }

    function sql_ufetchrow($query = "", $type=SQL_BOTH)

    {

        $query_id = $this->sql_query($query, true);

        $result = $this->sql_fetchrow($query_id, $type);

        $this->sql_freeresult($query_id);

        return $result;

mysqli_real_escape_string($string) ...

 

 

this needs to have 2 params the other parameter is your database connection so something like this

 

mysqli_real_escape_string($dbc, $string)

 

This is presuming your connection information is stored in a variable called $dbc

yer thats the line you are looking for.

 

i could do with seeing more of your code but this could work i think if its in the right place

 

mysqli_real_escape_string($this->db_connect_id, $string)

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.