The database server and the web server are on separate machines.
Table A contains a record for each user.
Let's say Table B contains 'relationship' information. They can be
of type 'friend' or 'family'.
If a user knows another user, this relationship would be kept in this
table, along with the type of relationship. Table B can get big.
10,000's or maybe 100,000's.
I'm doing a query in PHP and want to end up with two arrays.
One for type friend and one for type family.
Which is better:
(Method 1) Do ONE query for all the records that meet a certain
criteria (let's say 'active'). Then use PHP to loop through the
results and put each record into either the friend array or the
family array.
(Method 2) Do TWO queries. One just for friend. Loop through the
records and put into friend array;
Then do another query for family...and loop through again.
Method (1) needs to evaluate an IF statement in PHP for every record.
Method (2) hits the database twice, but doesn't require a PHP IF.
(Should I take an extra hit on the database and use Method 2?)
-James
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]