Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Professional Joomla! ISBN: 978-0-470-13394-1
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #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
Registered User
Points: 65, Level: 1
Points: 65, Level: 1 Points: 65, Level: 1 Points: 65, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2010
Location: Scotland
Posts: 9
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Skype™ to Lochman
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!
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 10: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 02: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 01:26 PM



All times are GMT -4. The time now is 05:07 AM.


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