You are here: Re: My function returns true but my code does not execute « PHP Programming Language « IT news, forums, messages
Re: My function returns true but my code does not execute

Posted by Ewoud Dronkert on 10/31/05 10:54

John Moore wrote:
> $query = "UPDATE
> about
> SET
> category_id = $category_id_new
> WHERE
> about_id = $_SESSION[about_id]";

You can't use multi-line strings like that in PHP. I presume in your code
it is actually written:

> $query = "UPDATE about SET category_id = $category_id_new WHERE about_id = $_SESSION[about_id]";

Then you can't use array values like that in strings. Zeldor was partly
right that it needs quotes around the key (because that is a string, not a
constant), but it also needs curly braces around the whole name if you are
going to use it inside the string:

$query = "... about_id = {$_SESSION['about_id']}";

For goodness sake, see
http://php.net/manual/en/language.types.string.php#language.types.string.parsing

--
E. Dronkert

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация