PDA

View Full Version : MySql error after installation, Help!!!


bluelotus
01-02-2007, 05:55 AM
I have just installed the free version of the script (v 1.5) and keep getting messages like this everywhere:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/username/public_html/directory/classes/DirDb.php on line 152
SELECT COUNT(t1.`id`) FROM `dir_links` t1 LEFT JOIN `dir_link_categories` t2 ON t1.`id` = t2.`id_link` WHERE t1.`status` = 'active'
Table 'databasename.dir_link_categories' doesn't exist

If I try to create a category, I get a similar error message. If I try to see my directory index page, there is nothing but a similar error message that says:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/username/public_html/directory/classes/DirDb.php on line 114
SELECT * FROM `dir_link_fields` WHERE `adminonly` = '0' ORDER BY `order` ASC
Table 'databasename.dir_link_categories' doesn't exist

Any suggestions would be greatly appreciated!!!

Thanks!

jailaxmi

bunny
01-02-2007, 06:41 AM
Did installation go fine? Was it able to connect to mysql initially?

bluelotus
01-02-2007, 07:07 AM
Yes, everything seemed fine except that the mysql error appeared when I logged into the admin panel. I tried to add a new category and got the same type of errors.

I have been reading all the .htaccess posts, figuring maybe it had something to do with this error, but no luck so far. This is what my .htaccess file looks like:

# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $
#
# This is used with Apache WebServers

AddHandler application/x-httpd-php .htm .html .shtml
#
AddType application/x-httpd-php .php .htm .html .shtml
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
# <Directory "/usr/local/apache/htdocs">
# AllowOverride Options
# </Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)
# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers

# enable mod_rewrite
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)/$ index.php?category=$1 [QSA,L]
RewriteRule ^(.*)/index([0-9]+).html$ index.php?category=$1&page=$2 [QSA,L]

<IfModule mod_setenvif.c>
<IfDefine SSL>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</IfDefine>
</IfModule>
# If Search Engine Friendly URLs do not work, try enabling the
# following Apache configuration parameter
#
# AcceptPathInfo On
# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)
#
<IfModule mod_php4.c>
</IfModule>

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-links-(.*).html$ links.php?lPath=$2&%{QUERY_STRING}

RewriteCond %{HTTP_USER_AGENT} !(msnbot|slurp|googlebot) [NC]
RewriteCond %{HTTP_USER_AGENT} !(ia_archiver|jeeves|bot) [NC]
RewriteCond %{HTTP_USER_AGENT} !(bot) [NC]

MySql version is 4.1.21, Apache version is 1.3.37 and mod_rewrite is enabled.

Any suggestions?

bluelotus

bluelotus
01-02-2007, 07:33 AM
OK, the previous .htaccess file is what I have in my root folder and copied to the link directory folder. I found a post that related to my problem and changed the directory folder .htaccess file to:

RewriteEngine on
RewriteBase /

RewriteRule ^(.*)/$ index.php?category=$1 [QSA,L]
RewriteRule ^(.*)/index([0-9]+).html$ index.php?category=$1&page=$2 [QSA,L]

RewriteRule ^new-links.html$ new-links.php [QSA,L]
RewriteRule ^new-links([0-9]+).html$ new-links.php?page=$1 [QSA,L]

RewriteRule ^top-links.html$ top-links.php [QSA,L]
RewriteRule ^top-links([0-9]+).html$ top-links.php?page=$1 [QSA,L]

RewriteRule ^popular-links.html$ popular-links.php [QSA,L]
RewriteRule ^popular-links([0-9]+).html$ popular-links.php?page=$1 [QSA,L]

RewriteRule ^editor-links/index.html$ editor-links.php [QSA,L]
RewriteRule ^editor-links/index([0-9]+).html$ editor-links.php?page=$1 [QSA,L]

RewriteRule ^(.*)/(.*)-l([0-9]+).html$ view-link.php?cat=$1&title=$2&id=$3 [QSA,L]

I am still having the same mysql errors. Is there anything I would need to add/change here to make it work?

Any suggestions would be greatly appreciated!!!

bluelotus