/    Sign up×
Community /Pin to ProfileBookmark

Need some help with syntax

I’m getting the following error on one of my page:

[CODE]
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 ” at line 1[/CODE]

here is my page code:

[CODE]<?php
//Connection statement
require_once(‘../Connections/KartConnect.php’);

//Aditional Functions
require_once(‘../includes/functions.inc.php’);

if($_REQUEST[‘cat_id’]){$cat_id= $_REQUEST[‘cat_id’];}
if($_REQUEST[‘cat’]){$cat= $_REQUEST[‘cat’];}

if($_REQUEST[‘update_users’]){
$i=0;
foreach ($_POST[‘user_id’] as $value) {

$updateSQL = “UPDATE `contacts` SET `confirmed`= ‘”.$confirmed[$i].”‘, `attended`='”.$attended[$i].”‘ WHERE `id`=”.$user_id[$i];
$Result1 = $KartConnect->Execute($updateSQL) or die($KartConnect->ErrorMsg());
$totalRows_Result1 = $Result1->RecordCount();

//echo “confirmed? – “.$confirmed[$i].'<br>’;
$i++;
}}
//echo $i;

//PHP ADODB document – made with PHAkt 2.8.2
?>

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>[/CODE]

what could be wrong?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@papa_faceJan 16.2007 — should be:
&lt;?php
//Connection statement
require_once('../Connections/KartConnect.php');

//Aditional Functions
require_once('../includes/functions.inc.php');

if($_REQUEST['cat_id']){$cat_id= $_REQUEST['cat_id'];}
if($_REQUEST['cat']){$cat= $_REQUEST['cat'];}

if($_REQUEST['update_users']){
$i=0;
foreach ($_POST['user_id'] as $value) {

<i> </i>$updateSQL = "UPDATE <span><code>contacts</code></span> SET <span><code>confirmed</code></span>= '".$confirmed[$i]."', <span><code>attended</code></span>='".$attended[$i]."' WHERE <span><code>id</code></span>='".$user_id[$i]."'";
<i> </i>$Result1 = $KartConnect-&gt;Execute($updateSQL) or die($KartConnect-&gt;ErrorMsg());
<i> </i>$totalRows_Result1 = $Result1-&gt;RecordCount();

//echo "confirmed? - ".$confirmed[$i].'&lt;br&gt;';
$i++;
}}
//echo $i;



//PHP ADODB document - made with PHAkt 2.8.2
?&gt;

&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
&lt;html&gt;
&lt;head&gt;
Copy linkTweet thisAlerts:
@ellicitauthorJan 16.2007 — work fine now... thanks for ur help and for the quick reply!
×

Success!

Help @ellicit spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...