sql query/displaying results question
| From: | Adam Williams | Date: | Thu, 23 Oct 2003 14:06:14 +0000 |
| Subject: | sql query/displaying results question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-167292@lists.php.net to get a copy of this message | ||
I have a php page I am writing with an SQL query. I am going to query the
database for a couple of fields. One of the fields I am querying is the
title oh the document someone is searching for. The title will be used at
the top of the html page and will say:
"you are searching for document number ###: document $title"
but then later on down on the page when it starts returning your results:
"document $title: document $location"
So I will have 1 query that needs to print the document $title at the top
of the page and then when it starts showing results. I won't know what
the document title is until the database is queried (because they are
doing a query for keywords in the documents stored in that table in the
database). So at the top of the page can I use my $title from the
database and then when I start showing the results, can I show the same
document $title from the 1st row returned if I am using a while loop, or
because I already used $title at the top from the 1st row returned, will
it want to start at the 2nd row returned when I start my while loop to
return all of the data?
Adam