Scripting issues
Posted: Thu Mar 23, 2006 10:02 am
hawleyjr | Please use
Obviously I have changed the ***** for my password. However when I run the script all I get is the following message:
Warning: mysql_connect(): Access denied for user: 'digslis_root@localhost' (Using password: YES) in /home/digslis/public_html/test3.php on line 6
Unable to select database
I have a feeling that this isn't a script problem but more a problem with my account.
Could anybody advise?
hawleyjr | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hello,
I'm a bit of a newbie to PHP and just can't understand why the following code isn't working. Please could someone advise me on what is going wrong....
The script is...Code: Select all
<?
$username="digslis_root";
$password="*****";
$database="dislis_addresses";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM contacts";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>Database Output</center></b><br><br>";
$i=0;
while ($i < $num) {
$forename=mysql_result($result,$i,"forename");
$surname=mysql_result($result,$i,"surname");
echo "<b>$first $last</b><br>";
$i++;
}
?>Obviously I have changed the ***** for my password. However when I run the script all I get is the following message:
Warning: mysql_connect(): Access denied for user: 'digslis_root@localhost' (Using password: YES) in /home/digslis/public_html/test3.php on line 6
Unable to select database
I have a feeling that this isn't a script problem but more a problem with my account.
Could anybody advise?
hawleyjr | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]