T_String Error where there is no T_String

Im having a problem I dont get

Parse error: syntax error, unexpected T_STRING in /home/bizcards/public_html/sltrinkets.com/SLTbAnK/addprod.php on line 112

line 112 is the begining of the form at the bottom the line

Theres no T_String there???

Does anyone see anything wrong with something that could be causing this?

[php]

<?php error_reporting(E_ALL); include './include/mysql.php'; include './include/constants.php'; mysql_connect("$host", "$user", "$pass") or die(mysql_error()); mysql_select_db("$database") or die(mysql_error()); session_start(); require_once './include/session.php'; $ss = new SecureSession(); $ss->check_browser = true; $ss->check_ip_blocks = 2; $ss->secure_word = $_SERVER['REMOTE_ADDR']; $ss->regenerate_id = true; $KEYZ = $_SESSION['welcome_msg']; if ($ss->Check() || isset($_SESSION['logged_in']) || $_SESSION['logged_in']) { if (isset($_POST['submit'])) { //if (!$_POST['prodname'] | !$_POST['Desc'] | !$_POST['price']) //{ ?>

popup box did not fill in all fileds

<?php //die; //} if (!get_magic_quotes_gpc()) { $_POST['prodname'] = addslashes($_POST['prodname']); } $usercheck = $_POST['prodname']; $check = mysql_query("SELECT NAME FROM Users WHERE NAME = '$usercheck'") or die(mysql_error()); $check2 = mysql_num_rows($check); if ($check2 != 0) { ?>

product already exists

<?php die; } if ($_POST['type'] == "1") { $_POST['slname'] = ""; } if ($_POST['type'] == "2") { $_POST['url'] = ""; } if ($_POST['Perms'] == "Other") { $_POST['Perms'] = addslashes($_POST['other']); } else { $_POST['Perms'] = addslashes($_POST['Perms']); } if (!get_magic_quotes_gpc()) { $_POST['prodname'] = addslashes($_POST['prodname']); $_POST['prodnum'] = addslashes($_POST['prodnum']); $_POST['slname'] = addslashes($_POST['slname']); $_POST['url'] = addslashes($_POST['url']); $_POST['type'] = addslashes($_POST['type']); $_POST['cata'] = addslashes($_POST['cata']); $_POST['Desc'] = addslashes($_POST['Desc']); $_POST['Perms'] = addslashes($_POST['Perms']); $_POST['qty'] = addslashes($_POST['qty']); $_POST['price'] = addslashes($_POST['price']); $_POST['imgurl1'] = addslashes($_POST['imgurl1']); $_POST['imgurl2'] = addslashes($_POST['imgurl2']); $_POST['prims'] = addslashes($_POST['prims']); $_POST['prodnum'] = addslashes($_POST['prodnum']); $USER = $KEYZ; } $PNAME = $_POST['prodname']; $PNUMBER = $_POST['prodnum']; $SLNAME = $_POST['slname']; $URL = $_POST['url']; $type = $_POST['type']; $CATA = $_POST['cata']; $DESC = $_POST['Desc']; $PERMS = $_POST['Perms']; $QTYTS = $_POST['qty']; $PRICE = $_POST['price']; $BIMG = $_POST['imgurl1']; $IMG = $_POST['imgurl2']; $BIMG = $_POST['prims']; $IMG = $_POST['prodnum']; $USER = $KEYZ; $insert = "INSERT INTO PRODS (PNAME, PNUMBER, BIMG, IMG, URL, PRICE, DESC, SLNAME, PERMS, PRIMS, USER, CATA, QTYTS) VALUES ('".$PNAME."','".$PNUMBER."','".$BIMG."','".$IMG."','".$URL."','".$PRICE."','".$DESC."','".$SLNAME."','".$PERMS."','".$PRIMS."','".$USER."','".$CATA."','".$QTYTS."'); $add_member = mysql_query($insert) or die(mysql_error()); ?>

product added message

<?php // die; } else { ?>
Product Name: Product Number: Second Life Object Name: Scripts Cat 2 Cat 3 Cat 4 Cat 5 Cat 6 Cat 7 Cat 8 Cat 9 Cat 10 URL: Object Type: Download SL Delivery Both Catagorey: Scripts Cat 2 Cat 3 Cat 4 Cat 5 Cat 6 Cat 7 Cat 8 Cat 9 Cat 10 Item Description: Permissions: None Copy Copy, Modify Copy, Transfer Copy, Modify, Transfer Modify Modify, Transfer Transfer Other Other: Prims: Quanity: Price: Image 1 URL: Image 2 URL:
<?php } } ?> [/php]

thats because this line is missing the last "

(’".$PNAME."’,’".$PNUMBER."’,’".$BIMG."’,’".$IMG."’,’".$URL."’,’".$PRICE."’,’".$DESC."’,’".$SLNAME."’,’".$PERMS."’,’".$PRIMS."’,’".$USER."’,’".$CATA."’,’".$QTYTS."’);

then the string continues, eating the ?>. and at that line the strin ends.

look for the red in ur post. everything red is inside a string.

That fixed that problem, it is now giving
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 ‘DESC, SLNAME, PERMS, PRIMS, USER, CATA, QTYTS) VALUES(‘3’,‘3’,‘3’,‘3’,‘3’,‘3’,’ at line 1

Heres that updated section
[php]
$insert = “INSERT INTO PRODS (PNAME, PNUMBER, BIMG, IMG, URL, PRICE, DESC, SLNAME, PERMS, PRIMS, USER, CATA, QTYTS)
VALUES(’”.$PNAME."’,’".$PNUMBER."’,’".$BIMG."’,’".$IMG."’,’".$URL."’,’".$PRICE."’,’".$DESC."’,’".$SLNAME."’,’".$PERMS."’
,’".$PRIMS."’,’".$USER."’,’".$CATA."’,’".$QTYTS."’)";
[/php]

Everything looks fine to me.

no idea

please use echo $insert to debug

[php]
INSERT INTO PRODS (PNAME, PNUMBER, BIMG, IMG, URL, PRICE, DESC, SLNAME, PERMS, PRIMS, USER, CATA, QTYTS) VALUES(‘Product Name 1’,‘Product Number 2’,‘URL 12’,‘Product Number 2’,‘URL 4’,‘Price 11’,’ Desc 6’,‘Object Name 3’,‘Copy’,‘Prims 9’,‘Draco Kamachi’,‘1’,‘Qty 10’)

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 'DESC, SLNAME, PERMS, PRIMS, USER, CATA, QTYTS) VALUES(‘Product Name 1’,‘Produc’ at line 1
[/php]

echoing that puts it into SQL I dont know much of that but a guess is
'DESC, SLNAME, PERMS, PRIMS, USER, CATA, QTYTS) VALUES(
supposed to be
'DESC, SLNAME, PERMS, PRIMS, USER, CATA, QTYTS); VALUES(
or something

sry, haant thought of it earlier.

desc is a reserved keyword (ORDER BY field DESC)

use DESC

lol Thanks, I would have never caught that!

Sponsor our Newsletter | Privacy Policy | Terms of Service