parse error

From: Date: Sat, 02 Feb 2002 12:38:38 +0000
Subject: parse error
Groups: php.db 
Request: Send a blank email to php-db+get-16440@lists.php.net to get a copy of this message
I'm working through the New Riders MySQL book and I get the following error when running a php script, can someone help? Thanks, Matt - Parse error: parse error in c:\program files\apache group\apache\htdocs\genesis\dump_info.php on line 25 Here's lines 25 - printf ("<TD>%s</TD>\n", htmlspecialchars ($row[$i])); Here's the full code if that helps - <?php # dump_names.php - dump Genesis info include ("genesis.inc"); $title = "Genesis info list"; html_begin ($title, $title); genesis_connect () or die ("Cannot connect to server"); # issue query $query = "SELECT collector_material, name, description, coating, size FROM mp ORDER BY name"; $result = mysql_query ($query) or die ("Cannot execute query"); print ("<TABLE>\n"); # read results of query, then clean up while ($row = mysql_fetch_row ($result)) { print ("<TR>\n); for ($i = 0; $i < mysql_num_fields ($result); $i++) { # escape any special characters and print printf ("<TD>%s</TD>\n", htmlspecialchars ($row[$i])); } print ("</TR>\n"); } mysql_free_result ($result); print ("</TABLE>\n"); html_end (); ?>

« previous php.db (#16440) next »