MySQL Forums
Forum List  »  MySQL Query Browser

Re: Need help building mysql query
Posted by: hassan usmani
Date: August 31, 2012 07:48PM

NEED HELP!!!

if (isset($_POST['go'])) {

$status = $_POST[status];
if ($status == 4){
$status = '' ;
}

if ($topic == 100 && $subtopic == '' && $status == '' ) {
$queryString = "select * from tblquiz where userid='$_SESSION[numericuserid]' LIMIT $start, $limit" ;
$countString = "select * from tblquiz where userid='$_SESSION[numericuserid]'";
} // NOTE : THIS QUERRY IS WORKING PERFECT

elseif ($topic !== '' && $subtopic !== '' && $status !== '' ) {
$queryString = "select * from tblquiz where qstatus=$status AND qtopic='$topic[topicname]' AND subtopic='$_POST[subtopic]' AND userid='$_SESSION[numericuserid]' LIMIT $start, $limit" ;
$countString = "select * from tblquiz where qstatus=$status AND qtopic='$topic[topicname]' AND subtopic='$_POST[subtopic]' AND userid='$_SESSION[numericuserid]'";
} // NOTE : THIS QUERRY IS WORKING PERFECT

elseif ($topic !== '' && $subtopic !== '' && $status == '' ) {
$queryString = "select * from tblquiz where qtopic='$topic[topicname]' AND subtopic='$_POST[subtopic]' AND userid='$_SESSION[numericuserid]' LIMIT $start, $limit" ;
$countString = "select * from tblquiz where qtopic='$topic[topicname]' AND subtopic='$_POST[subtopic]' AND userid='$_SESSION[numericuserid]'";
} // NOTE : THIS QUERRY IS WORKING PERFECT


elseif ($topic == 100 && $subtopic == '' && $status !== '') {
$queryString = "select * from tblquiz where qstatus= $status AND userid='$_SESSION[numericuserid]' LIMIT $start, $limit" ;
$countString = "select * from tblquiz where qstatus= $status AND userid='$_SESSION[numericuserid]' ";
} // NOTE : THIS QUERRY IS NOT WORKING
}

Options: ReplyQuote


Subject
Written By
Posted
Re: Need help building mysql query
August 31, 2012 07:48PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.