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

Add User script "Could not execute query"
This should be an easy script but I can't get it to run. Can someone please help me?

<

PHP Code reffering to database, doing something wrong.. pls help
Well i am quite new with PHP
and for school we have to make a PHP script which reffers to a Data

OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables an

Creating a function
Basically i wanna put all this code in a seperate file

Code: <?php

New to PHP and just trying to understand a little code.
I hope I'm not annoying anyone or breaking the rules but I was wondering about this bit of code righ

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

Problem in String replace program's output
Hi all,
I was trying to make a program which accepts a string and replaces it with another stri

Display last record first.
I need some help how put the last record first and first record last.

Thanks

Code: &am

Business Health Check
Hello

I need to create an online business health check for a client it will be multiple choi

if else problem, help please
i have this script that i made only i try to also put in a if else for for some reason the script is

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