Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
Right i have two Mysql tables, one is called for arguments sake, USERS the other is called ALBUMS, both have columns that can contain the same data, column in the USERS table is called user_id, column in the ALBUMS table is called showroom_id
basically i want to check both tables and if user_id from USERS = showroom_id from ALBUMS then do something...
Any ideas?
[Edited on 19-07-2006 by Steve]
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
Ok rough code that should work but doesnt
code:
$res = $postrow[$i]['user_id'];
$sql3 = "SELECT c.cat_id
FROM phpbb_album_cat AS c
WHERE c.cat_user_id = '$res'";
if( !($result = $db->sql_query($sql3)) )
{
message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql);
}
if ($db->sql_numrows($result) == 0);
{
$res2 = "F";
}
'TEST' = $res2;
why does test always output F
|
Planty02
Member
Registered: 5th Mar 05
Location: Burslem, Stoke-on-Trent
User status: Offline
|
Would an SQL statement along these lines help:
select USERS.user_id from USERS, ALBUMS where USERS.user_ID = ALBUMS.showroom_ID;
the if the statement returns a value then do something
[Edited on 19-07-2006 by Planty02]
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
no worries iv sorted it got it working a peach, dont you just love that feeling of something when it works
[Edited on 19-07-2006 by Steve]
|
Planty02
Member
Registered: 5th Mar 05
Location: Burslem, Stoke-on-Trent
User status: Offline
|
I know that feeling well - its great
|
Robin
Premium Member
Registered: 7th Jan 04
Location: Northants Drives: Clio 182 Cup
User status: Offline
|
http://i17.photobucket.com/albums/b81/sevenweblog/George_Peppard7.jpg
|