-3
When I execute the mysql_query
it gives the following error(even if I manage to connect to the database without major problems)
Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in C:\xampp\htdocs\LuckTor\index.php on line 57
Warning: mysql_query(): A link to the server could not be established in C:\xampp\htdocs\LuckTor\index.php on line 57
The entire code
$connect = mysqli_connect("localhost", "user", "senha", "bd") or die('ERRO AO LOGAR!');
if (!$connect) {
die('Connect Error (' . mysqli_connect_errno() . ') '
. mysqli_connect_error());
}
$name = 'Barbie e sua amiga no paraiso';
$categoria = 'Serie';
$download = 1569;
$upload = 1694;
$magnet = 'magnet:?xt=urn:btih:B250C87526B32E9421AA8FB7599FC11CF3FD1275&dn=Morgan%20-%20A%20Evolu%c3%a7%c3%a3o%202016%20Bluray%20720p%20Dublado%20-%20TPF&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce';
$query = mysql_query("INSERT INTO torrents(`Nome`, `Categoria`, `DownloadQuantity`, `UploadQuantity`, `Magnet`) VALUES ('".$name."', '".$categoria."', '".$download."', '".$upload."', '".$magnet."')");
I did it that way and the mistake continues.
– Lucas Caresia
I tested the connection, and the error remains the same.
– Lucas Caresia
@Lucascarezia the username and password is the same?
– viana
Absolutely, since I can connect with the
mysqli_connect
without returning errors.– Lucas Caresia
Returns
Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\xampp\htdocs\LuckTor\index.php on line 56
– Lucas Caresia