Women in Technology

Hear us Roar



Article:
  Using MySQL from PHP
Subject:   escaping syntax for MySQL in PHP - need help
Date:   2005-07-06 02:00:07
From:   gluino
Hi,


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)


Thanks.

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • escaping syntax for MySQL in PHP - need help
    2005-07-06 02:19:04  gluino [View]

    ok this works:

    echo "<option value=" . $row['coyid'] . ">" . $row['name'] . "</option>";