470,849 Members | 1,128 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

please help--php query not working

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;
}
Jul 17 '05 #1
1 1416
"j-marvin" <cu******@service.boy> wrote in
news:Xn*************************@24.24.2.166:

hi again-

never mind. an adjustment here and an adjustment there
and it is working now. i was running out of time and
patience last night.

thanks very much,
jim
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by technobob | last post: by
17 posts views Thread by erikcw | last post: by
1 post views Thread by lenygold via DBMonster.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.