473,326 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Website Image

werks
220 100+
Hello i'm creating a website and i want to view the Top Borrowers of Books and Number of Books Borrowed (Sample in TSDN the Top Contributor in PHP).. Does anyone know how to do this? I'm a newbie in this field..thnx..


Better Than Yesterday ^^
Feb 7 '08 #1
4 1354
MarkoKlacar
296 Expert 100+
Hi,

You need a database in order to keep track of what books a user/customer has borrowed. Have you ever worked with MySQL?
Feb 7 '08 #2
werks
220 100+
I'm using MS Access, but i have a little knowledge about MySQL
Feb 7 '08 #3
nathj
938 Expert 512MB
I'm using MS Access, but i have a little knowledge about MySQL
Hi,

MySQL would be better but let's press on anyway.

I assume you have a table of borrowers and some way of linking them to what they have borrowed?

When a member borrows a book you need a field against the member that indicates how many books have been borrowed. This is then incremented everytime the member borrows a book.

To display the top borrowers you run a simple peice of SQL to retreive the name and any file path to an avater they may have loaded and order the results by the borrow count and limit it to the top 10.

so assuming the table is tbl_members with ID, avatar and borrow_count as the fields we care about now:
Expand|Select|Wrap|Line Numbers
  1. select 
  2. a.ID, a.avatar, a.borrow_count
  3. from tbl_members a
  4. order by a.borrow_count desc
  5. limit 0, 10
  6.  
This will get you the top 10 borrowers. You could further restrict the results with a where clause so that only those who've borrowed more than a set number of items qualify as a top borrower to start with.

I hope this helps
nathj
Feb 7 '08 #4
werks
220 100+
tnx for the logic nathj...
Feb 7 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Andy | last post by:
I would like to build a website using a template. I got one from internet but after I open it my new Internet Explorer gives me a warning : 'To help protect your security, Internet Explorer has...
4
by: Acharya J. Ganesh | last post by:
|| Shree Ganesha || Dear Friends; Please check the website chpindia.com and please comment wether it is done alright this time at least. Last time I got lot of feedback for ashapurafoods.com...
0
by: Geert | last post by:
Hi all, I have a webservice that creates an image. I want to show the result of that image on my website. The website and webservice are on different servers. There is a VPN line between both...
2
by: 1388-2/HB | last post by:
I've got a small sockets application where I communicate with a web server via async sockets method. Using the ASCIIEncoding Class, I convert strings to byte arrays (and vice versa) in...
1
by: number1hatfielder | last post by:
Hi there, I am trying to include some javascript in my website which rotates some stored images. I have attached the code for the index page of my website as i am having some problems getting it...
6
by: Stephen Edwards | last post by:
I am a novice, so bear with me. I designed a website using CSS TABS, all was fine, then I copy and pasted meta name, etc for keywords, tweaking it where necessary for keywords. I did not notice...
3
by: Admin.TalkPC | last post by:
Hi people, I have now spent far too much time on this small problem, I am hopefully going to hand it over to you guys that are cleverer than I in this respect. Problem. I need to get all...
2
by: =?Utf-8?B?SGVsdGVyIFNrZWx0ZXI=?= | last post by:
Hello all, I have decided that I want to try and make a website entirely out of images, using several images as the main body. it struck me, however, that suck a website might get reuced in size...
0
sketchgrrl
by: sketchgrrl | last post by:
I'm using IE to build a GoDaddy.com Website Tonight site. I want to add a background image (probably a repeating one to make sure it covers all the empty spaces behind the images on the page...
13
by: sevenz24 | last post by:
So i have my images set up like this : http://cgi.ebay.com/Tippmann-98-paintBall-Marker-Gun-Paint-Ball_W0QQitemZ250274334261QQihZ015QQcategoryZ47248QQssPageNameZWDVWQQrdZ1QQcmdZViewItem Scroll...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.