SQL error when adding a reservation (system previously OK)

Discuss here how to configure hoteldruid and better use its features.

Moderator: marco

Post Reply
thecocker
Posts: 7
Joined: Sun Sep 10, 2006 11:07 am

SQL error when adding a reservation (system previously OK)

Post by thecocker »

Hello.

A problem has developed with our system - previously it has been working perfectly.

Basically, since 2007 we haven't been able to add a reservation. Anything related to adding a reservation or modifying the rates generates the following error:


Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 32 in {our server path}\php-residence\includes\funzioni_mysql.php on line 67

As you might imagine - this is causing some consternation! Does anybody have some insight into what might be causing the problem? The software has been flawless up until now.

Regards,
The Cocker.
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

Aren't there other errors before that one? I can't tell what the problem is from this error, maybe reporting the entire page would be more useful. What version of php-residence are you running? Is the rest working properly, apart new reservations and changing rates?

Marco
Problems installing, configuring, upgrading?
Try the easiest way to use HotelDruid:
https://www.digitaldruid.net/hosted/index.php
thecocker
Posts: 7
Joined: Sun Sep 10, 2006 11:07 am

Post by thecocker »

Hi Marco!

Thanks for the speedy response.

There are no other (obvious) errors besides this one.

If we go to the "Insert Reservation" link from the main menu it looks like this:

http://www.thecocker.com/Reservations-Screen-Shot.jpg

It wont let us select a rate, but if we try and enter it as a reservation anyway we get:

http://www.thecocker.com/Reservation-Failed.jpg

It really seems as though all of our rates have disappeared, but it wont let us put them back in again. Anywhere in php-residence where rates are involved the above error creeps in.

I'm not sure what version of php-residence we're using (how do we check?) It was first downloaded and installed at around May 2006. It hasn't been updated since.

Is there any other information that we can provide? WOuld it assist you to log into our system and check it yourself?

Regards,

The Cocker.
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

It seems that the ntariffe2007 has not been imported. If you can, connect to the database and check if the table ntariffe2007 exists and is empty. If so try to issue this query (your tables may have a prefix before their name):

insert into ntariffe2007 select * from ntariffe2006

Before doing this it would be better making a php-residence backup if you haven't already done it. You can check the php-residence version in the README file.

Marco
Problems installing, configuring, upgrading?
Try the easiest way to use HotelDruid:
https://www.digitaldruid.net/hosted/index.php
thecocker
Posts: 7
Joined: Sun Sep 10, 2006 11:07 am

Post by thecocker »

Your assumption is entirely correct! The ntariffe2007 is empty!

However, when I run your SQL statement (suitably edited to reflect the table names we're using) I get:

INSERT INTO cockerntariffe2007
SELECT *
FROM cockerntariffe2006

MySQL said:

#1136 - Column count doesn't match value count at row 1

I feel guilty asking for further support but I don't know enough SQL to debug this one myself....

Regards,

The Cocker.
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

Then you should specify all columns in the cockerntariffe2007 (not 2006) table, this is an example (columns may vary with php-residence version and the number of rates):

INSERT INTO cockerntariffe2007
(idntariffe,nomecostoagg,tipo_ca,valore_ca,arrotonda_ca,associasett_ca,numsett_ca,moltiplica_ca,periodipermessi_ca,variazione_ca,mostra_ca,letto_ca,numlimite_ca,tariffa1,tariffa2)
SELECT
idntariffe,nomecostoagg,tipo_ca,valore_ca,arrotonda_ca,associasett_ca,numsett_ca,moltiplica_ca,periodipermessi_ca,variazione_ca,mostra_ca,letto_ca,numlimite_ca,tariffa1,tariffa2
FROM cockerntariffe2006

If it's possiblie send your backup to marco@digitaldruid.net to see what caused the problem. Anyway I suggest you to upgrade to the latest 0.6.4 version (and after that create and restore a backup to avoid the bug reported at the top of this forum for next year).

Marco
Problems installing, configuring, upgrading?
Try the easiest way to use HotelDruid:
https://www.digitaldruid.net/hosted/index.php
thecocker
Posts: 7
Joined: Sun Sep 10, 2006 11:07 am

Post by thecocker »

Marco, you are a gentleman and a scholar.

Long live php-residence! ;-)

Regards,
The Cocker.
Post Reply