Installing the availability calender

Installing the availability calender

Postby Tony » Sun Mar 16, 2008 8:44 pm

Hi Chris, I hope you or someone else in the forum can help as I have no programming experience. I have uploaded the files as mentioned in point 1 of the readme file but point 2 looses me. It says Modify the connect_db.inc.php file with your db values OR modify all php files that refer to the db connection to point to your current db connection file. What do you mean by db values and where would I find them. I don’t have a database, should I have one? I intend to use the calendar on my website at http://mojacarsands.co.uk/ can you help?

Thanks
Tony
 
Posts: 3
Joined: Sun Mar 16, 2008 8:16 pm

Re: Installing the availability calender

Postby chris » Mon Mar 17, 2008 12:49 am

Hi there and welcome to the forum.

Yes, I am afraid for this calendar to work you need to have a database set up to save the dates that are "booked".

Most moderen hosting services come with at least the possibilit of having one mysql data base. Ask your provider about this and if they could create one for you. They should then provide you with the data that you need to create the table and the access it for the code. ie:

hostname
database name
user
password

Let me know if this isn't clear or if you need further help setting this up once having the database ready as I realise that, if this is your first time working with databases it is quite daunting stuff :)

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Installing the availability calender

Postby Tony » Wed Mar 19, 2008 8:13 pm

Thanks for your advice Chris. i now have a database and mysql. I'm not sure what the diffencee between the two is so still working on that. I probably wont get much done this week or next so if I dont resond its because I'm in Spain on holiday for the next week.
Thanks
Tony
 
Posts: 3
Joined: Sun Mar 16, 2008 8:16 pm

Re: Installing the availability calender

Postby chris » Wed Mar 19, 2008 9:09 pm

hi again,
"database and mysql" and really are one and the same. Well, to be more precise mysql is a type of database.

A database is a system of storing data. mysql is just the name of the type of database that you have.
Mysql is one of the most common types, certainly in most hosting schemes, but there are many others such as "sql" and "postgres".

The important thing is that you now have one ;) and can are ready to start creating dynamic contents for your website :)

Hopefully your hosting provider will have sent you the password, username etc. These are what you need to add to the db_include.in.php file.

Have fun in Spain (I live in Spain ;) ) and let me know how things go when you get back.

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Installing the availability calender

Postby Tony » Wed Mar 19, 2008 11:15 pm

Hi Chris, Spain is where I'm hoping to move to within the next 3 yrs, hence the appartment in Mojacar...lovely place.

Can you help with the following? I've swapped names arround to match but I keep getting...
when i load my browser i get:
Database table bookings_cal does not exist.
Before you can run this script you need to create the availability table in your data base.
CREATE AVAILABILITY TABLE IN DATABASE

when i click on CREATE AVAILABILITY TABLE IN DATABASE

i get:

UNABLE TO CREATE THE AVAILABILITY TABLE
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 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=46' at line 7

can you point me in the right direction?

Thanks
Tony
 
Posts: 3
Joined: Sun Mar 16, 2008 8:16 pm

Re: Installing the availability calender

Postby chris » Thu Mar 20, 2008 12:43 am

Moving to spain is a good move - I came here 14 years ago and never went back (to the UK) :)

I don't know why you re getting that error - it is a completly normal "create table" command.

I could have a got a setting this up myself if you want to, however you would need to send me your database details.

Send me a pm if you are interested as it would be better than posting it here in the public forum-

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Installing the availability calender

Postby Storm » Sat Mar 22, 2008 1:58 am

Hi Chris,

I am having the same problem as above:
UNABLE TO CREATE THE AVAILABILITY TABLE
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 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=46' at line 7



Did you manage to solve this problem, if so could you post a fix

Cheers......Storm
Storm
 
Posts: 5
Joined: Sat Mar 22, 2008 1:40 am
Location: Malta & London

Re: Installing the availability calender

Postby chris » Sat Mar 22, 2008 12:59 pm

Hi there,
No, as of yet I have not heard back from Tony though he did say that he was going (coming) to Spain for a holiday and might not be able to respond.

I have retested the script on several of the servers that I have and it has had no problems :(

Can you try this -
open up "db_table_create.php" file and remove the ENGINE=MyISAM part of the create table query
Your new query should look like this:
Code: Select all
 CREATE TABLE IF NOT EXISTS `cal_bookings2` (
`id` int( 10 ) NOT NULL AUTO_INCREMENT ,
`id_item` int( 20 ) NOT NULL default '0',
`the_date` date NOT NULL default '0000-00-00',
PRIMARY KEY ( `id` ) ,
KEY `id_item` ( `id_item` )
) DEFAULT CHARSET = latin1 AUTO_INCREMENT =1

Let me know how it goes

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Installing the availability calender

Postby Storm » Sun Mar 23, 2008 4:30 pm

Hi Chris

UNABLE TO CREATE THE AVAILABILITY TABLE
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 'DEFAULT CHARSET = latin1 AUTO_INCREMENT =1' at line 7


MySQL v4
Server version: 4.0.26-standard
MySQL client version: 5.0.24a


Regards, LEE :)
Storm
 
Posts: 5
Joined: Sat Mar 22, 2008 1:40 am
Location: Malta & London

Re: Installing the availability calender

Postby chris » Sun Mar 23, 2008 5:05 pm

umm, I really can't see why this mysql create table code shouldn't work though I will admit to not being an expert on mysql version diferences :(

Do you have direct access to the database via phpmyadmin or somthing similar?

If you do, have you tried inserting the query directly into the database that way?

Code: Select all
CREATE TABLE `bookings_cal_test` (
`id` int( 10 ) NOT NULL AUTO_INCREMENT ,
`id_item` int( 20 ) NOT NULL default '0',
`the_date` date NOT NULL default '0000-00-00',
`state` char( 3 ) NOT NULL default 'all',
PRIMARY KEY ( `id` ) ,
KEY `id_item` ( `id_item` )
) AUTO_INCREMENT =1;


Try this one - I have even removed the charset so that it detects your databse default.

I hope you can get this working, creating the database "shouldn't" be the hard part ;)

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Next

Return to General

Who is online

Users browsing this forum: No registered users and 0 guests

cron