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

Posted by SterLo on 05/10/07 18:59

If you define a variable $x and then INCLUDE a file such as
include_once("path"); it should work.

So if you have:

$query = 'select * from list where content = '.$idcontent;

And

$idcontent = 15;
require_once("queries.inc.php");

You need to change require to include.

so it should be

$idcontent = 15;
include_once("queries.inc.php");

And you can check this by doing something like

if ( $idcontent > 0 ) {

}

 

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

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