ole wrote:OK lets get back to basics here:In your case you have a problem with this line:Code: Select all
mysql_query(); // is a function $variable // is a variable = // means we are assigning something to the variable 'mysql_query("SELECT `field` FROM `table`")'; // this is not a function call, it is the name of a function with parameter stored as a string // as a result: echo $variable; // will echo 'mysql_query("SELECT `x` FROM `table`")' echo mysql_query("SELECT `field` FROM `table`"); // will call the function and output the return value from the function. // A good way to do it $q = 'SELECT `field` FROM `table`'; echo mysql_query($q); // will use 'SELECT `field` FROM `table`' as a database query // this will probably output nothing of use because mysql_query only returns a result resource. See the manual http://www.php.net/mysql_query/Code: Select all
$searchquery='mysql_query("SELECT * FROM `$table` WHERE ';
Thanks i see the difference between the function and the var my sript shows it as a var and not a function thanks ole for showing this. but still the problem is that the SQL query is not a query but is a string i have been told to cache the results by feyd i can tell this is true because when the query is echoed it gives the query not the resource id.
thanks reece