Thursday 19 January 2006 12:18:27 am
Hi to all
I write the function in my Class but in this function I want to connect Oracle via ezoracle extension and execute query but this query is concatenate with multiple variable like that:
function DisplayDataRegional($CountryId, $StateId, $Industryid, $brandId)
{
$result = array('ls' => Array());
$databaseParameters=array('server'=>'Dbox','user'=>'tatis','password'=>'tatis','database'=>'EPSA.CMS');
$conn =& eZDB::instance( 'ezoracle', $databaseParameters,true);
if (!$conn) {
$result['ls'] = "Cannot Login";
return $result;
}
$x="Canada";
$query ='Select * FROM V_CONTACT_WEB WHERE CNTNAME=(select COUNTRYNAME from COUNTRY Where COUNTRYID='."$CountryId".')
AND
ADD_STATE=(select STATENAME from STATEID Where STATEID='."$StateId".')
AND
IDNWEB_CUSTOMER in( SELECT IDNWEB_CUSTOMER FROM NWEB_INDUSTRY_NWEB_CUSTOMER
WHERE IDNWEB_INDUSTRY='."$Industryid".')
AND
IDNWEB_CUSTOMER in( SELECT IDNWEB_CUSTOMER FROM NWEB_BRAND_NWEB_CUSTOMER
WHERE IDNWEB_BRAND='."$brandId".')';
$stid =$conn->arrayQuery( $query );
if (!$stid) {
$result['ls'] = "Cannot execute";
return $result;
}
$counter=$counter1=0;
foreach ( $stid as $row )
{
$counter1 = 0;
foreach ($row as $item)
{
$result['ls'][$counter][$counter1]=$item;
$counter1++;
}
$counter++;
}
return Array ('result' => $result);
}
Error: eZOracleDB Jan 19 2006 10:16:23
Error (936): ORA-00936: missing expression
If I change the query like the query execute and The data retreived from DB. Thank you
|