Re: query output failing

From: Date: Fri, 27 Oct 2000 03:19:55 +0000
Subject: Re: query output failing
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-22255@lists.php.net to get a copy of this message
On Fri, 27 Oct 2000, Theodore Jones wrote: > Hey, > > I've got my mysql engine running and root access restored.... thanks > everyone who offered up help to me. > > Today I am experimenting with output to an HTML page via PHP. Here's a > peice of code I'm working with, and I can't figure out why PHP failes to > output any values from the database file. I allready have the database > connection information linked up in an external file, so it does know > what database and user name to make the query with by the way.... I > mainly just want it to iterate throught the whole table and output every > row's values... > > <? > $q = " SELECT * > FROM photo_archive_series > ORDER BY series_id"; > > $r = mysql_query($q); > > while($query_array = mysql_fetch_array($r)) { > echo "Series ID = $query_array[series_id] <BR>\n"; > echo "Series Title = $query_array[series_title] <BR>\n"; > echo "Link Syntax = $query_array[link_syntax] \n"; > } > ?> Try: echo "Series ID = $query_array["series_id"] <BR>\n"; Note quotes around the field name. See also extract(). -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#22255) next »