Reply to Diferent numbers

Your name:

Reply:


Posted by CyberDog on 06/24/05 13:09

I am making an quiz script, and I cam accross a problem:

example:
I have a database that holds 10 questions.
User is given only 5 random questions.
How do I make sure that the same question is not displayed twice?

I use $question = rand(1, $number) where $number is mysql_num_rows of
the question database.

so I have a

while($position < $displayed_questions)
{

$question = rand(1, $number);

// database query stuff
// template loading stuff

$display .= $question

$position++;
}

But no way to make sure that the same question isn't taken twice...

Any ideas? :(

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация