Need understanding of this bit of code


Posted on 16th Feb 2014 07:03 pm by admin

Code: <?php
// WHERE clause filters
$arrSQLFilters = array();

Did you know?Explore Trending and Topic pages for more stories like this.
// whether or not zip codes table needs to be included
$boolIncludeZipCodes = false;

// Zipcode filter
if(!empty($strZipCode)) {
$boolIncludeZipCodes = true;

$arrSQLFilters[] = sprintf(
"z.zip LIKE '%s'"
,"%$strZipCode%"
);
}

// State filter
if(!empty($strState)) {
$boolIncludeZipCodes = true;

$arrSQLFilters[] = sprintf(
"z.state = '%s'"
,$strState
);
}

// Restaurants name filter
if(!empty($strName)) {
$arrSQLFilters[] = sprintf(
"r.restaurantname LIKE '%s'"
,"%$strName%"
);
}?>
No comments posted yet

Your Answer:

Login to answer
267 Like 51 Dislike
Previous forums Next forums
Other forums

check if value exists
I have googled this for a while and I am getting lots of different results. Is there a standard meth

need good snippet manager
Hi. as i am coding and learning more, it is becoming difficult to manage code snippets. how you mana

Syntax Help
Code:


im having trouble with that code snipped
Parse error: syntax error, unexpec

php or sql?
Sorry not sure if this is a sql problem or php the following code is supposed to delete data from th

moving mouse to display image coordinates
I have an existing MFC application that shows an image in the main window.
I'd like to be able to

Count on multidimensional array
Hi, i got an array as below:

Array
(
=> Array
(

Need help making a blockquote and line items conditional
I have some code I bought a few years ago that allows my clients to update content on their site usi

email CODING Problem
Email coding problem.

I need to send a section of the info to $tf and the same as a Cc to $em

Changes to hosting company's server has affected web contact form
I started a thread a couple of months ago about the contact forms on my client's website. Basically

Error in write byte array into document in SM58
Hi Gurus,

Getting the following error status in Transactional RFC (SM58) ..... *Error i

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash