Re: Sqlite 3 pdo update query problem

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

 



still not working,


$sesdb = new PDO('sqlite:file.sqlite3');

$query="SELECT ZNAME, ZQUANTITY, ZPRODUCTID FROM ZITEM WHERE ZCategory != 14";

$statement= $sesdb->query($query);
$result=$statement->fetchAll();

foreach ($result as $product) {
$prodname=$product[0];
$prodqty = $product[1];
$prodid=$product[2];

$sql = "UPDATE ZITEM SET ZQUANTITY='0' WHERE ZPRODUCTID={$prodid}";

$sesdb->exec($sql);

}

On 20 Aug 2008, at 09:59, Evert Lammerts wrote:

$sql = "UPDATE ZITEM SET ZQUANTITY='0' WHERE ZPRODUCTID='". $prodid."'";

Try to unquote $prodid:

$sql = "UPDATE ZITEM SET ZQUANTITY='0' WHERE ZPRODUCTID={$prodid}";

Evert

--
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


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

  Powered by Linux