Jump to content

Why does my string return 0?


joesaddigh

Recommended Posts

Hi is there any reason why this string would return 0. I know that based on my search it is going into the various isset checks so should be being populated with my sql string.

 

The code is as follows.

 


// Facilities query
			$facilQuery = " AND ";

			if( $_SERVER['REQUEST_METHOD'] == "POST" ) 
			{
				 // Get the posted data
				 $_SESSION['country'] = $_POST["country"];
				 $_SESSION['region'] = $_POST["region"];
				 $_SESSION['town'] = $_POST["town"];
				 $_SESSION['weeks'] = $_POST["weeks"];
				 $_SESSION['coursetype'] = $_POST["Coursetype"];			

				 // Do all the checks for the facilities so that query can be dynamically generated

				 // Library
				 if ( isset( $_POST["library"] ) )
				 { 
					echo $facilQuery += "library = yes";
				 }

				 // Canteen
				 if ( isset( $_POST["cafecanteen"] ) )
				 { 
					$facilQuery += "OR cafecanteen = yes "; 
				 }

				 // Garden
				 if ( isset( $_POST["garden"] ) )
				 { 
					$facilQuery += "OR garden = yes ";
				 }

				 // Computer lab
				 if ( isset( $_POST["computer_lab"] ) )
				 { 
					$facilQuery += "OR computer_lab = yes ";
				 }

				 // Language Lab
				 if ( isset( $_POST["language_lab"] ) )
				 { 
					$facilQuery += "OR language_lab = yes ";
				 }

				 // Internet access
				 if ( isset( $_POST["internet_access"] ) )
				 { 
					$facilQuery += "OR internet_access = yes ";
				 }

				 // Self study centre
				 if ( isset( $_POST["self_study_center"] ) )
				 { 					 	
					$facilQuery += "OR self_study_center = yes ";
				 }

				 // Student lounge
				 if ( isset( $_POST["student_lounge"] ) )
				 { 
					$facilQuery += "OR student_lounge = yes ";
				 }

				 // Disabled access
				 if ( isset( $_POST["disabled_access"] ) )
				 { 
					$facilQuery += "OR disabled_access = yes ";
				 }

				 // Bookshop
				 if ( isset( $_POST["bookshop"] ) )
				 { 
					$facilQuery += "OR bookshop = yes ";
				 }

				 // Disabled access ac
				 if ( isset( $_POST["disabled_access_ac"] ) )
				 { 
					$facilQuery += "OR disabled_access_ac = yes ";
				 }
			}

			//if ( $facilQuery != " AND " )
			{
				echo $facilQuery;
			}

 

Thanks in advance

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.