Re: SELECT syntax

From: Date: Thu, 13 Oct 2011 08:06:08 +0000
Subject: Re: SELECT syntax
References: 1 2 3 4 5  Groups: php.db 
Request: Send a blank email to php-db+get-48043@lists.php.net to get a copy of this message
Heh, Thanks Karthik. Not my post.. :) But your solution looks dead on.. Here you go Ron. Try this one. Best, Karl On Oct 13, 2011, at 2:42 AM, Karthik S wrote:
Try this, select CASE answer
         when 1 then trivia_answer_1
         when 2 then trivia_answer_2
         when 3 then trivia_answer_3
         when 4 then trivia_answer_4
END as trivia_answers from bible_trivia_table On Thu, Oct 13, 2011 at 1:02 PM, Karl DeSaulniers <karl@designdrumm.comwrote: Or something like this? SELECT * FROM Bible_trivia WHERE answer=answer; Then match the results to trivia_answer_1 in php to see if correct. if($trivia_answer_1 == $results) { ... do this } or a switch switch ($results) {
       case $trivia_answer_1:
               ... do this
       case $trivia_answer_2
               ... do this
Best, Karl On Oct 12, 2011, at 11:04 PM, Amit Tandon wrote: SELECT trivia_answer_answer` FROM Bible_trivia` Karl DeSaulniers Design Drumm http://designdrumm.com --PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Karl DeSaulniers Design Drumm http://designdrumm.com

« previous php.db (#48043) next »