473,418 Members | 2,005 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,418 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 1799
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.