[PHP-DB] Insert db values into dropdown box error

2004-12-09 Thread Edward Dias
 

Hi,

I would like insert into a dropdown box values from my mysql database
column
Using the sample below I'm getting this error (Parse error: parse error,
unexpected) on this line (while($row=mysql_fetch_array($result)({  )
But I'm not able to identify the problem, Any help is greatly
appreciated 
TIA


tr
   tdProject Number:/td
   td
?
require_once(DB.php);

$sql=(SELECT project_number
  FROM projects
  ORDER BY project_number);
//$result=mysql_query($query);

  $result = $db-query($sql);
   if( DB::isError($result) ) {
  die ($result-getMessage());
   }

// start the select box
echo select project_number='project_number'\n;
while($row=mysql_fetch_array($result)({
  echo option
value=\$row[project_number]\$row[project_number]/option\n;
}
echo /select;

?
/tr

Edward 
 

 
This electronic mail message contains information belonging to PaymentOne, 
which may be confidential and/or legal privileged. The information is intended 
only for the use of the individual or entity named above. If you are not the 
intended recipient, you are hereby notified that any disclosure, printing, 
copying, distribution, or the taking of any action in reliance on the contents 
of this electronically mailed information is strictly prohibited. If you 
receive this message in error, please immediately notify us by electronic mail 
and delete this message. 

 
 
  

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Insert db values into dropdown box error

2004-12-09 Thread Norland, Martin
 -Original Message-
 From: Edward Dias [mailto:[EMAIL PROTECTED] 
 while($row=mysql_fetch_array($result)({
   echo option
value=\$row[project_number]\$row[project_number]/option\n;
 }
You have a backwards parenthesis.
Try:
while($row=mysql_fetch_array($result)) {

Cheers,
- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Insert db values into dropdown box error

2004-12-09 Thread dpgirago
It looks like the parenthesis on the line with the 'while' loop is an 
opening parenthesis instead of a closing parenthesis.

 while($row=mysql_fetch_array($result)({
   ^
dave