tenho o seguinte código de conexão ao mysql:
<?php $host = "localhost"; $login = "root"; $senha = ""; $database = "acinfo"; $db = mysql_connect($host, $login, $senha) or die("O Servidor foi beber um café... Tente novamente mais tarde"); mysql_select_db($database,$db); ?>
Porém, na seguinte query:
<?php include ("config.php"); unset($senha); function bd(){ $sql = mysql_query("select * from produtos orderby rand() limit 5"); while($row=mysql_fetch_array($prod)){ echo "<a href=index.php?acao=ver.ID={$row['ID]}>{$row['Nome']}</a><br /> <a href=index.php?acao=ver.ID={$row['ID]}>{$row['Img']}</a><br /> {$row['preco']} <br /> <a href=index.php?acao=ver.ID={$row['ID]}> >>Mais Informações</a><br />"; } ?>O Script não funciona... Uso ele em todos os sites, com o mesmo user e senha, todos rodam, menos esse...
Aparecem os erros:
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\ac\inicio.php on line 21
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\ac\inicio.php on line 21
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\ac\inicio.php on line 22
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\ac\inicio.php on line 30
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\ac\inicio.php on line 30
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\ac\inicio.php on line 31
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\ac\inicio.php on line 39
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\ac\inicio.php on line 39
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\ac\inicio.php on line 40
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\ac\inicio.php on line 46
Tipo... é estranho... alguem consegue me dar uma luz?
vlws ;D