0
I’m kind of new to programming and I’m having a hard time, I was programming a site and running it on wampserver, but from a while I updated the wamp version and the php MYSQL commands stopped working, works only when I switch the commands to MYSQLI and even then it’s still giving me the same errors mysqli_query() expects at least 2 parameters, 1 given in ./.../.....
or mysqli_error() expects exactly 1 parameter, 0 given in
in every select you used, for example:
$variavel = mysqli_query("SELECT * FROM tabela ORDER BY RAND() LIMIT 5") or die(mysqli_error());
the connection part with the bank is so:
header( 'Content-Type: text/html; charset=utf-8' );
$servidor = "...";
$usuarioServidor = "...";
$senhaServidor = "...";
$nomeBD = "...";
$conectar = @mysqli_connect($servidor,$usuarioServidor,$senhaServidor) or die ("Não foi possível acessar o servidor");
$selesionarBD = @mysqli_select_db($nomeBD,$conectar) or die (mysqli_error());
remembering that when I put MYSQL does not work, only with MYSQLI
Why MYSQL commands are no longer working and why MYSQLI are giving error?
Well, answered before then deleted my answer +1, mysql is obsolete from version 5.5.0 php use mysqli. Mysqli documentation page : https://secure.php.net/manual/en/book.mysqli.php
– Rafael Salomão