My Watch List stays empty

A place to discuss and receive support for the Web Auction application.

My Watch List stays empty

Postby mausman » Sun May 03, 2009 1:43 pm

Hello all.
Hope someone can help me out.
Im trying to use the webauction and did install and customize a little.
I noticed also the My Watch List is working fine. Untill I logged in a little later and the My Watch List is empty telling that the user has no bids so far. In the mean time no code did change.
So I did build up a fresh install including database on the server again and all worked fine again. Untill after a couples of logins the Watch list is empty again.
Just only did build a new database but that didnt help so it must be something in the code but I cant figure it out.
Any help is appreciated.
mausman
 
Posts: 6
Joined: Sun May 03, 2009 1:37 pm

Postby mausman » Mon May 04, 2009 1:52 am

Just some additional information.
Also when I run the SQL queuery directly on the database I get no rows back. (ofcourse i replaced the variables and getusername)

MySQL returned an empty result set (i.e. zero rows). (Query took 0.0017 sec)

SELECT p.product_id, p.product_name, concat( '€', format( high_bid, 2 ) ) AS high_bid, high_bidder
FROM products p
INNER JOIN (

SELECT product_id, max( bid_amount ) AS high_bid
FROM bids
GROUP BY product_id
) AS hb ON p.product_id = hb.product_id
INNER JOIN (

SELECT product_id, username AS high_bidder
FROM bids b
WHERE NOT
EXISTS (

SELECT *
FROM bids
WHERE product_id = b.product_id
AND bid_amount > b.bid_amount
)
) AS hbr ON p.product_id = hbr.product_id
WHERE 'testuser01'
IN (

SELECT username
FROM bids
WHERE product_id = p.product_id
)
LIMIT 0 , 30
mausman
 
Posts: 6
Joined: Sun May 03, 2009 1:37 pm

Postby mausman » Tue May 05, 2009 12:58 am

Im not a SQL expert but I think I found a solution for my problem.
Just implemented it and we are now testing but it looks very promissing.
If someone still has any usefull hints and tips im glad to hear it.

For those who experience the same problems here is the new SQL statement in watch_list.php;

SELECT p.product_id, p.product_name, concat( '€', format( high_bid, 2 ) ) AS high_bid, high_bidder
FROM products p
INNER JOIN (

SELECT product_id, username, max( bid_amount ) AS high_bid
FROM bids
WHERE username = '".getUsername()."'
GROUP BY product_id
) AS hb ON p.product_id = hb.product_id
INNER JOIN (

SELECT product_id, username AS high_bidder
FROM bids b
WHERE NOT
EXISTS (

SELECT *
FROM bids
WHERE product_id = b.product_id
AND bid_amount > b.bid_amount
)
) AS hbr ON p.product_id = hbr.product_id";
mausman
 
Posts: 6
Joined: Sun May 03, 2009 1:37 pm

Thank you!

Postby hmaloney » Fri Oct 23, 2009 2:06 pm

Thanks very much for your efforts. I was having a similar problem and your new SQL code has solved it.

:D
Heather
hmaloney
 
Posts: 3
Joined: Thu Oct 22, 2009 9:44 pm
Location: Australia


Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 23 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved