Re: Lost in query... Trying to get output from query....
| From: | GH | Date: | Mon, 11 Oct 2004 15:33:16 +0000 |
| Subject: | Re: Lost in query... Trying to get output from query.... | ||
| References: | 1 2 | Groups: | php.db php.general |
| Request: | Send a blank email to php-general+get-199183@lists.php.net to get a copy of this message | ||
Thank You Murray's suggestion worked
On Mon, 11 Oct 2004 11:20:57 -0400, John Nichel <john@kegworks.com> wrote:
> GH wrote:
> > Greetings:
> >
> > I am having a problem with trying to get data out of my mySql database.
> >
> > I run my query which works fine and everything...
> >
> > I use:
> >
> > $admin_get_options_query_text = "Select * from adminpage";
> >
> > $admin_get_options_results_reference =
> > mysql_query($admin_get_options_query_text,$db_access) or die("Admin
> > Get Options: ". mysql_error());
> >
> > $admin_get_options_result =
> > mysql_fetch_assoc($admin_get_options_results_reference);
>
> If the query is going to return multiple rows, you need to loop thru the
> result set...
>
> while ( $admin_get_options_result =
> mysql_fetch_assoc($admin_get_options_results_reference) ) {
> // do stuff with each row returned
> }
>
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> john@kegworks.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>