Receive the following error - any help greatly appreciated
AdvisorGarage - February 22, 2008 - 12:56
| Project: | Book Review |
| Version: | 5.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | humaneasy |
| Status: | closed |
Jump to:
Description
user warning: Table 'bookshopofhorror.bsbookreview' doesn't exist query: SELECT COUNT(*) FROM bsbookreview b INNER JOIN bsnode n ON b.nid = n.nid WHERE n.type = 'bookreview' in /home/content/A/d/v/AdvisorGarage/html/bookshopofhorror/includes/database.mysql.inc on line 172.
user warning: Table 'bookshopofhorror.bsbookreview' doesn't exist query: SELECT b.nid, n.title, b.booktitle, b.cover, b.publisher, b.isbn, b.copyright, b.pages, b.rating FROM bsbookreview b INNER JOIN bsnode n ON b.nid = n.nid WHERE n.type = 'bookreview' ORDER BY b.booktitle ASC LIMIT 0, 20 in /home/content/A/d/v/AdvisorGarage/html/bookshopofhorror/includes/database.mysql.inc on line 172.

#1
Any feedback?
Thanks!
Andrew
user warning: Table 'bookshopofhorror.bsbookreview' doesn't exist query: SELECT COUNT(*) FROM bsbookreview b INNER JOIN bsnode n ON b.nid = n.nid WHERE n.type = 'bookreview' in /home/content/A/d/v/AdvisorGarage/html/bookshopofhorror/includes/database.mysql.inc on line 172.
user warning: Table 'bookshopofhorror.bsbookreview' doesn't exist query: SELECT b.nid, n.title, b.booktitle, b.cover, b.publisher, b.isbn, b.copyright, b.pages, b.rating FROM bsbookreview b INNER JOIN bsnode n ON b.nid = n.nid WHERE n.type = 'bookreview' ORDER BY b.booktitle ASC LIMIT 0, 20 in /home/content/A/d/v/AdvisorGarage/html/bookshopofhorror/includes/database.mysql.inc on line 172.
#2
I'm assuming that you have the last version of the last package available tagged with 5.x-1.x-dev version :D
Check your database to see if there is a database called bookshopofhorror and if it has a table called bsbookreview. Use phpMyAdmin if you have it installed. Note the underlined.
I was looking at the code of bookreview.install and it mention three tables:
This SQL you have only appears once in the file bookreview.module at function theme_bookreview_list() and it seems correct. See if your SQL command is equal to this:
<?php
function theme_bookreview_list() {
$header = array(' ', array('data' => t('Title'), 'field' => 'b.booktitle', 'sort' => 'asc'), array('data' => t('Copyright'), 'field' => 'b.copyright'), array('data' => t('ISBN'), 'field' => 'b.isbn'));
$sql = db_rewrite_sql("SELECT b.nid, n.title, b.booktitle, b.cover, b.publisher, b.isbn, b.copyright, b.pages, b.rating FROM {bookreview} b INNER JOIN {node} n ON b.nid = n.nid WHERE n.type = 'bookreview'");
$sql .= tablesort_sql($header);
$result = pager_query($sql, 20);
// (code continues...)
?>
If the code is alright and the table names too then:
Don't forget BACKUP your database before anything. If you mess it up you can always restore it :)
#3
I think I found the bug.
Bad non-Drupal-standard code :)
Did you choose bs as your table prefix?
If so you must edit the bookreview.install and change a few lines.
It is always better to choose a prefix like bs_ so we can catch the issue at first glance.
More on this at http://api.drupal.org/api/function/hook_install/5
#4
I made a new corrected install file but, please, don't forget to BACKUP before anything.
Rename your bookreview.install as bookreview.install.old then proceed with the stuff I explained before:
If it still gives the same error then you must:
BACKUP! I didn't test it.
GRAB the new bookreview.install file at http://drupal.org/node/145270#comment-758524
#5
Can someone check if the file I made corrects the error or not?
#6
Hi, I think the problem is in hte absense of brackets {} (latest 5.1.dev file), than prefixes to database tables are not working, right?
I changed the install file for MYSQL to have brackets:
case 'mysqli':
db_query("CREATE TABLE {bookreview} (
nid int(10) unsigned NOT NULL,
booktitle varchar(255) NOT NULL default '',
cover varchar(255) NOT NULL default '',
publisher varchar(255) NOT NULL default '',
copyright varchar(255) NOT NULL default 0,
isbn varchar(255) NOT NULL default '',
price varchar(255) NOT NULL default '',
pages varchar(255) NOT NULL default 0,
rating int(1) NOT NULL default 0,
synopsis text,
contents text,
review text,
PRIMARY KEY (nid),
KEY (booktitle)
);");
db_query("CREATE TABLE {bookreview_links} (
lid int(10) unsigned NOT NULL auto_increment,
nid int(10) unsigned NOT NULL,
booklink varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
weight tinyint DEFAULT '0',
KEY (lid),
KEY (nid)
);");
db_query("CREATE TABLE {bookreview_authors} (
aid int(10) unsigned NOT NULL auto_increment,
nid int(10) unsigned NOT NULL,
author varchar(255) NOT NULL default '',
weight tinyint DEFAULT '0',
KEY (aid),
KEY (nid)
);");
break;
If I am mistaken, sorry to interrupt this issue.
Greetings,
Martijn
#7
There was a patch for it at #145270: Uninstall of bookreview module
#8
#9
Automatically closed -- issue fixed for 2 weeks with no activity.