Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Joomla! ISBN: 978-0-470-13394-1
This is the forum to discuss the Wrox book Professional Joomla! by Dan Rahmel; ISBN: 9780470133941
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Joomla! ISBN: 978-0-470-13394-1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 17th, 2012, 07:58 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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'))
  #2 (permalink)  
Old September 18th, 2012, 04:08 AM
Authorized User
Points: 71, Level: 1
Points: 71, Level: 1 Points: 71, Level: 1 Points: 71, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2010
Location: Scotland
Posts: 11
Thanks: 0
Thanked 4 Times in 3 Posts
Default 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!


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when creating resources (Ch.3) xnajoan BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 2 April 16th, 2010 08:03 AM
Ch 11 Creating relationships between tables bpl BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 November 13th, 2009 11:59 AM
Ch 7 Creating background using imagefilter... cshu BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 July 13th, 2005 03:05 AM
CH. 4 Creating Local Variables mcauliff BOOK: Beginning ASP 3.0 1 March 3rd, 2005 03:57 PM
Ch. 4 -1. Creating a Table jfr BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 February 16th, 2005 02:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.