Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
|
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 13th, 2006, 05:04 PM
Registered User
 
Join Date: Dec 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Order by based on two columns, each in two tables?

Just realized this probably was a better place to post my situation... So here's the link:

http://p2p.wrox.com/topic.asp?TOPIC_ID=53588

It's basically how to order the results obtained from one table based on data in another table.

 
Old December 14th, 2006, 06:49 AM
Authorized User
 
Join Date: Oct 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this if this can help:

   $query="SELECT id,levelofaccess, email, division
   FROM personel";
   $divisions=mysql_query($query)or die(mysql_error());
while($row = mysql_fetch_array($divisions)) {
    extract($row);
   $searchperson = $id;

    echo "display statement";

  $queryrank="Select rank_name, division
 FROM rank
  WHERE division = '$searchperson'";
 $divisions1=mysql_query($queryrank)or die(mysql_error());
while($row1 = mysql_fetch_array($divisions1)) {
  extract($row1);

 echo "display";
}
}

 
Old December 17th, 2006, 12:19 PM
Registered User
 
Join Date: Dec 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nope, doesn't work. It's alright. I'm going to come up with a dirty solution, and I'll post it here. Hopefully you or somebody else will see my solution and see what I was aiming for. I should have the solution posted up here in within a few days and when that happens, I'll be looking forward to your input.

Thanks for the initial response.






Similar Threads
Thread Thread Starter Forum Replies Last Post
copy columns based on cell values EricB123 Excel VBA 0 December 18th, 2007 12:51 AM
ORDER BY Date Columns.... seananderson Access 8 March 16th, 2007 05:35 AM
Order by based on two columns, each in two tables? LockesRabb SQL Language 4 December 14th, 2006 02:42 AM
Resetting DIVs based on stacking order keithc BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 6th, 2006 03:32 PM
i don't get values from 4 tables in right order Haroldd SQL Language 3 September 19th, 2003 06:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.