UPDATE causing me a headache

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
guymclaren
Forum Newbie
Posts: 11
Joined: Tue Feb 17, 2009 10:53 pm

UPDATE causing me a headache

Post 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
User avatar
Mirge
Forum Contributor
Posts: 298
Joined: Thu Sep 03, 2009 11:39 pm

Re: UPDATE causing me a headache

Post by Mirge »

Not seeing anything in that segment of code that would cause that error.
guymclaren
Forum Newbie
Posts: 11
Joined: Tue Feb 17, 2009 10:53 pm

Re: UPDATE causing me a headache

Post 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
guymclaren
Forum Newbie
Posts: 11
Joined: Tue Feb 17, 2009 10:53 pm

Re: UPDATE causing me a headache

Post by guymclaren »

There was a full script here but it is unneccessary for the question and answer
Last edited by guymclaren on Mon Oct 05, 2009 11:31 am, edited 1 time in total.
User avatar
Mirge
Forum Contributor
Posts: 298
Joined: Thu Sep 03, 2009 11:39 pm

Re: UPDATE causing me a headache

Post 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
guymclaren
Forum Newbie
Posts: 11
Joined: Tue Feb 17, 2009 10:53 pm

Re: UPDATE causing me a headache

Post by guymclaren »

Thank you coding god, boy do I feel like a tool
User avatar
Mirge
Forum Contributor
Posts: 298
Joined: Thu Sep 03, 2009 11:39 pm

Re: UPDATE causing me a headache

Post by Mirge »

Happens to the best of us lol
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: UPDATE causing me a headache

Post by jackpf »

guymclaren wrote:Thank you coding god
xD


Nice.
Post Reply