When I run mysql_query
it gives the following error (even though I can connect to the database without any 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."')");