H-D Just: You have an error in your SQL syntax

Beitrag lesen

ich bekomme immer diese Fehlermeldung:
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 ','http://gojust.de', 'GoJust', 'Hans-Dieter Just','info@gojust.de', '', '2', '',' at line 3

hier der code wo der fehler sein soll:
1<?php
2
3function check_intersection($x1,$y1,$x2,$y2,$x3,$y3,$x4,$y4)
4
5{
6
7if($y1!=$y2)
8
9{
10
11$m=$x3;

$n=$y3;

$o=$x4;

$p=$y4;

$x3=$x1;

$y3=$y1;

$x4=$x2;

$y4=$y2;

$x1=$m;

$y1=$n;

$x2=$o;

$y2=$p;

}

if($x1<=$x3 && $x2<=$x3) return (1);

if($x1>=$x3 && $x2>=$x3) return (1);

if(($x1<$x3 && $x2>$x3) && ($y1>=$y3 && $y1>=$y4)) return (1);

if(($x1<$x3 && $x2>$x3) && ($y1<=$y3 && $y1<=$y4)) return (1);

return (0);

}

//checking for the free postion

include "common.php";

$sql = "select x1,y1,x2,y2,id from area where cnf_check=0 or cnf_check=1";

$link = mysql_query($sql,$cn);

$num=mysql_num_rows($link);

$check=1;

if($num>0)

{

while($data=mysql_fetch_row($link))

{

$x1=$data[0];

$y1=$data[1];

$x2=$data[2];

$y2=$data[3];

$px1=$_POST['x1'];

$py1=$_POST['y1'];

$px2=$_POST['x2'];

$py2=$_POST['y2'];

$amount_to_be_paid=$_POST['amount'];

if($x1>=$px1 && $x2<=$px2 && $y1>=$py1 && $y2<=$py2) { $check=-1; break; }

if($x1<=$px1 && $x2>=$px2 && $y1<=$py1 && $y2>=$py2) { $check=-2; break; }

//if(!check_intersection($x1,$y1,$x2,$y2,$px1,$py1,$px2,$py2)) { $check=-3; break; }

if(!check_intersection($x1,$y1,$x2,$y2,$px2,$py1,$px2,$py2)) { $check=-4; break; }

if(!check_intersection($x1,$y1,$x2,$y2,$px1,$py2,$px2,$py2)) { $check=-5; break; }

if(!check_intersection($x1,$y1,$x2,$y2,$px1,$py1,$px1,$py2)) { $check=-6; break; }

//if(!check_intersection($x2,$y1,$x2,$y2,$px2,$py1,$px2,$py2)) { $check=-7; break; }

if(!check_intersection($x2,$y1,$x2,$y2,$px1,$py2,$px2,$py2)) { $check=-8; break; }

if(!check_intersection($x2,$y1,$x2,$y2,$px1,$py1,$px1,$py2)) { $check=-9; break; }

//if(!check_intersection($x1,$y2,$x2,$y2,$px1,$py2,$px2,$py1)) { $check=-10; break; }

if(!check_intersection($x1,$y2,$x2,$y2,$px1,$py1,$px1,$py2)) { $check=-11; break; }

//if(!check_intersection($x1,$y1,$x1,$y2,$px1,$py1,$px1,$py2)) { $check=-12; break; }

}

}

// If Free Position found

if($check>0)

{

$fileName = $_FILES['userfile']['name'];

$tmpName  = $_FILES['userfile']['tmp_name'];

$fileSize = $_FILES['userfile']['size'];

$fileType = $_FILES['userfile']['type'];

//------------------------------------------------//

//------------------------------------------------//

$fp = fopen($tmpName, 'r');

$content = fread($fp, filesize($tmpName));

$content = addslashes($content);

fclose($fp);

if(!get_magic_quotes_gpc())

{

$fileName = addslashes($fileName);

}

$x1=$_POST['x1'];

$y1=$_POST['y1'];

$x2=$_POST['x2'];

$y2=$_POST['y2'];

$url=$_POST['url'];

$title=$_POST['title'];

$name=$_POST['name'];

$email=$_POST['email'];

$amount=$_POST['amount'];

function microtime_float()

{

list($usec, $sec) = explode(" ", microtime());

return ((int)$usec + (int)$sec);

}

$time_start = microtime_float();

$id = $time_start;

/*

$query = "INSERT INTO area(id,x1,y1,x2,y2,url,title,name,email,amount,img_name,img_type,img_filesize, img_content,cnf_check) ".

"VALUES ('$id',$x1,$y1,$x2,$y2,'$url','$title', '$name','$email','$amount','$fileName','$fileType','$fileSize','',2)";

echo "Q: " . $query;

*/

$query = "INSERT INTO area ( x1 , y1 , x2 , y2 , url , title , name , email , amount , cnf\_check , image\_id , img\_name , img\_type , img\_filesize , img\_content , paypal\_txn\_id , clicks )

VALUES ($x1,$y1,$x2,$y2,'$url', '$title', '$name','$email', '$amount', '2', '', '$fileName', '$fileType', '$fileSize', '', '', '0')";

if($link=mysql_query($query,$cn) or die(mysql_error()))

{

$id = mysql_insert_id($cn);

$msg1 = "Inserted!";

setcookie("id","$id");

if(is_uploaded_file($_FILES['userfile']['tmp_name'])){

$ext = explode("." , $_FILES['userfile']['name']);

//print_r($ext);

move_uploaded_file($_FILES['userfile']['tmp_name'] , "upload_img/" . $id . "." . $ext[1]);

}

}

else

{

echo "MySql Error";

echo mysql_error();

}

}

?><?php include  "header.php"; ?><head><LINK href="images/style.css" type=text/css rel=stylesheet>

<style>

body {

background:   url(images/pagebgnew.jpg) repeat;

}

.white

{

font-family: Verdana;

font-size: 11px;

font-weight: bold;

color: #FFFFFF;

}

.white_every

{

font-family: Verdana;

font-size: 11px;

color: #FFFFFF;

}

a

{

text-decoration: none;

}

.black

{

font-family: Verdana;

font-size: 11px;

font-weight: bold;

color: #000000;

}

.black_no_bold

{

font-family: Verdana;

font-size: 11px;

color: #000000;

}

#grid {

position: relative;

top: 0;

left: 0;

width: 1000;

height: 1000;

border: 0;

margin-left: auto;

margin-right: auto;

text-align: center;

background-image:   url(images/grid.gif);

background-repeat: repeat;

}

.g {

position: absolute;

border: 0;

z-index: 3;

align: center;

}

</style>

<style>

a:hover{color:red}

</style>

</head>

<table width="1000" border=0 align="center" cellpadding=5 cellspacing=0>

<tr>

<td width=150 background="images/grid.gif"></td>

<td width=600 bgcolor=#CCCCCC>

<?php

$amount=$_POST['amount'];

$width=$_POST['width'];

$height=$_POST['height'];

$item_num="$width"."&"."$height";

?>

<?php