Re: [PHP-DB] php code on sqlite

2004-10-20 Thread Mike Smith
Add



after your closing 


On Wed, 20 Oct 2004 11:50:29 -0700 (PDT), Aravalli Sai
<[EMAIL PROTECTED]> 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 81
> 
> 
> 
> 
> 
>  
> $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 "successfully inserted!";
> }
> else {
> echo "incomplete from input!";
>   $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 "";
> while ($row = sqlite_fetch_array($result))
> {
> echo "";
> echo "".$row[0]."";
> echo "".$row[1]."";
> echo "".$row[2]."";
> echo "".$row[3]."";
> echo "".$row[4]."";
> echo "".$row[5]."";
> echo "".$row[6]."";
> echo "".$row[7]."";
> echo "".$row[8]."";
> echo "".$row[9]."";
> echo "";
> }
> echo "";
> 
> }
> sqlite_close($handle);
> ?>
> 
> 
> enter  new record:
> 
> Tag number:
> 
> desc:
> 
> acq date:
> 
> manufacturer:
> 
> model:
> 
> serial id:
> 
> custodian location: name="custodian">
> 
> sum cost:
> 
> 
> 
> 
> 
> 
> 
> i would appreciate if you can help me in correcting
> this error..
> thanks in advance..
> sai
> 
> ___
> Do you Yahoo!?
> Declare Yourself - Register online to vote today!
> http://vote.yahoo.com
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

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



[PHP-DB] php code on sqlite

2004-10-20 Thread Aravalli Sai
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 81





successfully inserted!";
}
else {
echo "incomplete from input!";
  $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 "";
while ($row = sqlite_fetch_array($result))
{
echo "";
echo "".$row[0]."";
echo "".$row[1]."";
echo "".$row[2]."";
echo "".$row[3]."";
echo "".$row[4]."";
echo "".$row[5]."";
echo "".$row[6]."";
echo "".$row[7]."";
echo "".$row[8]."";
echo "".$row[9]."";
echo "";
}
echo "";

}
sqlite_close($handle);
?>

  
enter  new record:

Tag number:  

desc:

acq date:

manufacturer:
  
model:
 
serial id:

custodian location:

sum cost:








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



___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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