I have read all of the forum messages for this issue but I cannot figure it out. I get the following error:
The error is Access denied for user 'jchilton_jchilto'@'localhost' to database 'jchilton_diabetes'
Here is the code:
<?php
// Connect the to Database
$con = mysql_connect("localhost","jchilton_jchilto","*********");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// Select the Database
$db_select = mysql_select_db('jchilton_diabetes');
if (!$db_select)
{
die('The programmer who wrote this is an idiot because I could not connect to Database. The error is ' . mysql_error());
mysql_close ($con);
}
// Set the query
$result = mysql_query("SELECT * FROM `Readings`");
// This will print the data out line by line
$row = mysql_fetch_row($result);
$Date = $row[1];
$Time = $row[2];
$Reading = $row[3];
echo "<tr>";
echo "<td>$Date</td>";
echo "<td>$Time</td>";
echo "<td>$Reading</td>";
echo "</tr>";
// Close the connection to the database
mysql_close ($con);
?>
Thank you for the help,
Jeff Chilton
The error is Access denied for user 'jchilton_jchilto'@'localhost' to database 'jchilton_diabetes'
Here is the code:
<?php
// Connect the to Database
$con = mysql_connect("localhost","jchilton_jchilto","*********");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// Select the Database
$db_select = mysql_select_db('jchilton_diabetes');
if (!$db_select)
{
die('The programmer who wrote this is an idiot because I could not connect to Database. The error is ' . mysql_error());
mysql_close ($con);
}
// Set the query
$result = mysql_query("SELECT * FROM `Readings`");
// This will print the data out line by line
$row = mysql_fetch_row($result);
$Date = $row[1];
$Time = $row[2];
$Reading = $row[3];
echo "<tr>";
echo "<td>$Date</td>";
echo "<td>$Time</td>";
echo "<td>$Reading</td>";
echo "</tr>";
// Close the connection to the database
mysql_close ($con);
?>
Thank you for the help,
Jeff Chilton