I am new at PHP/SQL so bear with me if I say something that’s obvious or downright wrong.
I have a SQL table (in a database) and I need to take 3 random values (name, race, year), each from a different field in the table, and print it on a website with php. The value requirement “race” will be different depending on radiobuttons (lets say RB1, and RB2) and this all has to happen when
<input type="submit" name="button"> is clicked.
<html> <input type="radio" name="RB1"> Asian </html>
What could I do in this situation?
Example: So if RB1 is selected and the button is clicked I will need to randomly print a “name” with the corresponding “year” (of the name) and it should have a corresponding race of RB1 (which is Asian)
I think this code will help you to understand this-
DB thing, you have to take care for that..im giving you an idea to handle this sort of stuff.
Create one test.php file(this what i did)
Place this code —
In getdata.php file paste this content –
Run the code in browser now (test.php).