MySQL connection: Access denied for user


#1

So, I'm not sure what I'm doing wrong, but I'm coming back to the Allowable Hosts lead.  Is there something I don't have set correctly?  I'm not declaring fitzpatrick.dreamhost.com as the server name in my PHP:

[code]<select name="user_id">
                    <option>Select a User (Required Field)</option>
                    <?php
                        $user_name = "USER";
                        $password = "PASSWORD";
                        $database = "DB_NAME";
                        $server = "real.website.com";
                        //connect to host
                        $db_handle = mysql_connect($server,$user_name,$password) or ('Could not connect: ' . mysql_error());
                        //connect to database
                        mysql_select_db($database, $db_handle) or die('Could not select: ' . mysql_error());
                        //collect user names
                        $query = mysql_query("SELECT * FROM user") 
                            or die(mysql_error());
                        while($user = mysql_fetch_array($query)) {
                            echo("<option value=\"".$user['name']."\">".$user['name']."</option>");
                        }
                        mysql_close($db_handle);
                    ?>
                </select>[/code]

Any thoughts?  Thanks!

So, I’m not sure what I’m doing wrong, but I’m coming back to the Allowable Hosts lead. Is there something I don’t have set correctly? I’m not declaring fitzpatrick.dreamhost.com as the server name in my PHP:

<select name="user_id"> <option>Select a User (Required Field)</option> <?php $user_name = "USER"; $password = "PASSWORD"; $database = "DB_NAME"; $server = "real.website.com"; //connect to host $db_handle = mysql_connect($server,$user_name,$password) or ('Could not connect: ' . mysql_error()); //connect to database mysql_select_db($database, $db_handle) or die('Could not select: ' . mysql_error()); //collect user names $query = mysql_query("SELECT * FROM user") or die(mysql_error()); while($user = mysql_fetch_array($query)) { echo("<option value=\"".$user['name']."\">".$user['name']."</option>"); } mysql_close($db_handle); ?> </select>

Any thoughts? Thanks!