ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Using MySQL from PHP
Subject:   escaping syntax for MySQL in PHP - need help
Date:   2005-07-06 02:00:07
From:   gluino

I'm new to MySQL / PHP, most of my problems are with quotes and escaping quotes etc...

Can you spot my error(s)?

while($row = mysql_fetch_array($result)) {
echo "<option value=\"$row['coyid']\">$row['name']</option>";

PHP error is:
"Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/html/test/dataentry.php on line 62"
(line 62 is the echo line above)


1 to 1 of 1
1 to 1 of 1