Hi
When i call this page I get this failure. What cann be wrong?:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where user=''' at line 1
<?php
include("functions.php");
include("loadcfg.php");
$cfg = load_cfg ("secure/configure.cfg");
//////////////////////////////////////////
// Create transaction entry in DB
//////////////////////////////////////////
$now = time();
//create insert query
$sql= "insert into transactions (user, txn_id, item_name, ammount1,ammount3, tax, period1, period3, payment_type, ";
$sql.="payer_email, payment_status, receiver_email,pending_reason,txn_type,created ) ";
$sql.="Values ('";
$sql.= trim($_POST["x_description"]) . "','";
$sql.= $_POST["x_trans_id"] . "','";
$sql.= $cfg["pp_prodname"] . "','";
$sql.= "1','";
$sql.= 1 . "','";
$sql.= 0 . "','";
$sql.= 0 . "','";
$sql.= 0 . "','";
$sql.= $_POST["x_method"] . "','";
$sql.= $_POST["x_email"] . "','";
$sql.= "New" . "','";
$sql.= $_POST["x_email"] . "','";
$sql.= 0 . "','";
$sql.= $_POST["x_method"] . "','";
$sql.= "$now')";
//insert into DB
db_connect ($cfg["db_server"], $cfg["db_user"], $cfg["db_pass"], $cfg["db_database"]);
$result = db_query ($sql);
//update the user's information
if($t["pay_interval"] == "Monthly") {
$expire = $now + (60 * 60 * 24 * 30); }
else if($t["pay_interval"] == "Yearly") {
$expire = $now + (60 * 60 * 24 * 365); }
$user = trim($_POST["x_description"]);
$sql = "update users set billing='1',expire=$expire where user='$user'";
db_query($sql);
mysql_close();
?>