News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Deleting categories does not work

Started by dtdesign, September 22, 2005, 11:01:34 AM

Previous topic - Next topic

dtdesign

Hi,

I set up the new SMF 1.1 RC1 (using SMF 1.1 Beta 3 before) and I was creating categories, just to test it.

But as I tried to delete a category, it says I have an error in my sql syntax.

Error Message:
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 ')' at line 3
Datei: /srv/www/vhosts/ak-2008/public_html/forum/Sources/Subs-Boards.php
Zeile: 1190


Part of the Subs-Boards.php
<?php
// Delete ALL topics in the selected boards. (done first so topics can't be marooned.)
$request db_query("
SELECT ID_TOPIC
FROM 
{$db_prefix}topics
WHERE ID_BOARD IN (" 
implode(', '$boards_to_remove) . ')'__FILE____LINE__);
$topics = array();
while ($row mysql_fetch_assoc($request))
$topics[] = $row['ID_TOPIC'];
mysql_free_result($request);

?>


Forum: hxxp:www.ak-2008.de/forum/ [nonactive]

My PHPInfo: hxxp:www.argoedv.de/phpinfo.php [nonactive]

PS: The different domain names say nothing, I have a root Server and more than 1 Domain so I created a few VHosts :D

Best regards
dtdesign

Oldiesmann

Works fine for me... Don't know what to tell you. It doesn't seem to like the . ')' at the end. You can try changing those to double quotes, but I don't know if that will make any difference.
Michael Eshom
Christian Metal Fans

dtdesign

Trying to fix the error returns "Hacking attempt ..." all the time :D

Ok, could it be an issue with my SQL Server? I have running MySQL v3.23.49

[Unknown]

Are you trying to delete a category that has no posts in it, or posts in it?

-[Unknown]

dtdesign

#4
Empty category. No posts, no topics, no subforums.

Edit: Thanks for your idea, creating an empty forum fixes the problem. The category is now deleted :)

DrNeo

Hello folks,

I have the same error on a fresh board with an empty category. i can't delete it.

QuoteYou have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
Datei: /homepages/xx/dxxxxxx/htdocs/forum/Sources/Subs-Boards.php
Zeile: 1190

Any help would be appreciated.

DrNeo

DrNeo

Ohh,

I solved it:

You want to delete an empty category?

1. Just insert a board to this category.
2. Now delete the category, answer the question with yes!

Done!

DrNeo

Andi

Hi :)

here is the Code-Solution:

edit Sources/Subs-Boards.php

Find this 4 lines ~1154:
// Remove one or more boards.
function deleteBoards($boards_to_remove, $moveChildrenTo = null)
{
global $db_prefix, $sourcedir, $boards;


add after:
if (empty($boards_to_remove))
return true;

J. Williams

Thanks for the solution,i think smf should add that fix to the next version
Joshua Jon Williams
Back in Action.


peterstannard

Quote from: Tora on September 26, 2005, 01:35:49 PM
Hi :)

here is the Code-Solution:

edit Sources/Subs-Boards.php

Find this 4 lines ~1154:
// Remove one or more boards.
function deleteBoards($boards_to_remove, $moveChildrenTo = null)
{
global $db_prefix, $sourcedir, $boards;


add after:
if (empty($boards_to_remove))
return true;


Thanks for the fix "Tora".

No doubt this has been fixed in RC2.

Andi

QuoteNo doubt this has been fixed in RC2.

That's correct  :D  :)

Prasad007

Quote from: Tora on September 26, 2005, 01:35:49 PM
Hi :)

here is the Code-Solution:

edit Sources/Subs-Boards.php

Find this 4 lines ~1154:
// Remove one or more boards.
function deleteBoards($boards_to_remove, $moveChildrenTo = null)
{
global $db_prefix, $sourcedir, $boards;


add after:
if (empty($boards_to_remove))
return true;

Thank you.... was dying for this! :)

Advertisement: