corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Doing my head in help!


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Doing my head in help!
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
19th Jul 06 at 13:55   View Garage View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
19th Jul 06 at 14:34   View Garage View User's Profile U2U Member Reply With Quote

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
19th Jul 06 at 14:42   View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
19th Jul 06 at 15:32   View Garage View User's Profile U2U Member Reply With Quote

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
19th Jul 06 at 15:33   View User's Profile U2U Member Reply With Quote

I know that feeling well - its great
Robin
Premium Member

Avatar

Registered: 7th Jan 04
Location: Northants Drives: Clio 182 Cup
User status: Offline
19th Jul 06 at 16:02   View Garage View User's Profile U2U Member Reply With Quote

http://i17.photobucket.com/albums/b81/sevenweblog/George_Peppard7.jpg


 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
head work combat_sri Help Zone, Modification and ICE Advice 1 1920
9th Aug 03 at 12:23
by Cybermonkey24
 
flowing water behind head unit? **updated with headgasket questions** BabyBlade Help Zone, Modification and ICE Advice 17 2769
14th Feb 04 at 17:50
by Sethion33
 
Techies look in.............Cav Turbo trouble Teddy General Chat 28 2051
23rd Jun 05 at 13:33
by Ditch
 
new member to the tribe ackers2302 General Chat 35 1987
23rd Feb 06 at 18:06
by mav
 
xe/let head stud kit starkie Parts Offered 2 231
24th May 06 at 06:24
by starkie
 

Corsa Sport » Message Board » Off Day » Geek Day » Doing my head in help! 29 database queries in 0.0157979 seconds