Regicide
Thread Starter
- Joined
- Aug 8, 2003
- Messages
- 307
All I am trying to do is put in a varible in a mysql query in PHP. This is what I have now:
For some reason this returns the value "resource id #2". But, when I use the same command in command line, it works fine. $page contains the right text, I've checked. Can someone please help me?
PHP:
$page = $_GET['view'];
$db = mysql_connect("localhost", "root", "pass");
mysql_select_db("test", $db);
$query = "SELECT title FROM pages where page = '$page'";
$title = mysql_query("$query", $db);