![]() |
Need help finishing...
The score grabbing works, but now I need the the values in the "gscore,sscore,hscore and rscore" fields;)
So far, they return: gscore sscore hscore rscore I am not sure what type of field they should be (I have them set as INT:confused:), and they are a point value, with gscore being 4 and sscore being 1... This code is what needs to be modified to get the value (everything else works:D):) Code:
$score = $DB_site->query_first("SELECT '$whichscore' FROM *tablename*_questions WHERE qid='$theqid'"); Satan |
Please can anyone help?
I really need to get this finished... Satan |
Quote:
PHP Code:
If on the other-hand, $whichscore IS a variable, then I would do the code like this: PHP Code:
p.s. I always break out of quotes when calling variables, just for my own piece of mind. I know you don't have to, but I do unless I'm required to not do it. |
Aha thanks...
Yes $whichscore is a earlier defined variable, via this code: Code:
if ($answer==$ganswer) { Thanks - I'll try this:) Satan |
:(
Unfortunately the code still returns "gscore" , "hscore", "sscore" and "rscore":( Satan |
Quote:
I may be seeing things strangely, but if g, s, h, and rscore are all variables, shouldn't they be prefixed with "$"? Like this? PHP Code:
So assuming that: PHP Code:
|
Hmm...I never thought of that - I shall try, thanks:D:)
Satan |
np...lemme know.
|
Ok...That didnt work...
But then I had an idea - Why query the database for "$whichscore" if the score value is already defined - So I was thinking: Code:
if ($answer == $ganswer){ Edit: It didn't work:( Satan |
Ah...
If the answer is a numerical value, $answer returns the numerical value of that answer (i.e. if the first answer was 93, $answer returns 93) If the answer is a non-numerical value, $answer returns 0:( Satan |
All times are GMT. The time now is 02:49 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|