Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error message

Status
Not open for further replies.

tanveer91

Programmer
Nov 13, 2001
31
GB
Hi all,

I am trying to display records from a psql database to the web browser, unfortunatly, it displays the following error message:-

Parse error: parse error in /home/httpd/business/customerlist.php on line 18

Here is my code:-

$db = pg_connect("host=larry port=4132 dbname=business_db user=httpd password=test");
if (!$db) {printf ("Error: Unable to access Database"); exit; }

$query = "SELECT * FROM customers";
$result = pg_exec($db, $query);
if (!$result) {printf ("ERROR"); exit;}
$numrows = pg_numrows($result);
$row=0;
printf (&quot;<table border=1>\n&quot;);
printf (&quot;<tr><td>ID</td><td>Customer Name</td><td>Fleet</td><td>Fleet Ref.</td><td>End User</td></tr>\n&quot;);
do
{
$myrow = pg_fetch_row ($result,$row);
printf (&quot;<tr><td>%s</td><td>%s</td><td>%s</td></tr>\n&quot;, $myrow[1],
$myrow[2], $myrow[3],);
$row++;
}
while ($row < $numrows);
printf (&quot;</table>\n&quot;);
pg_close($db);
?>

ANY IDEAS WHATS WRONG WITH IT?......UR HELP IS GREATLY APPRECIATED.


 
The last comma shouldnt be here:
printf (&quot;<tr><td>%s</td><td>%s</td><td>%s</td></tr>\n&quot;, $myrow[1], $myrow[2], $myrow[3],);
Try and remove it. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top