473,320 Members | 1,746 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,320 software developers and data experts.

Display result from db onto webpage

Sl1ver
196 100+
How to display the result set in a webpage:

1. retrieve data from the database
2. i take it, i create a loop that creates tables with data in it for every record

my question is, how on a java developed website will i get the top 10 results and create a link for every 10 results after that ( so there is only 10 visible results on every page)
May 31 '10 #1
5 1794
jkmyoung
2,057 Expert 2GB
What type of database is it? MSSQL, MYSQL?

I would structure your query (or sql connection variable) to only get the first 10 results.
May 31 '10 #2
Sl1ver
196 100+
mssql, ok, but how would the user know if there are more than 10 results or not?
Jun 1 '10 #3
jkmyoung
2,057 Expert 2GB
Run a seperate query:
select count(1) from table where condition.
Divide that by 10 (roundup) to get your total number of pages.
Jun 1 '10 #4
Sl1ver
196 100+
OK thats understable but how would i actually make it so that a user can move to the next 10 or previous 10 results?
Jun 1 '10 #5
jkmyoung
2,057 Expert 2GB
Use the OFFSET keyword, keeping LIMIT to 10.
Jun 1 '10 #6

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

Similar topics

0
by: zheetee | last post by:
i am a XML beginner.... how to search a particular word from xml then lists out all the result by using asp,php...+++...... Any search engine....?or script?or... thank you....
1
by: Greg Brady | last post by:
How to display result set in random order? Thanks.
1
by: paavani krama via .NET 247 | last post by:
(Type your message here) I am using two forms.From the first form i need to getinformatiom.After performing necessary calculations,the resultshould be displayed in the 2nd form.i am storing the...
3
by: Manfred | last post by:
Hi all How can I display the result of a sqlcommand select in a datagridview. I guess need a dataset as result to connet it as datasource to the datagrid? Thanks in advance
6
by: johntarr | last post by:
I hope I am not asking about something that has been done before, but I have searched and cannot find an answer. What I am trying to do is to run a query, and then perform some logic on the...
6
by: gunanallasamy | last post by:
hi Folks, i came across a situation for which still i couldn't get a solution. i have table like below(some other columns are also there) option value -------...
2
by: RajanAish | last post by:
Hi All, I am a new user for this forum and I need one help from you. Totally I have four text boxes in my html page. I need to calculate the total for the first three text boxes and I want...
2
by: Se0ng | last post by:
How to immediate show the data result from database when successful insert date into database, I mean no need to exit and re-enter the form, can any 1 give some idea or any guide? I try using...
2
by: manishamca | last post by:
can anyone say me how to find the difference of values present in two textbox and display the result in the third textbox. for eg: <input type=text name=t1 value=123> <input...
11
by: asmx126453 | last post by:
Hey Guys i need help with this last thing i cant get to work The error i get with it is: NullReferenceException was unhandled by user code Object reference not set to an instance of an...
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...
0
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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

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.