Jump to content
New Reality: Ads For Members ×

error meaning


mindapolis

Recommended Posts

I changed the database  name     $db = new PDO("mysql:host=$hostname;dbname=hercules.xymmetrix.net", $username, $password);

but it say SQLSTATE[42000] [1044] Access denied for user 'mediasvcunltd'@'monolith.xymmetrix.net' to database 'hercules.xymmetrix.net'

Link to comment
https://forums.phpfreaks.com/topic/299464-error-meaning/#findComment-1526304
Share on other sites


<?php
require_once('functions.php');
$hostname = "hercules.xymmetrix.net";
$username = "...";
$password = "...";
try {

$db = new PDO("mysql:host=$hostname;dbname=hercules.xymmetrix.net", $username, $password);

echo 'Connected to database';
}
catch(PDOException $e)
{
echo $e->getMessage();
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<form action ="contactUs.php" method="post">
<label>
<input id = "fname" type="text" name="fname" size="15" placeholder="First Name" value ="<?php echo !empty($_POST['fname']) ? $_POST['fname'] : '';?>" > <?php echo !empty($error['fname']) ? $error['fname'] : '';?>
<input type="text" name="lname" size="20" placeholder="Last Name"><?php echo !empty($error['lname']) ? $error['lname'] : '';?>
<input type="text" name="orgName" placeholder="Organization's Name"maxlength="50">
</label><br />
<label> <!--new row -->
<input id = "address" type="text" name="address" size="15" placeholder="Street Addresss" maxlength="50">
<input id = "city" type="text" name="city" placeholder="City" size="10" maxlength="25">
<select id = "state" name = "state" placeholder="State" value="">
<option value ="Please choose a state">
Please choose a state
</option>
<?php states($state); ?>
</select>
<input id = "zipcode" type="number" name="zipcode" placeholder="Zip Code" size="5" maxlength="5">
</label><br />
<label> <!--new row -->
<input type="text" name="phone" placeholder="Phone Number:(including area code)" size="10" maxlength="10">
</label>
<input type="text" name="fax" size="10" placeholder="Fax Number: (including area code)" maxlength="10">
</label><br />
<label> <!--new row-->
<input type="text" id = "email" name="email" placeholder="Email Address" />
<input type="text" id = "confirmEmail" name="ConfirmEmail" placeholder="Confirm Email Address" />
</label><br />
<label> <!--new row -->
What would you like help with?
<table id="projectOptions">
<tr span=2>
<td><input type="checkbox" name="SocialMedia">Social Media </td>
<td><input type="checkbox" name="WebContentManagement">Web Content Management </td>
</tr>
<tr>
<td><input type="checkbox" name="MarketingMaterials">Marketing Material Creation </td>
<td><input type="checkbox" name="SEO">SEO (Search Engine Optimization) </td>
</tr>
<tr>
<td><input type="checkbox" name="VideoEditing"> Video Editing </td>
<td><input type="checkbox" name="WebDesign">Web Design </td>
</tr>
</table>
</label>
Overview about the project:<textarea rows="5" cols="10" placeholder="Overview of Project"></textarea> <br />
If you are not a robot, what year is it? <input type="text" name="year" size="4" maxlength="4"><br />
<input type="submit" name="submit" value="Contact Me!">
<input type="reset" name="reset" value="Cancel">
</form>
</body>
</html>
Link to comment
https://forums.phpfreaks.com/topic/299464-error-meaning/#findComment-1526307
Share on other sites

I'm fairly sure the name of your database is not hercules.xymmetrix.net. That might be the hostname, but not the actual database name.

 

Since trial-and-error won't help in this situation, you'll have to figure out your database credentials. What does your old code say?

Link to comment
https://forums.phpfreaks.com/topic/299464-error-meaning/#findComment-1526313
Share on other sites

I'm sorry I got confused.  The hostname is hercules.xymmetrix.net and the database name is www_media_services_unlimited but I'm getting get the same error. 

 

SQLSTATE[42000] [1044] Access denied for user 'mediasvcunltd'@'monolith.xymmetrix.net' to database ' www_mediaservicesunlimited_com'

$hostname = "hercules.xymmetrix.net";
$username = "";
$password = "";
try {
	
    $db = new PDO("mysql:host=$hostname;dbname=	www_mediaservicesunlimited_com", $username, $password);
    
    echo 'Connected to database';
    }
catch(PDOException $e)
    	{
    echo $e->getMessage();
    }
Link to comment
https://forums.phpfreaks.com/topic/299464-error-meaning/#findComment-1526504
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.