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
Welcome Anonymous
Membership:
Latest: Witewolf
New Today: 0
New Yesterday: 0
Overall: 151
People Online:
Members: 0
Visitors: 43
Bots: 3
Total: 46
Who Is Where:
Visitors: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
Mon Compte
Downloads
Support Forums
الصفحة الأولى
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 > Pro News Articles
YANDEX > My Account
Staff Online:
No staff members are online!
SQL Error
SQL Error
Posted: 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

- Posts: 492
- Joined: Aug 01, 2007
- Location: Chantilly, France
Re: SQL Error
Posted: 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

- Posts: 492
- Joined: Aug 01, 2007
- Location: Chantilly, France
Re: SQL Error
Posted: 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

- Posts: 1229
- Joined: Mar 18, 2006
Re: SQL Error
Posted: 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

- Posts: 492
- Joined: Aug 01, 2007
- Location: Chantilly, France
Re: SQL Error
Posted: 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

- Posts: 1229
- Joined: Mar 18, 2006
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
All times are GMT











