Need understanding of this bit of code


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

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

// 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

Checking if multidimensional array is empty?
I have a for with multiple test input fields. Specifically the user submits multiple names and ages

shoping cart issues
i´ve wrote this and works when i add an item to, my cart, but when i want to add othrer item just

Impact of movement type 412 E on MAP
Hi

Usage of movement type 412 E is causing huge change in MAP .

Is there any r

php sessions,logouts & the bloomin back button!
Hi All,

I've got a cms that members can log into. When they logout, the session is destroyed,

javascript in php code causes page to display white
Hi All,

Odd one this, I've got the following code (below) which is a simple log in form. The

Error: SQL Syntax; Line 1
Code:

<?php require "global_settings.php"; ?>
<title&g

imap: how to save a copy of sent emails to sent elements
Hello my friends,

I am writing an online emailing application with inbox outbox/sent elements

Not reloading page after php form submit
Hello helpful souls out there. You guys have come through for me in the recent past and I'm hoping s

how to put the 0-100 numbers into 1.txt and 100-200 into 2.txt ?
how to put the 0-100 numbers into 1.txt and 100-200 into 2.txt and so on 200-300 into file 3.txt ?

Coding Critique
I was hoping someone could take a second and look down my code and see if they see any problems with

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