Error message?
Posted: Tue Aug 30, 2011 9:44 am
What does this message mean and how can I make it work?
Could not connect: Access denied for user 'eduardli_user'@'localhost' (using password: YES)
Code:
<html>
<body>
<?php
$con = mysql_connect("localhost","eduardli_user","-z.x,c");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$serial_no = $_POST["serial_no"];
$description = $_POST["description"];
$price = $_POST["price"];
$quantity = $_POST["quantity"];
mysql_select_db("eduardli_company", $con) or die(mysql_error());
mysql_query ("INSERT INTO Products (serial_no, description, price, quantity)
VALUES ('$serial_no', '$description', '$price', '$quantity')") or die(mysql_error());
$latest="select * from Products order by serial_no desc limit 0,1";
$result = mysql_query($latest,$con) or die(mysql_error());
$row = mysql_fetch_array($result);
{
echo $row['serial_no'] . " " . $row['description'] . " " . $row['price'] . " " . $row['quantity'];
echo "<br />";
}
mysql_close($con);
?>
</body>
</html>
Could not connect: Access denied for user 'eduardli_user'@'localhost' (using password: YES)
Code:
<html>
<body>
<?php
$con = mysql_connect("localhost","eduardli_user","-z.x,c");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$serial_no = $_POST["serial_no"];
$description = $_POST["description"];
$price = $_POST["price"];
$quantity = $_POST["quantity"];
mysql_select_db("eduardli_company", $con) or die(mysql_error());
mysql_query ("INSERT INTO Products (serial_no, description, price, quantity)
VALUES ('$serial_no', '$description', '$price', '$quantity')") or die(mysql_error());
$latest="select * from Products order by serial_no desc limit 0,1";
$result = mysql_query($latest,$con) or die(mysql_error());
$row = mysql_fetch_array($result);
{
echo $row['serial_no'] . " " . $row['description'] . " " . $row['price'] . " " . $row['quantity'];
echo "<br />";
}
mysql_close($con);
?>
</body>
</html>