Page 1 of 1

Warning: mysqli_query() expects parameter 1 to be mysqli, re

Posted: Sat Jun 27, 2009 9:00 am
by ercie34
hello guys,

i dont get why this error happening?
"Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in file bla bla bla..."

all i do is :

$sql = mysqli_query($server_connection,"SELECT * FROM urun_hareket");

$a = mysqli_fetch_array($sql );

and where is the problem here?

is php or i crazy today?

Re: Warning: mysqli_query() expects parameter 1 to be mysqli

Posted: Sat Jun 27, 2009 9:35 am
by McInfo
Please post the line where $server_connection is defined. It is a line that starts with

Code: Select all

$server_connection = 
PHP Manual: mysqli_query

When you post PHP code, use the BBCode tags

Code: Select all

[php][/php]
or

Code: Select all

[code=php]
[/code]
Edit: This post was recovered from search engine cache.

Re: Warning: mysqli_query() expects parameter 1 to be mysqli, re

Posted: Sat Jun 27, 2009 10:34 am
by ercie34
hello,
here is my connection statements,

[ php ]

$hostname_server_connection = "localhost";
$database_server_connection = "abc";
$username_server_connection = "abc";
$password_server_connection = "abc";

$server_connection = mysql_pconnect($hostname_server_connection, $username_server_connection, $password_server_connection) or trigger_error(mysql_error(),E_USER_ERROR);
$db_selected = mysql_select_db('uadasi2', $server_connection);
if (!$db_selected) {
die ('Cant Access To DataBase, There Might Be A Problem With Internet Or Server, Please Try Later : ' . mysql_error());
}
mysql_query("SET NAMES 'latin5'");
mysql_query("SET CHARACTER SET 'latin5'");
mysql_query("SET COLLATION_CONNECTION = 'latin5_turkish_ci'");

[ /php]