You are here: Re: variable in include « PHP Programming Language « IT news, forums, messages
Re: variable in include

Posted by Bob Bedford on 05/10/07 17:29

"David Gillen" <Belial@RedBrick.DCU.IE> a ιcrit dans le message de news:
slrnf46gpa.4na.Belial@murphy.redbrick.dcu.ie...
> Bob Bedford said:
>> HI all,
>> Weird problem....
>>
>> in the file queries.inc.php I've this:
>> $query = 'select * from list where content = '.$idcontent;
>>
>> I've this code in my page:
>> $idcontent = 15;
>> require_once("queries.inc.php");
>>
>> The query fails: when I do echo the query I've:
>>
>> select * from list where content =
>>
>> The $idcontent isn't set in the include...why ? how to fix it ?
>>
> Is your $query = .. line inside of function in teh queries.inc.php?
> If so $idcontent is out of scope.
NO it's not....
I've also tried to define the idcontent var as global again in the
queries.inc.php but it doesn't work either.

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация