Skip to content
Advertisement

Bidding System PHP-MYSQL

I am working on the bidding system app, stuck on how to select the appropriate data and display. See the table screenshot. What I trying to retrieve is for example for bid_id p1 I want latest fbid,name, total amount of all 3 records having bid_id=p1.

$check = "SELECT * FROM bid_info WHERE bid_id = '$bid_id' ORDER BY id DESC LIMIT 1";

Advertisement

Answer

I believe this is the query you are looking for…

$check = "SELECT * FROM bid_info WHERE bid_id = '$bid_id'"
$result = mysql_query($check);

$total= 0;
while ($row = mysql_fetch_assoc($result)) {
$total += $row['bid_id'];
}

Also, you should be using pdo_mysql instead of mysql. mysql has been deprecated eons ago and will soon stop functioning. Then all of your code will stop functioning.

Reference

pdo_mysql

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement