Click to See Complete Forum and Search --> : Parse Error - NEED HELP!!


pupclassifieds
07-29-2006, 12:42 PM
This is the error my site keeps giving me....

Parse error: syntax error, unexpected T_STRING in /home/pupclass/public_html/delete.php on line 23

And here is the line 23....

$q2 = "delete * from class_catalog where ProductID = '$_GET[id]' and MemberID = '$_SESSION[MemberID]' ";

I am still new to all this website stuff...so I am learning as I go...but this has me stumped and I know it is something REALLY stupid!!

Any help will be appreciated!

russell
07-29-2006, 12:46 PM
echo $q2

what does it show?

wait, you are missing some quotes.

$_SESSION["MemberID"]
$_GET["id"]

also should remove the *

delete from table -- instead of delete * from table

pupclassifieds
07-29-2006, 12:52 PM
Here is the whole file - I tried removing the * and it still does the error.....


<?
require_once("conn.php");
require_once("includes.php");
require_once("access.php");

$q1 = "select * from class_catalog where ProductID = '$_GET[id]' and MemberID = '$_SESSION[MemberID]' ";
$r1 = mysql_query($q1) or die(mysql_error());

if(mysql_num_rows($r1) > '0')
{
$a1 = mysql_fetch_array($r1);

if(!empty($a1[images]))
{
$MyImages = explode("|", $a1[images]);

while(list(,$v) = each($MyImages))
{
unlink("images/$v\");
}
}
{
$q2 = "delete from class_catalog where ProductID = '$_GET[id]' and MemberID = '$_SESSION[MemberID]' ";
$r2 = mysql_query($q2) or die(mysql_error());
}

header("location:AddAsset.php");

exit();

?>

NogDog
07-29-2006, 01:13 PM
Try this:

$q2 = "delete from class_catalog where ProductID = '{$_GET['id']}' and MemberID = '{$_SESSION['MemberID']}' ";

pupclassifieds
07-29-2006, 01:19 PM
No - that didn't change it!

russell
07-29-2006, 06:48 PM
u still didn't tell us... what d u get if u echo $q2 ???

Sid3335
07-30-2006, 09:56 AM
try


unlink("images/$v");


instead of

unlink("images/$v\");

Sid3335
07-30-2006, 09:58 AM
just noticed you have 4 open braces and 3 close braces