Access denied for user
Posted by: JackP (---.range81-153.btcentralplus.com)
Date: June 03, 2007 12:55PM

Hi,
i recently installed WAMP5 with the intention of testing databases through
my Macomedia Flash swf files.

I checked that PHP was working with a simple file that echo'd variables
back to the Flash interface, and all works fine

I set up a simple database with MySQL named my_sites, with a table - sites

I wrote a simple PHP file to connect and return the information and placed
it in my www folder -

<?php
$dbhost = 'localhost';
mysql_connect($dbhost);

$db = mysql_select_db("my_sites"winking smiley;
$qResult = ("SELECT * FROM sites ORDER BY id ASC"winking smiley;
$nRows = mysql_num_rows($qResult);
$rString ="&n=".$nRows;
for ($i=0; $i< $nRows; $i++){
$row = mysql_fetch_array($qResult);
$rString .="&id".$i."=".$row['id']."&"."&title".$i."=".$row['title']."&".
"&link".$i."=http://".$row['link']."&";
}
echo $rString."&";
?>

When i run the Flash file, I receive these errors in the output window -

mysql_connect() - Access denied for user 'ODBC'@'localhost' (using password: NO)
mysql_select_db() - Access denied for user 'ODBC'@'localhost' (using password: NO)
mysql_select_db() - A link to the server could not be established
mysql_num_rows(): supplied argument is not a valid MySQL result resource

all files from the installation are original with no changes made
i have mysql-connector-odbc-3.51.15 installed on my system

can anyone shed some light on why I am recieving these errors ?

Thanks to anyone who can spare the time to help,

Jack.


Options: ReplyQuote
Re: Access denied for user
Posted by: JackP (---.range86-148.btcentralplus.com)
Date: June 03, 2007 03:02PM

update - adding the user to my php file has enabled access

$dbhost = 'localhost';
$dbuser = "root";
mysql_connect($dbhost,$dbuser);

Options: ReplyQuote
Re: Access denied for user
Posted by: CyberSpatium (71.237.217.---)
Date: June 03, 2007 06:25PM

check out my manual


CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!


Cellular Phone Deals - The Best on the Net! - FREE PHONES! Take your pick from our featured cellular phone deals by Cingular, Verizon, T-Mobile, Sprint PCS, Nextel, and more! Most of our cellular phone offers include a FREE cellular phone with FREE shipping!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote


Sorry, only registered users may post in this forum.