|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
For example if i am doing a quiz then when the user choose an ans i want to compare it with the right ans stored in my database.
Could anyone help me with the coding? I need it urgently. |
|
#2
|
||||
|
||||
|
generic SQL query:
assumptions: you';ve properly connected to your database, selected the correct database, and taken in the user input (the user's answer) Code:
SELECT ans FROM table_name WHERE id = x table_name = name of your answers table ans = column name where the answers are stored x = question number or ID of the row that holds the question answer then you take the queried answer, see if its the same as the user input and interpret the boolean result (true if they are correct, false if they are not). |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > SQL comparision ***Urgent, time limited |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|