/    Sign up×
Community /Pin to ProfileBookmark

I am getting the following error:

b>Parse error</b>: parse error, expecting `T_OLD_FUNCTION’ or `T_FUNCTION’ or `T_VAR’ or `‘}” in <b>/home/prgjr1/public_html/ra-new/stores/locator/class_webservice2.php</b> on line <b>205</b>

the class_webservice2.php file looks like this (line 205 is bolded, it is the very last line):

<?
require_once(‘dbconn.php’);
include “config.php”;
class mystorelookup
{
//this class is for generating a mapquest webservice for the website dynamically.

//$zip (zip code to look up store)

//$stores (array of stores we get back from mapquest)

//there are 2 functions you must call in this order:

//1. function fill_store_specs() is a function to get all the store information

//2. function show_stores() shows the resutls

var $zip; //zip code

var $stores; //array of stores

// passed in zip as string, stores as array, status as string

function find_stores_by_zip($zip) {

# reset our variables that we’re using below….

$BAD_ADDRESS=0;
$AMBIGUITIES=0;
$NOFOUND=0;
$amb=array();
//$stores=array();
$miles = “100”;
$maxshow = “10”;

$locator_fixed = “closestprox=1&closestn=100&screen=find&link=results&country=US”;

$myQuery=”$MQIC_path?$locator_fixed&zip=$zip&miles=$miles&maxshow=$maxshow”;

$fd= @fopen ( $myQuery, “r”);

if (!$fd) {
$status=”Error: Couldn’t complete MAP request. Please try again later.”;
return;
} else {
$tmp_result=fread($fd,50000);
fclose($fd);
//print “tmp_result =>$tmp_result<= <br>n”;
//exit;
eval( “?> $tmp_result” );
}
// if we got down here, we got something back from mapquest–now
// figure out what it was

if ($BAD_ADDRESS || $AMBIGUITIES || $NOFOUND || !@count($store_numbers) ) {
//$status=”Error: No Rite Aid stores found for your query. Please
//try again.”;
//return;
$this->$store[0] = “No results were found, try again later”;
}
else
{
$this->$stores = fill_store_specs($store_numbers);
}

} //End function find_stores_by_zip

function fill_store_specs($store_numbers) {
// global $stores;
$temp_stores=array();
// $stores=array();
if (@count($store_numbers) ) {
$sql_stores=””;

# build a string for our sql query “IN” clause

for(reset($store_numbers);$key=key($store_numbers);next($store_numbers)) {
$sql_stores.=”$key,”;
}

# if we’ve data, remove the last comma

if (strlen($sql_stores)) {
$sql_stores=substr($sql_stores,0,-1);
}

# do database lookup

$D=new mydb;
$sql=”select
LOLCN_LOCN,
LOLCN_NAME,
LOLCN_ADDRESS,
LOLCN_CITY,
LOLCN_STATE,
LOLCN_ZIP,
LOLCN_ZIP4,
LOLCN_RX_AREA_CODE,
LOLCN_RX_EXCHANGE,
LOLCN_RX_EXTENSION,
LOLCN_FX_AREA_CODE,
LOLCN_FX_EXCHANGE,
LOLCN_FX_EXTENSION,
LOLCN_FE_AREA_CODE,
LOLCN_FE_EXCHANGE,
LOLCN_FE_EXTENSION,
LOLCN_FOOD_ATTR,
LOLCN_EXPRESS_ATTR,
LOLCN_PHOTO_ATTR,
LOLCN_TWENTYFOUR_ATTR,
LOLCN_DRIVETHRU_ATTR,
LOLCN_RITEREWARDS_ATTR,
LOLCN_GNC_ATTR,
LOLCN_WESTUNION_ATTR,
LOLCN_FE_HRS_MON,
LOLCN_FE_HRS_TUE,
LOLCN_FE_HRS_WED,
LOLCN_FE_HRS_THU,
LOLCN_FE_HRS_FRI,
LOLCN_FE_HRS_SAT,
LOLCN_FE_HRS_SUN,
LOLCN_RX_HRS_MON,
LOLCN_RX_HRS_TUE,
LOLCN_RX_HRS_WED,
LOLCN_RX_HRS_THU,
LOLCN_RX_HRS_FRI,
LOLCN_RX_HRS_SAT,
LOLCN_RX_HRS_SUN,
to_char(LOLCN_PROJ_OPEN_DTE, ‘yyyy-mm-dd’) MY_LOLCN_PROJ_OPEN_DTE,
to_char(LOLCN_RELOCN_DTE, ‘yyyy-mm-dd’) MY_LOLCN_RELOCN_DTE,
to_char(LOLCN_REOPEN_DTE, ‘yyyy-mm-dd’) MY_LOLCN_REOPEN_DTE,
PICTURE_MAKER,
PHOTO_RAMP,
STORE_STATUS,
LOLCN_DETAIL_DESC,
LOLCN_DIVISION
from sysadm.LOLCN_LOCATION
where LOLCN_LOCN in ($sql_stores)”;

$D->my_sel($sql);
if ($D->ORA_ERR ) {
// need to handle errors
handle_ora_error($D,__FILE__,__LINE__);
}
for ($i=0; $i< $D->numrows; $i++) {
$key=sprintf (“%05d”, $D->results[LOLCN_LOCN][$i]);
//STORE #
$fp1=$D->results[LOLCN_FE_AREA_CODE][$i];
$fp2=$D->results[LOLCN_FE_EXCHANGE][$i];
$fp3=$D->results[LOLCN_FE_EXTENSION][$i];
//PHARMACY #
$rp1=$D->results[LOLCN_RX_AREA_CODE][$i];
$rp2=$D->results[LOLCN_RX_EXCHANGE][$i];
$rp3=$D->results[LOLCN_RX_EXTENSION][$i];
//PHARMACY FAX #
$rpf1=$D->results[LOLCN_FX_AREA_CODE][$i];
$rpf2=$D->results[LOLCN_FX_EXCHANGE][$i];
$rpf3=$D->results[LOLCN_FX_EXTENSION][$i];

$fep= $fp1 > 0 ? “($fp1) $fp2-$fp3” : “”;
$rxp= $rp1 > 0 ? “($rp1) $rp2-$rp3” : “”;
$rxpf= $rpf1 > 0 ? “($rpf1) $rpf2-$rpf3” : “”;
$temp_stores[$key] = array(
name=>$D->results[LOLCN_NAME][$i]
,addr1=>$D->results[LOLCN_ADDRESS][$i]
,city=>$D->results[LOLCN_CITY][$i]
,state=>$D->results[LOLCN_STATE][$i]
,zip=>$D->results[LOLCN_ZIP][$i]
,phone_fe=>$fep
,phone_ph=>$rxp
,phone_phf=>$rxpf
,distance=>$store_numbers[$key][distance]
,convenience_foods=>$D->results[LOLCN_FOOD_ATTR][$i]
,rite_express=>$D->results[LOLCN_EXPRESS_ATTR][$i]
,one_hour_photo=>$D->results[LOLCN_PHOTO_ATTR][$i]
,ra_24_hour=>$D->results[LOLCN_TWENTYFOUR_ATTR][$i]
,drive_thru_rx=>$D->results[LOLCN_DRIVETHRU_ATTR][$i]
,rite_rewards=>$D->results[LOLCN_RITEREWARDS_ATTR][$i]
,gnc=>$D->results[LOLCN_GNC_ATTR][$i]
,western_union=>$D->results[LOLCN_WESTUNION_ATTR][$i]
,hours_fe_mon=>$D->results[LOLCN_FE_HRS_MON][$i]
,hours_fe_tue=>$D->results[LOLCN_FE_HRS_TUE][$i]
,hours_fe_wed=>$D->results[LOLCN_FE_HRS_WED][$i]
,hours_fe_thu=>$D->results[LOLCN_FE_HRS_THU][$i]
,hours_fe_fri=>$D->results[LOLCN_FE_HRS_FRI][$i]
,hours_fe_sat=>$D->results[LOLCN_FE_HRS_SAT][$i]
,hours_fe_sun=>$D->results[LOLCN_FE_HRS_SUN][$i]
,hours_rx_mon=>$D->results[LOLCN_RX_HRS_MON][$i]
,hours_rx_tue=>$D->results[LOLCN_RX_HRS_TUE][$i]
,hours_rx_wed=>$D->results[LOLCN_RX_HRS_WED][$i]
,hours_rx_thu=>$D->results[LOLCN_RX_HRS_THU][$i]
,hours_rx_fri=>$D->results[LOLCN_RX_HRS_FRI][$i]
,hours_rx_sat=>$D->results[LOLCN_RX_HRS_SAT][$i]
,hours_rx_sun=>$D->results[LOLCN_RX_HRS_SUN][$i]
,store_date_open=>$D->results[MY_LOLCN_PROJ_OPEN_DTE][$i]
,store_date_relo=>$D->results[MY_LOLCN_RELOCN_DTE][$i]
,store_date_reopen=>$D->results[MY_LOLCN_REOPEN_DTE][$i]
,picture_maker=>$D->results[PICTURE_MAKER][$i]
,photo_ramp=>$D->results[PHOTO_RAMP][$i]
,store_status=>$D->results[STORE_STATUS][$i]
,detail_desc=>ereg_replace (‘ +’, ‘ ‘, ucwords(strtolower( $D->results[LOLCN_DETAIL_DESC][$i])))
,division=>$D->results[LOLCN_DIVISION][$i]);
}
# now create a third hash that is in the same order as the one we
# came in with
if ($D->numrows) {
for(reset($store_numbers);$key=key($store_numbers);next($store_numbers)) {
$this->$stores[$key]=$temp_stores[$key];
}
}
}# end fill_store_specs
//return $stores;

} //end class mysurvey
[b]?>[/b]

Can someone help here?

Thanks

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@ConorNov 20.2003 — all i can tthink of is maybe you missed a bracket or semicolon somewhere and that caused the error to go screwy. Its happened to me before. The line where it said the error was was about 20 lines from where i missed a bracket
Copy linkTweet thisAlerts:
@jrthor2authorNov 20.2003 — any other ideas, I have triple checked the syntax, not missing anything.
Copy linkTweet thisAlerts:
@Sexay_HamsterNov 20.2003 — use:

include("");

not:

include "";
Copy linkTweet thisAlerts:
@jrthor2authorNov 21.2003 — I tried that, and still get the error. Here's my updated code:

<?

require_once('dbconn.php');

include ("config.php");

class mystorelookup

{

//this class is for generating a mapquest webservice for the website dynamically.

//$zip (zip code to look up store)

//$stores (array of stores we get back from mapquest)

//there are 2 functions you must call in this order:

//1. function fill_store_specs() is a function to get all the store information

//2. function show_stores() shows the resutls

var $zip; //zip code

var $stores; //array of stores


// passed in zip as string, stores as array, status as string

function find_stores_by_zip($zip) {

# reset our variables that we're using below....


$BAD_ADDRESS=0;

$AMBIGUITIES=0;

$NOFOUND=0;

$amb=array();

//$stores=array();

$miles = "100";

$maxshow = "10";

$locator_fixed = "closestprox=1&closestn=100&screen=find&link=results&country=US";

$myQuery="$MQIC_path?$locator_fixed&zip=$zip&miles=$miles&maxshow=$maxshow";

$fd= @fopen ( $myQuery, "r");

if (!$fd) {
$status="Error: Couldn't complete MAP request. Please try again later.";
return;
} else {
$tmp_result=fread($fd,50000);
fclose($fd);
//print "tmp_result =>$tmp_result<= <br>n";
//exit;
eval( "?> $tmp_result" );
}
// if we got down here, we got something back from mapquest--now
// figure out what it was

if ($BAD_ADDRESS || $AMBIGUITIES || $NOFOUND || !@count($store_numbers) ) {
//$status="Error: No Rite Aid stores found for your query. Please
//try again.";
//return;
$this->$store[0] = "No results were found, try again later";
} else {
$this->$stores = fill_store_specs($store_numbers);
}

} //End function find_stores_by_zip

function fill_store_specs($store_numbers) {

// global $stores;

$temp_stores=array();

// $stores=array();

if (@count($store_numbers) ) {

$sql_stores="";

# build a string for our sql query "IN" clause


for(reset($store_numbers);$key=key($store_numbers);next($store_numbers)) {

$sql_stores.="$key,";

}

# if we've data, remove the last comma


if (strlen($sql_stores)) {

$sql_stores=substr($sql_stores,0,-1);

}

# do database lookup


$D=new mydb;

$sql="select

LOLCN_LOCN,

LOLCN_NAME,

LOLCN_ADDRESS,

LOLCN_CITY,

LOLCN_STATE,

LOLCN_ZIP,

LOLCN_ZIP4,

LOLCN_RX_AREA_CODE,

LOLCN_RX_EXCHANGE,

LOLCN_RX_EXTENSION,

LOLCN_FX_AREA_CODE,

LOLCN_FX_EXCHANGE,

LOLCN_FX_EXTENSION,

LOLCN_FE_AREA_CODE,

LOLCN_FE_EXCHANGE,

LOLCN_FE_EXTENSION,

LOLCN_FOOD_ATTR,

LOLCN_EXPRESS_ATTR,

LOLCN_PHOTO_ATTR,

LOLCN_TWENTYFOUR_ATTR,

LOLCN_DRIVETHRU_ATTR,

LOLCN_RITEREWARDS_ATTR,

LOLCN_GNC_ATTR,

LOLCN_WESTUNION_ATTR,

LOLCN_FE_HRS_MON,

LOLCN_FE_HRS_TUE,

LOLCN_FE_HRS_WED,

LOLCN_FE_HRS_THU,

LOLCN_FE_HRS_FRI,

LOLCN_FE_HRS_SAT,

LOLCN_FE_HRS_SUN,

LOLCN_RX_HRS_MON,

LOLCN_RX_HRS_TUE,

LOLCN_RX_HRS_WED,

LOLCN_RX_HRS_THU,

LOLCN_RX_HRS_FRI,

LOLCN_RX_HRS_SAT,

LOLCN_RX_HRS_SUN,

to_char(LOLCN_PROJ_OPEN_DTE, 'yyyy-mm-dd') MY_LOLCN_PROJ_OPEN_DTE,

to_char(LOLCN_RELOCN_DTE, 'yyyy-mm-dd') MY_LOLCN_RELOCN_DTE,

to_char(LOLCN_REOPEN_DTE, 'yyyy-mm-dd') MY_LOLCN_REOPEN_DTE,

PICTURE_MAKER,

PHOTO_RAMP,

STORE_STATUS,

LOLCN_DETAIL_DESC,

LOLCN_DIVISION

from sysadm.LOLCN_LOCATION

where LOLCN_LOCN in ($sql_stores)";

$D->my_sel($sql);
if ($D->ORA_ERR ) {
// need to handle errors
handle_ora_error($D,__FILE__,__LINE__);
}
for ($i=0; $i< $D->numrows; $i++) {
$key=sprintf ("%05d", $D->results[LOLCN_LOCN][$i]);
//STORE #
$fp1=$D->results[LOLCN_FE_AREA_CODE][$i];
$fp2=$D->results[LOLCN_FE_EXCHANGE][$i];
$fp3=$D->results[LOLCN_FE_EXTENSION][$i];
//PHARMACY #
$rp1=$D->results[LOLCN_RX_AREA_CODE][$i];
$rp2=$D->results[LOLCN_RX_EXCHANGE][$i];
$rp3=$D->results[LOLCN_RX_EXTENSION][$i];
//PHARMACY FAX #
$rpf1=$D->results[LOLCN_FX_AREA_CODE][$i];
$rpf2=$D->results[LOLCN_FX_EXCHANGE][$i];
$rpf3=$D->results[LOLCN_FX_EXTENSION][$i];

$fep= $fp1 > 0 ? "($fp1) $fp2-$fp3" : "";
$rxp= $rp1 > 0 ? "($rp1) $rp2-$rp3" : "";
$rxpf= $rpf1 > 0 ? "($rpf1) $rpf2-$rpf3" : "";
$temp_stores[$key] = array(
name=>$D->results[LOLCN_NAME][$i]
,addr1=>$D->results[LOLCN_ADDRESS][$i]
,city=>$D->results[LOLCN_CITY][$i]
,state=>$D->results[LOLCN_STATE][$i]
,zip=>$D->results[LOLCN_ZIP][$i]
,phone_fe=>$fep
,phone_ph=>$rxp
,phone_phf=>$rxpf
,distance=>$store_numbers[$key][distance]
,convenience_foods=>$D->results[LOLCN_FOOD_ATTR][$i]
,rite_express=>$D->results[LOLCN_EXPRESS_ATTR][$i]
,one_hour_photo=>$D->results[LOLCN_PHOTO_ATTR][$i]
,ra_24_hour=>$D->results[LOLCN_TWENTYFOUR_ATTR][$i]
,drive_thru_rx=>$D->results[LOLCN_DRIVETHRU_ATTR][$i]
,rite_rewards=>$D->results[LOLCN_RITEREWARDS_ATTR][$i]
,gnc=>$D->results[LOLCN_GNC_ATTR][$i]
,western_union=>$D->results[LOLCN_WESTUNION_ATTR][$i]
,hours_fe_mon=>$D->results[LOLCN_FE_HRS_MON][$i]
,hours_fe_tue=>$D->results[LOLCN_FE_HRS_TUE][$i]
,hours_fe_wed=>$D->results[LOLCN_FE_HRS_WED][$i]
,hours_fe_thu=>$D->results[LOLCN_FE_HRS_THU][$i]
,hours_fe_fri=>$D->results[LOLCN_FE_HRS_FRI][$i]
,hours_fe_sat=>$D->results[LOLCN_FE_HRS_SAT][$i]
,hours_fe_sun=>$D->results[LOLCN_FE_HRS_SUN][$i]
,hours_rx_mon=>$D->results[LOLCN_RX_HRS_MON][$i]
,hours_rx_tue=>$D->results[LOLCN_RX_HRS_TUE][$i]
,hours_rx_wed=>$D->results[LOLCN_RX_HRS_WED][$i]
,hours_rx_thu=>$D->results[LOLCN_RX_HRS_THU][$i]
,hours_rx_fri=>$D->results[LOLCN_RX_HRS_FRI][$i]
,hours_rx_sat=>$D->results[LOLCN_RX_HRS_SAT][$i]
,hours_rx_sun=>$D->results[LOLCN_RX_HRS_SUN][$i]
,store_date_open=>$D->results[MY_LOLCN_PROJ_OPEN_DTE][$i]
,store_date_relo=>$D->results[MY_LOLCN_RELOCN_DTE][$i]
,store_date_reopen=>$D->results[MY_LOLCN_REOPEN_DTE][$i]
,picture_maker=>$D->results[PICTURE_MAKER][$i]
,photo_ramp=>$D->results[PHOTO_RAMP][$i]
,store_status=>$D->results[STORE_STATUS][$i]
,detail_desc=>ereg_replace (' +', ' ', ucwords(strtolower( $D->results[LOLCN_DETAIL_DESC][$i])))
,division=>$D->results[LOLCN_DIVISION][$i]);
}
# now create a third hash that is in the same order as the one we
# came in with
if ($D->numrows) {
for(reset($store_numbers);$key=key($store_numbers);next($store_numbers)) {
$this->$stores[$key]=$temp_stores[$key];
}
}

} // end fill_store_specs

} //end class mystorelookup

?>
Copy linkTweet thisAlerts:
@DaiWelshNov 21.2003 — I suggest you quadruple check your syntax

Number of { = 14

Number of } = 13

:eek: I cant see your indentation so I dont know exactly which one you lost but there needs to be another close at or near the end of the file.
Copy linkTweet thisAlerts:
@jrthor2authorNov 21.2003 — I got it fixed, there was a missing } at the end. Thanks, sometimes it helps to have a 2nd set of eyes.
×

Success!

Help @jrthor2 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...