PHP/MySQL noob rides again.. into trouble

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

 



Hi all,

I have a site where users can search study projects. I'd like to be able to clicks on a project title which passes a variable to this page, which then displays all the data on that project in a table. Cool - and to a noob like me, actually pretty exciting. Except it doesn't work.

I get a "couldn't set value of result" message - see end of code. The page displayed all the projects fine when I messed up passing them from the previous page, so the problem is presumably in the first SQL query. Any suggestions?

<?
	$connect = mysql_connect("", "", "")
		or die("could not connect");
	$db = mysql_select_db("")
		or die("could not select db");
		if (isset($HTTP_GET_VARS['projTitle']))
	{
		$SQLQuery = "SELECT * FROM project WHERE
			projTitle = ".$HTTP_GET_VARS['projTitle']
			or die("SQLQuery 1 failed");
	}
	else
	{
		$SQLQuery = "SELECT*FROM project ORDER BY projTitle"
			or die("SQLQuery 2 failed");
	}
	$result = mysql_query($SQLQuery,$connect)
			or die("couldn't set value of result");
	
?>

TIA

Paul

--
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