Jump to content

Gathering data from two tables


OutOfInk

Recommended Posts

I have two tables that relate to each other;

 

tableA has a Columns ID, NAME, BETRESULT

 

tableB has all the users register data;

 

Each user places a bet on a sport for the week and they either win or lose there credits.  What i wish to do is take away 20 credits from users that dont place a bet for the week.

 

So anyone that does bet i INSERT a new row into tableA. I need to some how work out what usernames havent bet in tableA and remove 20 credits from tableB; I wrote this query but it ended up taking 20 credits off every user.

 

SELECT bets.name, Register.SNAME FROM bets INNER JOIN Register ON bets.name = Register.SNAME

 

 

If someone could help thanks in advance!

 

Link to comment
https://forums.phpfreaks.com/topic/288000-gathering-data-from-two-tables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.