Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Ok, I hope I understood it now.

You'll have to fetch all mysql results into an array and use a loop to iterate over them.
Example, assuming you're using the ubb.threads functions:
// do the query
$sth = $dbh -> do_query($query);
// get the number of returned to know when you've to stop the loop
$rows = $dbh -> total_rows($sth);

// start the loop, do it until max rows is reached
for ($i=0;$i < $rows ;$i++){

list ($yourvalue,$secondvalue) = $dbh -> fetch_array($sth);

if ($i < ($rows / 2)) {
// do something with the values
}
else {
// do something else
}

}

You can change the if condition to anything else.
Note that are many ways to do it. Look at the user comments at http://de3.php.net/manual/de/function.mysql-fetch-array.php for different variants.

Sponsored Links
Entire Thread
Subject Posted By Posted
Breaking Results up into two rows omegatron 01/19/2004 7:53 PM
Re: Breaking Results up into two rows Astaran 01/19/2004 9:18 PM
Re: Breaking Results up into two rows omegatron 01/19/2004 11:10 PM
Re: Breaking Results up into two rows Astaran 01/20/2004 2:04 AM
Re: Breaking Results up into two rows omegatron 01/20/2004 4:08 AM
Re: Breaking Results up into two rows JoshPet 01/20/2004 5:56 AM
Re: Breaking Results up into two rows omegatron 01/20/2004 6:03 AM
Re: Breaking Results up into two rows omegatron 01/20/2004 6:39 AM
Re: Breaking Results up into two rows Astaran 01/20/2004 8:32 AM
Re: Breaking Results up into two rows omegatron 01/20/2004 3:49 PM
Re: Breaking Results up into two rows Astaran 01/20/2004 4:55 PM
Re: Breaking Results up into two rows omegatron 01/20/2004 5:11 PM
Re: Breaking Results up into two rows Astaran 01/20/2004 6:29 PM
Re: Breaking Results up into two rows omegatron 01/20/2004 7:32 PM
Re: Breaking Results up into two rows Astaran 01/20/2004 7:58 PM
Re: Breaking Results up into two rows omegatron 01/20/2004 8:15 PM
Re: Breaking Results up into two rows Astaran 01/20/2004 8:32 PM
Re: Breaking Results up into two rows omegatron 01/20/2004 9:20 PM
Re: Breaking Results up into two rows Astaran 01/20/2004 9:43 PM
Re: Breaking Results up into two rows omegatron 01/20/2004 10:21 PM
Re: Breaking Results up into two rows Astaran 01/20/2004 11:42 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
• Shock Hosting
• Stable Host
• bluehost
• InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,080
Joined: March 2000
Forum Statistics
Forums63
Topics37,583
Posts293,957
Members13,826
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 3703
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 31
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
isaac 2
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20261026)