hi guys,
For an assignment i need to randomly load 2 sets of information (name,phone,address) from a mysql database, so as to appear in boxs on a main page. e.g......
| name | | name2 |
| phone | | phone2 |
| address | | address2 |
the database that i have at the minute is just one table containing the above three variables
any help will be much appreciated as i have no idea where to start!!!
cheers!!!!
php,mysql, help
Moderator: General Moderators
The first step is to connect to the database server...
http://www.php.net/manual/en/function.mysql-connect.php
http://www.php.net/manual/en/function.mysql-connect.php
-
newbie5050
- Forum Newbie
- Posts: 2
- Joined: Wed Jul 18, 2007 8:32 pm
This will work, although not very well...
Code: Select all
select * from tablename order by rand() limit 2;