Re: [PHP-DB] Searching many-to-many map tables

2007-02-08 Thread Steve McGill
group_id_1=1 and group_id_2=2 into a map-table query in a better way than I've done already. Steve Chris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Steve McGill wrote: Hello, I am trying to find out how to search a many-to-many map table efficiently. I have an example

[PHP-DB] Searching many-to-many map tables

2007-02-07 Thread Steve McGill
Hello, I am trying to find out how to search a many-to-many map table efficiently. I have an example table: user,user_group 1,1 1,2 2,1 3,2 I want to find out all the users who are a member of BOTH groups 1 AND 2. In this example, this would just be the user with id 1. Until now, I can

[PHP-DB] Copying a set of database records

2005-03-04 Thread Steve McGill
A sort of similar question to my last one: I have a table with about 100 records all related to one product. I want to create a new product, based on the details from the old product. So in PHP, I would fetch the 100 records, alter the productID, and then insert it 100 in 100 separate SQL

[PHP-DB] Re: Problem with mysql_fetch_array after first loop...

2005-03-03 Thread Steve McGill
Jeffrey Baumgartner [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] I've made a little programme that deletes expired records from database tables. The troublesome bit looks like this... $query = SELECT ic FROM ic_ic WHERE date = CURDATE(); $result =

[PHP-DB] Updating many records at a time

2005-03-01 Thread Steve McGill
I have a situation where I am doing lots of complex sorting on records that already exist in a MySQL table. The table has a 'sort_order' field which means I can do a simple ORDER BY sort_order to keep it nice and quick on SELECT, it's only UPDATE which is slow. If I change the order that I want

Re: [PHP-DB] Updating many records at a time

2005-03-01 Thread Steve McGill
Steve McGill wrote: I have a situation where I am doing lots of complex sorting on records that already exist in a MySQL table. The table has a 'sort_order' field which means I can do a simple ORDER BY sort_order to keep it nice and quick on SELECT, it's only UPDATE which is slow