stupid URL variable question

From: Date: Sat, 02 Feb 2002 00:42:20 +0000
Subject: stupid URL variable question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-83217@lists.php.net to get a copy of this message
Can anyone explain why this URL and SQL statement won't work? <A HREF="test_mediacoverage.php?locale=en_na&sec=news&subsec=media&name=infowee k1">Media Coverage Test Page</A> --> And on test_mediacoverage.php .. $table_name = "$locale"; // ..connection content.. $sql = "SELECT comp, content FROM $table_name WHERE sec = '$sec' AND subsec = '$subsec' AND name = '$name' ORDER BY comp "; $result = @mysql_query($sql,$connection) or die("Couldn't execute query."); It's giving me the 'Couldn't execute query' result, but the SQL statement does work with the values hard-coded in.. So it must be something about the way the values are passed through the URL. On a furthur note, is this a good idea? I'm using the URL to determine what content goes into the the template.. I'm not using sessions or cookies (no authentication needed..) so is there a better way to do this? Thanks, James

« previous php.general (#83217) next »