Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 28-04-03
frostie
Guest
 
Posts: n/a
  PHP/mySQL and RANDOM


Morning all

A bit stressed here as I am trying to add a random bit of source but with no look. I have scoured the net and still found northing, so just wondered if any of you intellectual type could point me in the right direction;

OK, I have sql database with a table called ss_offers

Basically I want to randomly select one record from the table and show the fields name, details, date

But how on earth do you do the random selection? Have tried the following with no joy;
$query = "SELECT * FROM ss_offers ORDER BY RANDOM() LIMIT 1";

Hope someone can point me in the right direction before I pull my LAST hair out!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-04-03
bertm
Guest
 
Posts: n/a
  Re: PHP/mySQL and RANDOM


try

$query = "SELECT * FROM ss_offers ORDER BY RAND() LIMIT 0,1";

I think....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 28-04-03
frostie
Guest
 
Posts: n/a
  THANKYOU


bertm - thankyou very much, it worked and I still have my hair left! <img src=http://www.gamers-forums.com/smilies/contrib/ruinkai/biggthumpup.gif ALT=":thumb">
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 29-04-03
frostie
Guest
 
Posts: n/a
  Bertm - do you know?


I have a post on another board;
www.phpbuilder.com/board/...d=10237673

Still related to the original request, but it sometimes returns 2 items from 1 section. Any idea how this can be coded aswell?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 01-05-03
bertm
Guest
 
Posts: n/a
  Re: Bertm - do you know?


Frostie - how are you getting on with this? Wasn't too sure what you meant in your last post?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-05-03
frostie
Guest
 
Posts: n/a
  Works a treat!


Yes it works a treat now - thanks anyway for checking.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
B&Q Advent Calendar Competition B&Q DGM Affiliates 6 01-12-04 07:20 PM
Random dynamic content lakrasia Search Engine Strategies 0 13-07-04 07:59 PM
Random Exchange Link Testing Mark Norville The Affiliate Marketing Lounge 1 23-01-04 11:01 AM
Weighted Random Numbers ianm Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 1 25-10-03 09:01 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7