Введение в программирование на PHP5


Example.I.14


if ($_POST[UpdateButton] == "Update")

{

$conn2 = odbc_connect('Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\inetpub\wwwroot\PHPTutorial\Ecommerce\databases\ecommerce.mdb','','');

foreach($_REQUEST as $key => $value)

{

if (strpos($key,"Q") === 0 )

{

$OrderItem = substr($key,1);

$OrderQuantity = $value;

if (is_numeric($OrderQuantity))

{

if ($OrderQuantity == 0)

{

$sqlCartUpdate = "DELETE FROM ShopCart WHERE OrderNo='$_SESSION[OrderNo]' AND OrderItem='$OrderItem'";

}

else

{

$sqlCartUpdate = "UPDATE ShopCart SET OrderQuantity='$OrderQuantity' WHERE OrderNo='$_SESSION[OrderNo]'

AND OrderItem='$OrderItem'";

}

$rsCartUpdate = odbc_exec($conn2,$sqlCartUpdate);

}

}

}

odbc_close($conn2);

}




Начало  Назад  Вперед



Книжный магазин