Re: Database problem?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux