0

Hi,

I want to create a table in Mysql but i receive an error.
Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:\wamp\www\CreateTable\create.php on line 11
Table veriler_2 couldn't been created! :

i give you the whole lines to check it for me. I can not find anything.
$sql = "CREATE TABLE veriler_2
(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, ad VARCHAR (10), soyad VARCHAR (10))";
$res = mysqli_query($mysql, $sql);

Thanks

2
Contributors
3
Replies
6
Views
9 Years
Discussion Span
Last Post by m.pontus
0

resource mysql_query ( string $query [, resource $link_identifier ] )

$res = mysqli_query($mysql, $sql);
$res = mysql_query( $sql, $mysql );
Where $sql - query to mysql server
And $mysql - resource givven by mysql_connect().

0

done, i have forgotten to put "i" after "mysql"
$res = mysqli_query($mysqli, $sql);

0

Oh, sure my mistake. Did you get a link identifier by mysqli_connect?

mysqli mysqli_connect ([ string $host [, string $username [, string $passwd [, string $dbname [, int $port [, string $socket ]]]]]] )

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.