Welcome Guest, Not a member yet? Register   Sign In
Saving multiple relationships to same table: Which method is preferred?
#2

[eluser]Tominator[/eluser]
Can't you make an array?

SQL: WHERE name IN ('John', 'Sally', 'Steve', 'DaMan');

PHP: mysql_fetch_array() -> $query[0] => creator, $query[1] => editor ...

I really don't know, if this is good solution, but it has just one query to DB Smile That's why I think it's faster and cleaner. It's up to you, if it's good to choose Tongue

Note: I'm not using DMZ class (I'm using Active record), so I wrote it as basic PHP, SQL - to make it easy to understand.

Tom.


Messages In This Thread
Saving multiple relationships to same table: Which method is preferred? - by El Forum - 06-26-2010, 03:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB