Re: parse error in php backend sqlite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Aravalli Sai wrote:
hi this is php code for inventory management system
which is done using SQLite.....this is an user
interface where an user wil giv values to the text
boxes and it should be saved in the backend database
which is sqlite..
but when i run this code on browser it is giving an
error ... Parse error: parse error in
/home/saravall/.HTML/inv.php on line 63


<HTML>
<HEAD>
</HEAD>
<body>
<?php

$db ="/home/saravall/office.db";
$handle = sqlite_open($db) or die("could not open
database");

if(isset($_POST['submit'])) {

if (!empty($_post['tagno']) && !empty
($_post['desc']) &&
!empty ($_post['acqdt']) && !empty
($_post['manufacturer']) && !empty
($_post['model']) && !empty($_post['serialid']) &&
!empty( $_post
['custloc']) && !empty($_post['totcost']))
{
$insquery = "insert into inventory
(tagno,desc,acqdt,manufacturer,model, serial
id,custloc,totcost) values (\"".sqlite_escape_string(
$_post['tagno'])."\",\"".sqlite_escape_string($_post['desc'])."\",\""
.sqlite_escape_string($_post['serialid'])."\",\"".sqlite_escape_string($_post
['custloc'])."\",\"".sqlite_escape_string($_post['totcost'])."\")";
$insresult = sqlite_query($handle,$insquery) or
die("error:".sqlite_error_string(sqlite_last_error($handle)));
echo "<i>successfully inserted!</i><p />";
}
else {
echo "<i>incomplete from input!</i><p />";
$query = "SELECT * FROM inventory ";
$result = sqlite_query($handle,$query) or


die("err:".sqlite_error_string(sqlite_last_error($handle)));
if (sqlite_num_rows($result) > 0)
{
echo "<table cellpadding=20 border=1>";
while ($row = sqlite_fetch_array($result))
{
echo "<tr>";
echo "<td>".$row[0]."</td>";
echo "<td>".$row[1]."</td>";
echo "<td>".$row[2]."</td>";
echo "<td>".$row[3]."</td>";
echo "<td>".$row[4]."</td>";
echo "<td>".$row[5]."</td>";
echo "<td>".$row[6]."</td>";
echo "<td>".$row[7]."</td>";
echo "<td>".$row[8]."</td>";
echo "<td>".$row[9]."</td>";
echo "</tr>";
}
echo "</table>";

}
sqlite_close($handle);
?>
</body>
</html>


i would appreciate if you can help me in correcting this error.. thanks in advance.. sai


Your braces don't match up. The problem starts at the ELSE statement in line 33.

Doug

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux