Re: Database problem?

From: Date: Mon, 28 Nov 2005 19:01:29 +0000
Subject: Re: Database problem?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-226557@lists.php.net to get a copy of this message
On Mon, Nov 28, 2005 at 08:37:36PM +0200, William Stokes wrote: ... > I have this in my page and it doesn't work: > $sql = "select jouk_nimi from x_jun_jouk where jouk_id='$team' "; > $kysely = mysql_query($sql); > $tulos = mysql_fetch_row($kysely); > $jouk_nimi = $tulos[0]; > > $jouk_nimi -variable will be empty. ... > > So I think that somehow the $team variable is not passed from the address > line. Is there something in PHP ar Apache that needs to be configured You'll notice if you compare the output of phpinfo() from both server, the other server has register_globals on. You can fix this by explicitly defining where the variable $team is comming from. $team = mysql_real_escape_string($_GET['team']); $sql = "select jouk_nimi from x_jun_jouk where jouk_id='$team' "; Also note the escaping of the string; you should be sure to properly escape the string to avoid sql injection. Curt. -- cat .signature: No such file or directory

« previous php.general (#226557) next »