Hi,I have a small problem when including a file that has the connection info.
When I have this piece of code in my script
include ("http://localhost/database/connect.php");
index.php returns
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\index.php on line 18
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\index.php on line 18
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\index.php on line 19
but when I comment this line and use this there is no problem:
mysql_connect("localhost", "kostis", "123") or die(mysql_error());
mysql_select_db("Assasins") or die(mysql_error());
All of the code:
Index.php
<?php
include ("http://localhost/database/connect.php");
/**
* @author Constantine Loukas
* @copyright 2008
*/
/*
mysql_connect("localhost", "kostis", "123") or die(mysql_error());
mysql_select_db("Assasins") or die(mysql_error());
*/
echo "<Title>Assassins</title>";
echo "<center>
Welcome to the official site of Assasins in PSPA<br/>
Last player Registered :";
echo "</center>";
$result = mysql_query ("SELECT * FROM players ORDER BY id DESC LIMIT 1");
$lastuser = mysql_fetch_array($result);
echo $lastuser['Alias'];
?>
connect.php
<?php
/**
* @author Constantine Loukas
* @copyright 2008
*/
mysql_connect("localhost", "kostis", "123") or die(mysql_error());
mysql_select_db("Assasins") or die(mysql_error());
?>
Can someone tell me where is the problem?
Thanks in advance.