Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support You have an error in your SQL syntax - Multiple categories
Cadettim
Posted on 02 Sep 2009, 03:54:17

Access: Member
Total Posts: 2
Joined: 2009-09-02

First off, I would just like to say thank you very much for this amazing script. I hope you get as many thank you's as you deserve, this is truley a real help. I don't know what I would do without it.

However, I'm experiencing an error.

Code:
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 'catid = '1' OR catid = '2'' at line 1

Now I have 3 different categories set to show up at 3 different places on a single page, as such:

Code:
<div class="head_red">
<span>NEXT WEEK</span>
</div>
<p class="last">
<?php
$template = 'plain'; $cat[] = 'nextweek'; include 'news/index.php';
?>
</p><br/>
<p><a href="cadets.html"><img src="images/attendance1.jpg" border="0"></a></p>
<div class="head_blue">
<span>LATEST NEWS</span>
</div>
<P><?php
$template = 'plain'; $cat[] = 'frontnews'; include 'news/index.php';
?> </P>
<div class="head_red">
<span>UPCOMING EVENTS</span>
</div>
<P><?php
$template = 'plain'; $cat[] = 'frontupcoming'; include 'news/index.php';
?> </P>
</div>

Now whats happening is that it's correctly showing the "Next week" category, however it doesn't show the other two and gives the error I said above right under the latest news. I did some research so before you ask, I do have news in all 3 categories.

Any help is appreciated, thank you so much.

Tim

edit: multiple includes
#831
Last edited by Chris at 2009-09-02 05:55:08 Reason:
Chris
Posted on 02 Sep 2009, 03:58:54

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

I can tell you straight away the problem is that you're including the script multiple times within the same page, it was never designed to do this unfortunately.

but! I'll make a couple of changes then post it here, basically it would allow you to have the multiple includes on the one page, but if you wanted to view comments for a particular post you'd either have to show the comments on a different page or have only 1 of your includes do that. Sounds confusing but I'll explain once I've made the changes.
#832
Chris
Posted on 02 Sep 2009, 04:13:54

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Download this file, extract and replace your own copy of index.php with this new one.

Hopefully now the multiple includes should work fine.
#833
Cadettim
Posted on 02 Sep 2009, 04:19:05

Access: Member
Total Posts: 2
Joined: 2009-09-02

It worked! This is amazing Chris!

Oh and we wont be using the comment feature on this page, it's kind of like a splash page.

Thank you so much Chris, you should put this on the downloads section, it could prove useful for others. Once I get my next paycheck you can expect a token of my gratitude!

-Tim
#834
Chris
Posted on 02 Sep 2009, 04:20:35

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Much appreciated, I'll edit your first post and add "multiple includes" so it's easier to find by searching.
#835
Last edited by Chris at 2009-09-02 04:21:15 Reason:
Angel
Posted on 12 Feb 2010, 17:57:20

Access: Member
Total Posts: 9
Joined: 2010-02-01

It works in 3.4, I could not install it
#1853
Network-13.com © 2013