IGCAssassin Posted October 1, 2008 Share Posted October 1, 2008 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; Quote Link to comment https://forums.phpfreaks.com/topic/126556-warning-mysqli_real_escape_string-expects-exactly-2-parameters-1-given/ Share on other sites More sharing options...
Bendude14 Posted October 1, 2008 Share Posted October 1, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/126556-warning-mysqli_real_escape_string-expects-exactly-2-parameters-1-given/#findComment-654481 Share on other sites More sharing options...
IGCAssassin Posted October 1, 2008 Author Share Posted October 1, 2008 How would I know what variable my connection information is stored in. Quote Link to comment https://forums.phpfreaks.com/topic/126556-warning-mysqli_real_escape_string-expects-exactly-2-parameters-1-given/#findComment-655006 Share on other sites More sharing options...
revraz Posted October 1, 2008 Share Posted October 1, 2008 You set it when you make the connection. Quote Link to comment https://forums.phpfreaks.com/topic/126556-warning-mysqli_real_escape_string-expects-exactly-2-parameters-1-given/#findComment-655013 Share on other sites More sharing options...
KevinM1 Posted October 1, 2008 Share Posted October 1, 2008 How would I know what variable my connection information is stored in. Presumably, you have something like the following somewhere in your code: $dbc = mysql_connect('host', 'user', 'password'); Quote Link to comment https://forums.phpfreaks.com/topic/126556-warning-mysqli_real_escape_string-expects-exactly-2-parameters-1-given/#findComment-655018 Share on other sites More sharing options...
IGCAssassin Posted October 1, 2008 Author Share Posted October 1, 2008 This is the only line i can find thats close to that. $this->db_connect_id = @mysqli_connect($this->server, $this->user, $this->password); Quote Link to comment https://forums.phpfreaks.com/topic/126556-warning-mysqli_real_escape_string-expects-exactly-2-parameters-1-given/#findComment-655026 Share on other sites More sharing options...
Bendude14 Posted October 2, 2008 Share Posted October 2, 2008 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) Quote Link to comment https://forums.phpfreaks.com/topic/126556-warning-mysqli_real_escape_string-expects-exactly-2-parameters-1-given/#findComment-655422 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.