Whats wrong with this code.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Chazster
Forum Newbie
Posts: 4
Joined: Mon Jun 24, 2002 10:55 am

Whats wrong with this code.

Post by Chazster »

Hi I've got this basic script and it keeps on giving be an error and I can't find what wrong with it heres the code:-

Code: Select all

<?php
$db=mysql_connect("localhost","Charley") or die ("cant connect"); 
mysql_select_db("one",$db) or die ("cant change"); 
$news=mysql_query("select * from review ORDER BY date DESC") or die ("cant get em"); 
while($rows=mysql_fetch_array($news))&#123; 

$date=date("F d, Y H:i ",$rows&#1111;"date"]); 
$author = $rows&#1111;"author"];
$email = $rows&#1111;"email"];
$title = $rows&#1111;"title"];
$review = $rows&#1111;"review"];
$image = $rows&#1111;"image"];
$price = $rows&#1111;"price"];
$rating = $rows&#1111;"rating"];
$number = "100%"; 
$ratings = "$rating.gif";
echo "<html><head><title>$title</title></head><body bgcolor="#FFFFFF" text="#000000"><p><BR></p><p align="center"><font face="Verdana" size="3"><b>$title</b></font></p><table width="92%" border="0" cellspacing="1" height="22" align="center"><tr><td bgcolor="#000000"><table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#FFFFFF"><tr><td><table width="100%" border="0" cellspacing="1"><tr><td width="42%">$image</td><td width="58%">$review</td></tr></table><p>";
echo "</p><table width="26%" border="0" cellspacing="1" cellpadding="0" align="center"><tr><td height="36"><a href="mailto:$email"><img border="0" src="$images/$author.gif" width="130" height="30"> </a></td>";
echo "<td height='36'><div align='right'> <img src='$images/$rating.gif' width='156' height='30'></div></td></tr></table>";
echo "<table width="26%" border="0" cellspacing="1" cellpadding="1" bgcolor="#0000FF" align="center"><tr bgcolor="#0000FF"><td width="17%" height="17"><div align="center"><font face="Verdana" size="1" color="#FFFFFF"><b><b>Price</b></b></font></div></td> </tr><tr bgcolor="#FFFFFF"> <td width="17%"> <div align="center"><font size="2" color="#000000">$price</font></div></td></tr></table>";
echo "<p align="center">$info</p></td></tr></table></td></tr></table></body></html>";

&#125; 

?>

And everytime I come to run it I get this error:-

Parse error: parse error, unexpected '\"' in c:\apache\htdocs\review.php on line 20

Any ideas?
Last edited by Chazster on Mon Jun 24, 2002 1:36 pm, edited 2 times in total.
will
Forum Contributor
Posts: 120
Joined: Fri Jun 21, 2002 9:38 am
Location: Memphis, TN

Post by will »

simple...you misspelled 'echo' three times.
Post Reply