PDA

Click to See Complete Forum and Search --> : [RESOLVED] Help fixing Parse error: parse error


tony007
Jul 4th, 2006, 04:02 PM
could any on telll me what i am doing wrong i keep getting this error:

Parse error: parse error


pointing at :


echo("<meta http-equiv="refresh" content="60"> ");

<?
require("util.php");
$sql = new MySQL_class;
$sql->Create("color");



#
# Selecting Multiple Rows
#

echo("<html>");

echo("<head>");
echo("<meta http-equiv="refresh" content="60"> ");

#echo("<h3>Log History</h3>\n");
echo("<p><ul><table border=1 cellpadding=4>\n");
echo("<tr><th>Name</th> > <th> color </th> <th> color2</th> </tr>\n");
$sql->Query("Select Name,color,color2 from NameColor");
for ($i = 0; $i < $sql->rows; $i++) {
$sql->Fetch($i);
$Name = $sql->data[0];
$color = $sql->data[1];
$color2 = $sql->data[2];





#echo("<tr><td>$Name</td> <td>$color</td> \n");
#echo("<tr><td><font color="#FF00FF">$Name</font></td> <td>$color</td> \n");
echo "<tr><td>" .$Name ." </td> <td>$color</td> <td style='color2:". $color2 ."' >" . $color2 . " </td> \n";
#echo "<tr><td style='color2:" . $color2 . ";'>" .$Name ." </td> <td>$color</td> \n";


}
echo("</table>\n");
echo("</body>");
echo("</html>");

?>

john tindell
Jul 4th, 2006, 05:56 PM
http://www.vbforums.com/showpost.php?p=2440249&postcount=7

Most of your code doesn't need to be echoed out. PHP shouldn't be used to print out large amounts of HTML, its hard to read and prone to parsing errors like you are getting.

To prevent getting the error in the furture, you need to escape your " in a string, although for string values you really should be using literals ie '.

visualAd
Jul 5th, 2006, 01:34 AM
I thought I remembered answering this (http://www.vbforums.com/showpost.php?p=2533551&postcount=5) one earlier :D