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?
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 00:01
"High polygon count"
Posts: 15,624
phuzzy wrote:
> A hand, anybody?


*Applauds wildly*
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 09:15
Regular
"previously phuzzy."
Posts: 3,487
WòókieeMøn§†€® wrote:
> phuzzy wrote:
> A hand, anybody?
>
>
> *Applauds wildly*

Why..why thank you.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Just a quick note to say thanks for a very good service ... in fact excellent service..
I am very happy with your customer service and speed and quality of my broadband connection .. keep up the good work . and a good new year to all of you at freeola.
Matthew Bradley
Second to none...
So far the services you provide are second to none. Keep up the good work.
Andy

View More Reviews

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

Go to Support Centre
Feedback Close Feedback

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.