Hi,
I have a script that can select a number of random records to display but what im after is a snippet of code on the first selection will choose a random record, but on the second selection will again choose a random record, but will discount the record that has already been picked. Basically so the same record cant be displayed twice.
I hope that makes sense.
What i was thinking may be a solution would be if i could select 10 random records, then choose 3 rows from that 10?!!?!?!?
if you can, a snippet would be fantastic too.
Many thanks
3 1285
Hi Whiteyoh
First of all, why do you need to select 10 random records and then 3 of that. why not just get the 3 the first time?
Second, are you using MySQL, assuming you are, here's the what query would look like: - SELECT * FROM your_table_name_here ORDER BY rand() LIMIT 3
Change the 3 to 10, or whatever integer number you need.
Let me know of any questions,
Dan
right thats cool. I use that bit already. And i am using mysql
Now lets say i have 3 seperate div tags, and each div will display 1 record, how can i say
<div> Display record 1 </div>
<div> Display record 2 </div>
<div> Display record 3 </div>
Thanks again
right thats cool. I use that bit already. And i am using mysql
Now lets say i have 3 seperate div tags, and each div will display 1 record, how can i say
<div> Display record 1 </div>
<div> Display record 2 </div>
<div> Display record 3 </div>
Thanks again
You're asking me how to display MySQL results? http://www.tizag.com/mysqlTutorial/mysqlquery.php
How good is your PHP?
You print those tags by using one of the PHP looping structures and the mysql query result.
If you still can't figure it out, post your PHP code and i'll help you.
-Dan
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Steve |
last post by:
I have a continuous form with several unbound comboboxes in the form header. The
comboboxes are used to provide criteria for the SQL of the form. The code behind
the form looks like:
Public Sub...
|
by: S P Arif Sahari Wibowo |
last post by:
Hi!
Do you know how to put a form's Access-Visual-Basic-code that will force
the form to be inserted, while the user has not type anything in the form,
without changing focus, selection, etc.?
...
|
by: Bob Alston |
last post by:
Some more, rather specific Access performance questions. IN a split
front-end & back-end Access/Jet ONLY LAN situation, and with all query
criteria fields and join fields indexed:
1. Is is...
|
by: dbuchanan |
last post by:
I am designing a table to contain a field to stores a value that must
indicate none, one, or many choices. The form will have a group box
with checkboxes (multi-choice)
You see the records in...
|
by: Cagey |
last post by:
What I'm trying for: If this selection or if click on selection
(highlighted line choice/
which ever selection change) w/in query's combo dropdown list box (on
Switchboard),
then Open in...
|
by: Joseph Berry |
last post by:
I have created a report drawing from one table. What I would like to is, grouping by one field, count the number of records within the group that meet two selection criteria (i.e., Field1="A" and...
|
by: David Wright |
last post by:
Hello Folks
I am using Microsoft Access 2000
I would be grateful if someone could help me with “Dlookup”. I tried various methods of writing Dlookup and various events to trigger it, none of...
|
by: annemariearmour |
last post by:
I am using Crystal reports version 11.2 to create reports. The data source is SQL Server, and I am using views rather than reporting directly from tables.
I apply selection criteria to the incoming...
|
by: thayes5150 |
last post by:
I have an access database that uses a subform to display records, one column of which is charge data (currency). My users need to verify the charges against the paper form they are scanned from, so...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |