0

Hi all,

Wondering if somebody can help me..

Bascially I have two tables bid table and proposal table.

I'm trying to print to screen all the proposals made by a particular user!

The problem is that only those proposals that have bids made on them are printing to screen.

So for example if four proposals are made by a user, I want all four to be printed, however if only two of them have bids then there the only ones getting printed to the screen which is no good.

I'm pretty sure its something to do with the group by statement as when I remove it, it seems to work fine, but I consequently lose the critical "count bids" info.

Anyway here's the code.

SELECT proposal . * , SYSDATE( ) , GROUP_CONCAT( bid.proposalid ) AS 'bids', TIME_FORMAT( TIMEDIFF( tomorrowtime, SYSDATE( ) ) , '%H hours, %i minutes' ) AS timeleft
FROM proposal
LEFT OUTER JOIN bid ON proposal.proposalid = bid.proposalid
WHERE NOW( ) < proposal.tomorrowtime
AND proposal.username = '$username'
GROUP BY bid.proposalid

....

echo "<td>" . count(",",explode($row['bids'])). "</td>";

Anyway if anybody can think of anything please let me know!

Thanks

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Thirusha
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.