I'm using this code to output data from a very simple Newsletter database.
I used this same code from another project I did, but where I have:
['paragraph_2'] . "</td></TR>";
I had ['paragraph_2'] . "</td></TR>" .
With this later I got the error:
Parse error: parse error in /home/ricksi/public_html/newsletter/newsletter-new.php on line 35
Which was fine, was on the curly brase after the dot previous, instead of a semicolonn to end the satatment.
However when I corrected that by putting a semicolon, after the quote, I get an error that it can't access the database:
"Warning: mysql_connect(): Access denied for user: 'ricksi_rfigley@localhost' (Using password: YES) in /home/ricksi/public_html/newsletter/dbconnect.php on line 2
I cannot connect to the database because: Access denied for user: 'ricksi_rfigley@localhost' (Using password: YES)"
Does this make any sense? If it can't aces teh database, should I get that error before the parse error?
<?
include('dbconnect.php');
$query = ("select * from newsletter_sections");
$result = mysql_query($query) or die("Query fail");
if (mysql_num_rows($result) == 0)
{
} else
{
echo "<CENTER>";
echo "<table border=1>";
while($row = mysql_fetch_array($result))
{
//echo "<table><tr><td>";
//echo "<table border=1>";
echo "<tr><td> " . " " . $row['newsletter_title'] . "</td></TR>" .
"<tr><td> " . $row['newsletter_title2'] .
"</td><td> " . $row['paragraph_1'] ."</td></TR>" .
"</td><td> " . $row['paragraph_2'] . "</td></TR>";
}
echo "</table>";
}
?>