GetDotted Domains

Viewing Thread:
"PHP Woe"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Thu 18/08/05 at 23:37
Regular
"previously phuzzy."
Posts: 3,487
Probably something stupid, but it's killing me. I want to let users sort a list of things by one field. Simple enough. However, I need to select the rows, get data from one field in the row, and create another recursive query using this data to pull the rest of the information out the base and echo it in a table.

$query1 = "SELECT diary_id FROM diary WHERE diary_category = '$diary_select'";
$result1 = mysql_query($query1)
or die()
while ($row1 = mysql_fetch_array($result1))
{

}

I'd like it to be something that puts each found value into separate variables, so that the second search is easier. I've tried various arrays, but I'm no expert.

A hand, anybody?
Fri 19/08/05 at 09:15
Regular
"previously phuzzy."
Posts: 3,487
WòókieeMøn§†€® wrote:
> phuzzy wrote:
> A hand, anybody?
>
>
> *Applauds wildly*

Why..why thank you.
Fri 19/08/05 at 00:18
Regular
"NULL"
Posts: 1,384
Why not use the inbuilt MySQL facility of ORDER BY and just append that to the query string?

i.e. have an array:

$orders = array ("id" => "id", "name" => "name", "title" => "title");

and then use:

if ($_GET['orderby']) { $query1 .= " ORDER BY ".$orders[$_GET['orderby']]; }
Fri 19/08/05 at 00:01
"High polygon count"
Posts: 15,624
phuzzy wrote:
> A hand, anybody?


*Applauds wildly*
Thu 18/08/05 at 23:37
Regular
"previously phuzzy."
Posts: 3,487
Probably something stupid, but it's killing me. I want to let users sort a list of things by one field. Simple enough. However, I need to select the rows, get data from one field in the row, and create another recursive query using this data to pull the rest of the information out the base and echo it in a table.

$query1 = "SELECT diary_id FROM diary WHERE diary_category = '$diary_select'";
$result1 = mysql_query($query1)
or die()
while ($row1 = mysql_fetch_array($result1))
{

}

I'd like it to be something that puts each found value into separate variables, so that the second search is easier. I've tried various arrays, but I'm no expert.

A hand, anybody?

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Impressive control panel
I have to say that I'm impressed with the features available having logged on... Loads of info - excellent.
Phil
My website looks tremendous!
Fantastic site, easy to follow, simple guides... impressed with whole package. My website looks tremendous. You don't need to be a rocket scientist to set this up, Freeola helps you step-by-step.
Susan

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.