hi all,
ive got a problem with the code below that related to split function:
<? <select name="ApplicationCode" id="ApplicationCode">
<? $query = "Select ApplicationCode, ServiceName, MOtablename, MTtablename FROM Application order by ApplicationCode;";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result))
{ $X = $row["ServiceName"];
$Y = $row["ApplicationCode"];
$A = $row["MOtablename"];
$B = $row["MTtablename"];
?>
<option value="<? echo $X; echo $A; echo $B; ?>"> <? echo $X; ?> </option>
<? } ?>
</select>
?>
----------------------------------------------------------------------------------------> 1st
if ($ApplicationCode==$ApplicationCode)
{ $ApplicationCode = $X$A$B;
$App = explode('', $ApplicationCode);
echo $ApplicationCode[]; }
?>
---------------------------------------------------------------------------------------->2nd
<?
$queryMO="SELECT COUNT(*) FROM $A WHERE DAYOFMONTH(DateSend)=DAYOFMONTH('$date') ";
$queryMO.=" AND MONTH(DateSend)=MONTH('$date') AND YEAR(DateSend)=YEAR('$date')";
//$queryMO.=" AND ApplicationCode=1 ";
$resultMO=mysql_result(mysql_query($queryMO),0);
//$rowMObalance=mysql_fetch_array($resultMObalance);
$totalMO=$resultMO;
$grand_totalMO=$grand_totalMO+$totalMO;
echo "<td><div align=\"center\"><span class=\"style10\"><span class=\"style11\"><span class=\"style11\">$totalMO</span></span></span></div></td>";
//get total MT for SMS balance
$queryMT="SELECT COUNT(*) FROM $B WHERE DAYOFMONTH(DateSend)=DAYOFMONTH('$date') ";
$queryMT.=" AND MONTH(DateSend)=MONTH('$date') AND YEAR(DateSend)=YEAR('$date')";
//$queryMT.=" AND ApplicationCode=1 ";
$resultMT=mysql_result(mysql_query($queryMT),0);
//$rowMTbalance=mysql_fetch_array($resultMTbalance);
$totalMT=$resultMT;
$grand_totalMT=$grand_totalMT+$totalMT;
echo "<td><div align=\"center\"><span class=\"style10\"><span class=\"style11\"><span class=\"style11\">$totalMT</span></span></span></div></td>";
?>
---------------------------------------------------------------------------------------------3rd
As u can see, at 1st , i put the value as <? echo $ServiceName; echo $MOtablename; echo $MTtablename;>... at 2nd, i had to split that value so that, it will display only selected ServiceName...and then the MOtablename and MTtablename, should be used at the 3rd..which is in query statement.
i 've no idea what was the problem because i tried to find it but still didnt work as expected...still got the error...so can anybody help me in finding how to solve this problem
the error: Parse error: parse error, unexpected T_VARIABLE in /home/ujie/public_html/PrepaidSMS/monthlyreport.php on line 159
thanks in advance