p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: Professional Joomla! ISBN: 978-0-470-13394-1 (http://p2p.wrox.com/book-professional-joomla-isbn-978-0-470-13394-1-362/)
-   -   Ch.6: Creating a Guestbook (http://p2p.wrox.com/book-professional-joomla-isbn-978-0-470-13394-1/88459-ch-6-creating-guestbook.html)

nanoo_k September 17th, 2012 07:58 PM

Ch.6: Creating a Guestbook
 
I'm having trouble creating the guestbook component. When I try to install, Joomla throws the error below.

I tried putting the install.sql and uninstall.sql in the root folder, tried putting them in their own folders, tried creating an admin folder (all in attempts to mimic the XML schema). All threw errors (but different errors). Any ideas?

Here is my file structure:

com_guestbook
---.project
---admin.guestbook.php
---guestbook.php
---guestbook.xml
---install.sql
---uninstall.sql

Here is the error Joomla throws:
JInstaller::install: SQL Error. DB function failed with error number 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''#__guestbook' ('id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 'message' tex' at line 1 SQL=CREATE TABLE IF NOT EXISTS '#__guestbook' ('id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 'message' text NOT NULL, 'created_by' INTEGER UNSIGNED NOT NULL, 'location' VARCHAR(45), 'created' TIMESTAMP NOT NULL, 'userip' VARCHAR(16), PRIMARY KEY('id'))
SQL =
CREATE TABLE IF NOT EXISTS '#__guestbook'
('id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
'message' text NOT NULL, 'created_by' INTEGER UNSIGNED NOT NULL,
'location' VARCHAR(45), 'created' TIMESTAMP NOT NULL,
'userip' VARCHAR(16), PRIMARY KEY('id'))
Component Install: SQL error or missing or unreadable SQL file. DB function failed with error number 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''#__guestbook' ('id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 'message' tex' at line 1 SQL=CREATE TABLE IF NOT EXISTS '#__guestbook' ('id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 'message' text NOT NULL, 'created_by' INTEGER UNSIGNED NOT NULL, 'location' VARCHAR(45), 'created' TIMESTAMP NOT NULL, 'userip' VARCHAR(16), PRIMARY KEY('id'))
SQL =
CREATE TABLE IF NOT EXISTS '#__guestbook'
('id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
'message' text NOT NULL, 'created_by' INTEGER UNSIGNED NOT NULL,
'location' VARCHAR(45), 'created' TIMESTAMP NOT NULL,
'userip' VARCHAR(16), PRIMARY KEY('id'))

Lochman September 18th, 2012 04:08 AM

Syntax
 
I think it may just be a typo. Have a look at the source code of your file: <install.sql>. On the first line of the code, the name of the table (#__guestbook) has to be enclosed by delimiters. It looks as though you've got mixed quotation marks there, starting with a double quotation mark (ASCII 34 - U+0022 ) and closing with an apostrophe (ASCII 39 - U+0027).

I find that phpMyAdmin tends to use the grave accent (ASCII 96 - U+0060) but what is important is that you use the SAME character at the beginning and end of the table name.

Try changing your source code and I think you'll find that this will do the trick!


All times are GMT -4. The time now is 02:26 PM.

Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.