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?
Warning: mysqli_query() expects parameter 1 to be mysqli, re
Moderator: General Moderators
Re: Warning: mysqli_query() expects parameter 1 to be mysqli
Please post the line where $server_connection is defined. It is a line that starts with
PHP Manual: mysqli_query
When you post PHP code, use the BBCode tagsor
[/code]
Edit: This post was recovered from search engine cache.
Code: Select all
$server_connection = When you post PHP code, use the BBCode tags
Code: Select all
[php][/php]Code: Select all
[code=php]Edit: This post was recovered from search engine cache.
Last edited by McInfo on Wed Jun 16, 2010 12:40 pm, edited 1 time in total.
Re: Warning: mysqli_query() expects parameter 1 to be mysqli, re
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]
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]