Preliminary: I assume this is your table:
CREATE TABLE questions
(
question_number INTEGER NOT NULL PRIMARY KEY,
question VARCHAR(255) NOT NULL,
answer_a VARCHAR(255) NOT NULL,
answer_b VARCHAR(255) NOT NULL,
answer_c VARCHAR(255) NOT NULL,
answer_d VARCHAR(255) NOT NULL,
right_answer ENUM ('a', 'b', 'c', 'd') NOT NULL
) ;
You can let MySQL do the hard work for you, and just execute the following SELECT statement, that will sort randomly all your table (i.e.: it is actually shuffling the rows), and just choose the top 5 rows (NOTE: I've used 5 instead of 15 for the sake of simplicity).
The key point: instead of generating a random number from PHP, let the database deal with the random numbers...
SELECT
question_number, question, answer_a, answer_b, answer_c, answer_d, right_answer
FROM
questions
ORDER BY
rand()
LIMIT
5 ;
(Converting this to PHP code is quite straightforward)
You will get something like:
question_number | question | answer_a | answer_b | answer_c | answer_d | right_answer
--------------: | :--------------------------------------------------- | :----------- | :----------- | :----------------- | :---------------------- | :-----------
2 | Which is the colour of the White HOuse? | Black | Green | Blue | White | d
3 | What's the tallest building on Earth as of 2017? | Empire State | Burj Khalifa | Eiffel Tower | Tokyo Skytree | b
8 | Does 1 kg of lead weight more than 1 kg of feathers? | Yes | No | Depends on gravity | Depends on kind of bird | b
6 | Which is the third letter of the alphabet? | a | b | c | d | c
7 | Which is the first vowel? | a | e | i | o | a
Repeating the same query will give you a different set of questions (although some might have already be asked):
question_number | question | answer_a | answer_b | answer_c | answer_d | right_answer
--------------: | :--------------------------------------------------- | :------- | :------- | :----------------- | :---------------------- | :-----------
9 | How many primary colours are there (for a human)? | 3 | 2 | 6 | 4 | a
5 | How many wheels does a (most common) car have? | 4 | 6 | 8 | 10 | b
8 | Does 1 kg of lead weight more than 1 kg of feathers? | Yes | No | Depends on gravity | Depends on kind of bird | b
2 | Which is the colour of the White HOuse? | Black | Green | Blue | White | d
6 | Which is the third letter of the alphabet? | a | b | c | d | c
When you work with a database, it is normally a good idea to let the database give you the complete answer to your problem, instead of looping in your code.
You can see all the setup and some more executions at dbfiddle here
References: