Jump to content


etogal mysql error


6 replies to this topic

#1 robotarchie

    Etomite Forum Newbie

  • Member
  • 10 posts

Posted 27 May 2007 - 01:27 PM

I've just installed the etogal snippet "etogal1 beta3" and called it from a page using [[etogal]] and I get the following error message when i try to load the page.

Etomite encountered the following error while attempting to parse the requested resource: « Execution of a query to the database failed » SQL: SELECT * FROM `etomite`.etomite_etogal WHERE gal_id in (55) ORDER BY gal_id,id ;
I have a feeling (but its uncertain) that I have to manually create the table etomite_etogal and if so how many fields do I include and of what type?

Any advice will be appreciated!

#2 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 27 May 2007 - 03:49 PM

View Postrobotarchie, on May 27 2007, 02:27 PM, said:

I've just installed the etogal snippet "etogal1 beta3" and called it from a page using [[etogal]] and I get the following error message when i try to load the page.

Etomite encountered the following error while attempting to parse the requested resource: « Execution of a query to the database failed » SQL: SELECT * FROM `etomite`.etomite_etogal WHERE gal_id in (55) ORDER BY gal_id,id ;
I have a feeling (but its uncertain) that I have to manually create the table etomite_etogal and if so how many fields do I include and of what type?

Any advice will be appreciated!
What exactly have you done, and what is the full error message please.

If all you had done was to copy the etogal snippet (not etogalthumb or etogalgal) and called it using [[etogal]] it would not have executed that query. In fact I can't offhand think of any circumstances under which the EtoGal snippet would execute that query (the order by clause is wrong!).

Note you MUST install the etogal snippet, and put it on a page, and show that page before using any of the other snippets in this section. When first used, the etogal snippet will (or at least should) create the database table for you. It is also the only snippet that allows loading of images.


PS
You probably would get that select query issued if you had installed the etoGalGallery snippet as EtoGal, and that would then result in an error, as there would be no Etogal table in the database.

Edited by mikef, 27 May 2007 - 05:02 PM.


#3 Oppdragnemo

    Etomite Forum Newbie

  • Member
  • 30 posts

Posted 27 May 2007 - 05:03 PM

If you have installed phpMyAdmin(or some other tools) you should be able to confirm that the table has been created.
You may have to set path to galleries:
$path_to_galleries= "assets/galleries/";

Table definitions should bee something like this if you have to manually create table:
CREATE TABLE "etogal" (
`id` int(10) unsigned NOT NULL auto_increment,
`gal_id` int(10) unsigned NOT NULL,
`filename` varchar(50) NOT NULL,
`title` text NOT NULL,
`date` datetime NOT NULL,
`descr` text default NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1

(Anyway, Etogal snippet should automatically create this table for you)

I'm not the expert on this forum but I'm Etomite Forum addicted :-)

Edited by Oppdragnemo, 27 May 2007 - 05:04 PM.


#4 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 10 June 2007 - 01:30 PM

On the subject of where clauses, can anyone see a reason why a where clause asking for a number would work, but asking for text will not?

?where_clause=STATUS = 'NFS' (this query was performed in phpMyAdmin and copied and pasted into a snippet call, so I KNOW the database accepts it and returns results), however...

Quote

Etomite encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed »
SQL: SELECT * FROM `database_etomite`.etomite_etogal WHERE STATUS = ORDER BY id ASC LIMIT 20;
Notice the 'NFS' is missing. if I add another parameter to the end of the call, like this...
?where_clause=STATUS = 'NFS'&maxOnPage=6
the error changes to...

Quote

Etomite encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed »
SQL: SELECT * FROM `database_etomite`.etomite_etogal WHERE STATUS = 'NFS' ORDER BY id ASC LIMIT 99999;

The 'NFS' is back in the query, but still not passable as a parameter (even though it exists in the column).

?where_clause=gal_id=80 OR e_gals=60
works fine.

#5 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 10 June 2007 - 02:14 PM

have you got a column called STATUS in the etogal table?
is STATUS a MySQL reserved word?

#6 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 10 June 2007 - 03:12 PM

View PostCris D., on Jun 10 2007, 09:30 AM, said:

On the subject of where clauses, can anyone see a reason why a where clause asking for a number would work, but asking for text will not?

?where_clause=STATUS = 'NFS' (this query was performed in phpMyAdmin and copied and pasted into a snippet call, so I KNOW the database accepts it and returns results), however...
<<< SNIP >>>
You are getting confused by the differences in how parameters are passed in different situations... While you can pass something like column='value' or `column`='value' in phpMyAdmin and have it work, passing ?column='value' in a snippet call or as a $_GET() argument are both incorrect... You do not pass values in quotes, neither single or double, when passing snippet parameters or in a URL... Because PHP uses automatic type conversion there is no need to pass values in quotes in either of these instances... Using quotes will only create problems, as you have already discovered... Using ?key=value works whether you are saying ?key1=6&key2=99 or ?key1=testing&key2=123...

#7 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 11 June 2007 - 01:18 AM

@Mike: Yeah, my etogal table has grown to 24 cols now (almost a picture shopping cart) lol

I changed the colname from status to ostatus...

Quote

Etomite encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed »
SQL: SELECT * FROM `database_etomite`.etomite_etogal WHERE ostatus=NFS ORDER BY id ASC LIMIT 99999;

@Ralph: I started as you suggested above, and tried different options from there. The error above was from the call...

Quote

etogal_multigals3?where_clause=ostatus=NFS
No quotes, plain text.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users