Page 1 of 1

UPDATE causing me a headache

Posted: Mon Oct 05, 2009 9:12 am
by guymclaren

Code: Select all

 
15. while($row = mysql_fetch_array($objRS, MYSQL_ASSOC)) {  
16. $mailto = $row['mailto'];
17. $status = $row['status'];
18. $mailtoadd = ($mailto + 1);
 
19. $query = mysql_query("UPDATE companies SET mailto='".$mailtoadd."' WHERE id='".$ident"'");
gives this result?
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/vhosts/lowveldnet.co.za/httpdocs/findit/sendmail.php on line 20
Can anyone tell me why in words with minimum syllables please

Re: UPDATE causing me a headache

Posted: Mon Oct 05, 2009 9:27 am
by Mirge
Not seeing anything in that segment of code that would cause that error.

Re: UPDATE causing me a headache

Posted: Mon Oct 05, 2009 9:33 am
by guymclaren
Mirge wrote:Not seeing anything in that segment of code that would cause that error.
My thoughts exactly, but when I comment the

Code: Select all

//$query = mysql_query("UPDATE companies SET mailto='".$mailtoadd."' WHERE id='".$ident"'");
line the script does everything else. that is line 20 as it happens

Re: UPDATE causing me a headache

Posted: Mon Oct 05, 2009 9:35 am
by guymclaren
There was a full script here but it is unneccessary for the question and answer

Re: UPDATE causing me a headache

Posted: Mon Oct 05, 2009 10:04 am
by Mirge
guymclaren wrote:
Mirge wrote:Not seeing anything in that segment of code that would cause that error.
My thoughts exactly, but when I comment the

Code: Select all

//$query = mysql_query("UPDATE companies SET mailto='".$mailtoadd."' WHERE id='".$ident"'");
line the script does everything else. that is line 20 as it happens

$query = mysql_query("UPDATE companies SET mailto='".$mailtoadd."' WHERE id='".$ident"'");

Took me a second. You're missing the last period (dot) after $ident

Re: UPDATE causing me a headache

Posted: Mon Oct 05, 2009 11:23 am
by guymclaren
Thank you coding god, boy do I feel like a tool

Re: UPDATE causing me a headache

Posted: Mon Oct 05, 2009 11:38 am
by Mirge
Happens to the best of us lol

Re: UPDATE causing me a headache

Posted: Mon Oct 05, 2009 12:38 pm
by jackpf
guymclaren wrote:Thank you coding god
xD


Nice.