Parse error: parse error, unexpected T_LNUMBER in D:\oa\test.php on line 19
解决方案 »
- 关于return的用法
- 求一个php下载的方法,求大家帮帮忙~~~
- 求一句升级SQL的语句
- 请问一个session的问题
- php的crypt函数和LINUX的crypt函数一样么?
- com在服务器上无法使用
- 用socket如何编写下列http://211.100.115.37/lxd/liuyue.php?username=try2&password=060621&birth=19530528&length=70的HTTP协议的POST
- phplib安装出错,提示 Cannot redeclare Session::gc() 错误
- 如何让PHP发送html格式的邮件?
- 筛选数据excel导出
- 真的初学者提问,麻烦耐心仔细的回答。。。
- 求救!!有点难度的时间查询
$link = mysql_connect("localhost", "root", "0000") or die("Could not connect: " . mysql_error());
//mysql_select_db('socooloa', $link) or die ('Can\'t use foo : ' . mysql_error());
mysql_select_db("socooloa");$sql="select * from accountbook where accountbookname='流水' order by transactiondate desc;";
//$result = mysql_query($sql) or die("Could not query: . mysql_error());
$result = mysql_query($sql) or die("Could not query: ". mysql_error());?><table border="0" style="border-collapse: collapse" width="100%">
<tr>
<td>查询时间:</td>
</tr>
</table>
<meta http-equiv="Content-Language" content="zh-cn">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td align="center">交易时间</td>
<td align="center">描述</td>
<td align="center">收入</td>
<td align="center">支出</td>
<td align="center">余额</td>
<td align="center">备注</td>
<td align="center">操作</td>
</tr>
<?php
while($line = mysql_fetch_array($result)){
?>
<tr>
<td align="center"><?print(mysql_result($result,"transactiondate"));?> </td>
<td align="center"><?print(mysql_result($result,"transactiondescription"));?> </td>
<td align="center"><?php
$tem2=sprintf("%01.2f",mysql_result($result,"transactionsum"));
if(mysql_result($result,"transactionsum")>=0){
print($tem2);
$temp1=$temp1+$tem2;
}
?> </td>
<td align="center"><?php
if(mysql_result($result,"transactionsum")<0){
print($tem2);
$temp2=$temp2+$tem2;
}
?> </td>
<td align="center"><?php
$tem3=sprintf("%01.2f",mysql_result($result,"balance"));
print($tem3);
?> </td>
<td align="center"><?print(mysql_result($result,"otherinfo"));?> </td>
<td align="center"><?print(mysql_result($result,"operator"));?> </td>
</tr>
<?php
}
?>
</table><?php$temp3=$temp2+$temp1;
print("收入:".sprintf("%01.2f",$temp1)."</br>支出:".sprintf("%01.2f",$temp2)."</br>收支差:".sprintf("%01.2f",$temp3));?>
<?php
mysql_free_result($result);
mysql_close($link);
?>
少一个引号。应该是
$result = mysql_query($sql) or die("Could not query:" . mysql_error());
<?php
$link = mysql_connect("localhost", "root", "0000") or die("Could not connect: " . mysql_error());
//mysql_select_db('socooloa', $link) or die ('Can\'t use foo : ' . mysql_error());
mysql_select_db("socooloa");$sql="select * from accountbook where accountbookname='流水' order by transactiondate desc;";
//$result = mysql_query($sql) or die("Could not query: . mysql_error());
$result = mysql_query($sql) or die("Could not query: ". mysql_error());?><table border="0" style="border-collapse: collapse" width="100%">
<tr>
<td>查询时间:</td>
</tr>
</table>
<meta http-equiv="Content-Language" content="zh-cn">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td align="center">交易时间</td>
<td align="center">描述</td>
<td align="center">收入</td>
<td align="center">支出</td>
<td align="center">余额</td>
<td align="center">备注</td>
<td align="center">操作</td>
</tr>
<?php
while($line = mysql_fetch_array($result)){
?>
<tr>
<td align="center"><?print $line["transactiondate"];?> </td>
<td align="center"><?print $line["transactiondescription"];?> </td>
<td align="center"><?php
$tem2=sprintf("%01.2f",$line["transactionsum"]);
if($line["transactionsum"]>=0){
print($tem2);
$temp1=$temp1+$tem2;
}
?> </td>
<td align="center"><?php
if($line["transactionsum"]<0){
print($tem2);
$temp2=$temp2+$tem2;
}
?> </td>
<td align="center"><?php
$tem3=sprintf("%01.2f",$line["balance"]));
print($tem3); ?> </td>
<td align="center"><?print($line["otherinfo"]);?> </td>
<td align="center"><?print($line["operator"]);?> </td>
</tr>
<?php
}
?>
</table><?php$temp3=$temp2+$temp1;
print("收入:".sprintf("%01.2f",$temp1)."</br>支出:".sprintf("%01.2f",$temp2)."</br>收支差:".sprintf("%01.2f",$temp3));?>