Posted by Curt Zirzow on 11/28/05 21:01
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
[Back to original message]
|