Miyk Posted July 21, 2006 Share Posted July 21, 2006 I have a php/cms site that i am trying to port over to new hosting, Ihave ported over the mySQL tables ok, though I believe there is adifferant version of mySQL on the new server....anyway, the only errori am recieveing is on the search function, when i try to search foranything, it avails this error:MYSQL ERROR in dbobj_count: You have an error in your SQL syntax near') AGAINST('')' at line 1Query: select count(*) from news_stories where MATCH()AGAINST('')MYSQL ERROR in dbjobj_join: You have an error in your SQLsyntax near ') AGAINST ('') as cms_score from news_stories whereMATCH() AGAINST ('') LIMIT 0' at line 1Query: select *, MATCH() AGAINST ('') as cms_score from news_storieswhere MATCH() AGAINST ('') LIMIT 0, 9999999999additionally, when i am logged into the admin area, and try tore-index all pages, it almost finishs but avails this warning in theheader:Warning: fread(): Length parameter must be greater than 0. in/var/www/vhosts/vrroomedia.com/subdomains/staging/httpdocs/purelinegenetics/_admin/lib/cms_publish.phpon line 155here is the code that i believe the error may live in, which is in the 2 functions listed in the error message from dbobjects.php:[code]function dbobj_count($select) { if (! ($r = mysql_query($select))) { if ($err = mysql_error()) { echo "MYSQL ERROR in dbobj_count: $err<br>Query: $select"; return null; } } $row = mysql_fetch_row($r); return intval($row[0]);}[/code]and....[code]function dbobj_join($select) { if (! ($r = mysql_query($select))) { if ($err = mysql_error()) { echo "MYSQL ERROR in dbjobj_join: $err<br>Query: $select"; exit; } return false; } while ( ($row = mysql_fetch_array($r,MYSQL_BOTH))) { $obj = new ReadOnlyDBObject(); foreach ($row as $k => $v) $obj->$k = $v; $objs[] = $obj; } return $objs;}[/code]Any help would be greatly appreciated! Thanks!-Mike Quote Link to comment https://forums.phpfreaks.com/topic/15254-mysql-errorhelp/ Share on other sites More sharing options...
Oldiesmann Posted July 21, 2006 Share Posted July 21, 2006 Can you post the exact code for the query? It looks like MATCH() and AGAINST() aren't being passed the appropriate parameters.See one of the following pages in the MySQL manual for more info (depending on which version of MySQL you're using):4.1 and lower: http://dev.mysql.com/doc/refman/4.1/en/fulltext-search.html5.0: http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html5.1: http://dev.mysql.com/doc/refman/5.1/en/fulltext-search.html Quote Link to comment https://forums.phpfreaks.com/topic/15254-mysql-errorhelp/#findComment-61679 Share on other sites More sharing options...
Miyk Posted July 21, 2006 Author Share Posted July 21, 2006 Thanks for the response and the links, i will check those out, in the mean time here is the code from searchresults.php with the query form:[code]<form action="searchresults.php" method="get" id="searchForm"> <input type="hidden" name="num" value="9999" /> <input name="query" type="text" id="searchField" onfocus="if(this.value=='Search')this.value='';" value="<?= $_REQUEST['query'] ? $_REQUEST['query'] : 'Search' ?>" /> <input type="submit" name="Submit" value="GO" /></form>[/code]Thanks again!-mike Quote Link to comment https://forums.phpfreaks.com/topic/15254-mysql-errorhelp/#findComment-61693 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.