hi-
i have the following query as part of a basic search engine.
it wont work at the web host. i have more code but this is the
offending query. it works in the mysql control center.
the webhost uses phpmyadmin. however the mysql control center isnt
replicated production environment (some things are a little different);
i did some prints to test the result of the function and $z1 and $z4
inside a print look like this print("z1 is $z1") ... z1 is
an old friend use to say i feel like some third evil force is zapping
me. this one has me really scratching my head.
please help.
thanks,
jim
function orSql($o1,$o2)
{
set_include_path('/home/3rdshift/public_html/php_include/');
include("dbconnect.php");
mysql_connect($host,$username,$password)
or die("ERROR: Could not connect to database!");
mysql_select_db("3rdshift_bookmarks");
mysql_query("drop table d1");
mysql_query("drop table d2");
$z1=sprintf("create temporary table d1 SELECT p.page_url as url,
count(*)as occurrences
FROM page p, word w, occurrence o where
(w.word_word=%s or w.word_word=%s) and p.page_id = o.page_id
and
w.word_id = o.word_id
group by p.page_url
ORDER BY occurrences DESC LIMIT %s",
quote_smart($o1),quote_smart($o2),
quote_smart($results=intval($_POST['results'])));
$z4=mysql_query("select * from d1");
return $z4;
}