Donations

Help support Pro_News and become a member of our Sponsors Group
The tip jar is at PayPal, but does not require a PayPal account
User Info
Bienvenido Anónimo
Lista de miembros:
Ultimo: Witewolf
Nuevos Hoy: 0
Nuevos Ayer: 0
Total: 151
Gente en línea:
Miembros: 0
Visitantes: 42
Bots: 3
Total: 45
Donde estan todos:
Visitantes:Support Forums
Support Forums
Pro News Articles
Pro News Articles
Support Forums
Support Forums
Downloads
Support Forums
Support Forums
Support Forums
Support Forums
Support Forums
Support Forums
Downloads
Support Forums
Téléchargement
Pro News Articles
Nedlastninger
Support Forums
My Account
Pro News Articles
Téléchargement
Support Forums
Support Forums
Pro News Articles
Support Forums
Pro News Articles
Downloads
Hjem
Pro News Articles
Downloads
Pro News Articles
Downloads
Downloads
Support Forums
Support Forums
Nedlastninger
Home
Support Forums
Pro News Articles
Téléchargement
Support Forums
Bots:Google > Pro News Articles
Baidu > Support Forums
YANDEX > My Account
Administradores conectados:
No hay Administradores conectados!
SQL Error
SQL Error
Publicado: Tue Sep 14, 2010 11:54 am
Bizzarely, now I have added a few more sections I am getting an SQL error on my home page:
On /~mouygite/dragonfly/index.php
While executing query "SELECT a.id aid, a.* FROM cms_pronews_articles as a JOIN cms_pronews_cats as c ON a.catid=c.id WHERE a.catid= AND a.approved="1" AND a.active="1" AND display<>"0" AND (alanguage='english' OR alanguage='') ORDER BY display_order DESC, posttime DESC LIMIT 5"
the following error occured: 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 'AND a.approved="1" AND a.active="1" AND display<>"0" AND (alanguage='english' OR' at line 1
In: /home/mouygite/public_html/dragonfly/modules/Pro_News/functions.php on line: 2022
Interestingly enough when I look at the SQL queries on the page it shows the a.catid as being set?
0.0001 - LINE 2022: SELECT a.id aid, a.* FROM cms_pronews_articles as a JOIN cms_pronews_cats as c ON a.catid=c.id WHERE a.catid=3 AND a.approved="1" AND a.active="1" AND display<>"0" AND (alanguage='english' OR alanguage='') ORDER BY display_order DESC, posttime DESC LIMIT 5
rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.11/4.1.22/5.2.17/9.3.3.1

rosbif- BetaTester

- Mensajes: 492
- Registrado: Aug 01, 2007
- Ubicación: Chantilly, France
Re: SQL Error
Publicado: Tue Sep 14, 2010 12:16 pm
Now I've added some categories to the sections that error has gone away. Is that normal?
rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.11/4.1.22/5.2.17/9.3.3.1

rosbif- BetaTester

- Mensajes: 492
- Registrado: Aug 01, 2007
- Ubicación: Chantilly, France
Re: SQL Error
Publicado: Tue Sep 14, 2010 1:40 pm
If you can easily repeat - say by adding a new Section without a Category - and do whatever you were doing to trigger the error, can you test if this fixes it please?
Around line 1945 look for:
if ($pnsettings['display_by'] == '2') {
$sql .= ' LEFT JOIN '.$prefix.'_pronews_cats as c ON c.sid=s.id AND secdsplyby<>"1"';
} else {
$sql .= ' LEFT JOIN '.$prefix.'_pronews_cats as c ON c.sid=s.id AND secdsplyby="2"';
}
and then remove the 2 words LEFT.
I think I'm returning Sections without Categories and thus getting errors when the newer display modes (List by Section/Category/Articles) does a selection based on Category value. Hopefully this will just ignore them.
TIA.
layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback- Site Admin

- Mensajes: 1229
- Registrado: Mar 18, 2006
Re: SQL Error
Publicado: Tue Sep 14, 2010 2:19 pm
Will do - may not be for a day or two as real work intervenes again!
rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.11/4.1.22/5.2.17/9.3.3.1

rosbif- BetaTester

- Mensajes: 492
- Registrado: Aug 01, 2007
- Ubicación: Chantilly, France
Re: SQL Error
Publicado: Tue Sep 14, 2010 2:44 pm
S'Ok, I managed to reproduce, and fix works ok, and doesn't appear to have any unwanted effects, so moving to release.
layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback- Site Admin

- Mensajes: 1229
- Registrado: Mar 18, 2006
No puede responder a temas en este foro
No puede editar sus mensajes en este foro
No puede borrar sus mensajes en este foro
No puede votar en encuestas en este foro
You cannot attach files in this forum
Tu no puedes descargar archivos en este foro
Todas las horas son GMT











