Jump to content

[SOLVED] help with checking db.


seany123

Recommended Posts

basically i have a table in my database called points_market...

 

 

inside points market i have different values: market_id, Qty, Cost, Total_cost, Seller_id.

 

 

all i want to do is make a if statement saying:

 

If ($player->id is equal seller_id in any rows){

 

 

thats what im trying to do.

Link to comment
https://forums.phpfreaks.com/topic/163896-solved-help-with-checking-db/
Share on other sites

What type of db are you using?

I think you need to loop through them but i'm only familiar with mysql, maybe something like

$query = $db->execute("select * from `points_market`");
$pm = $query->fetchrow();

while($pm = $query->fetchrow()){

if($player->id == $pm['seller_id']){
   header('Location: points_market.php');
   }

}

 

cause at the moment aren't you just retrieving one row don't you need to go through all of them to match a player id to a seller id.

 

Also fetchrow might have to be fetcharray or something again im not familiar with what db you are using

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.