Welcome, Guest. Please login or register.

Author Topic: Deleting events  (Read 6157 times)

genji0714

  • Guest
Deleting events
« on: January 22, 2009, 02:09:55 PM »
Hi all,
   
         Every time I try to delete events, this error msg is coming up, "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 '10' at line 1". Please help! I have so many old messages I want to clear out.

mysql  Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2
ubuntu 8.04
Linux NeDi 2.6.24-19-server

Thanks for your help in advance!

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2780
    • View Profile
    • NeDi
Re: Deleting events
« Reply #1 on: January 24, 2009, 05:43:13 PM »
Can you share the query with us? If it's not printed already add a line echo $query after it's generated in the PHP page...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

ralto

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Deleting events
« Reply #2 on: March 11, 2009, 09:35:51 AM »
Hi,

i got the same notice, if i want to delete events.

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 '10' at line 1

would you please be so kind to explain a littel bit more, where to place "echo $query".

THX

gumba

  • Guest
Re: Deleting events
« Reply #3 on: March 11, 2009, 10:48:11 AM »
What do you mean with "events"? Didn't found any events in my NeDi (blindness??? ::))

ralto

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Deleting events
« Reply #4 on: March 11, 2009, 01:59:17 PM »
The events i talk about are found under "Monitoring"->"Messages"

gumba

  • Guest
Re: Deleting events
« Reply #5 on: March 12, 2009, 07:42:09 AM »
Ah ok, I see. Thanks for clarification :D So what rickly meant is go into the php file (Monitoring-Messages.php in nedi's html directory) and find the line where the DB query for deleting entries is constructed. In my version of NeDi, its in line 60, the line is like
Code: [Select]
$query  = GenQuery('messages','d','*','id desc',$lim,$in,$op,$st,$co );

If you've found this line, just insert
Code: [Select]
echo $query;
immediately after it. When you now try to delete an event, the query used by NeDi to delete it is printed on screen, so you can share it with us ;)

ralto

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Deleting events
« Reply #6 on: May 04, 2009, 03:20:36 PM »
Hi and sorry for the late answer!

the output is: DELETE FROM messages LIMIT 0,10

and i thought the bottom msg would also be helpful:
10 messages with SELECT * FROM messages ORDER BY id desc LIMIT 0,10

If i change the value (number of messeges) the output messages are still the same.

Grüsse/Cheers
ralto

gumba

  • Guest
Re: Deleting events
« Reply #7 on: May 13, 2009, 03:09:00 PM »
the output is: DELETE FROM messages LIMIT 0,10

This seems to be wrong. As far as I know, there is no offset to the LIMIT clause in a DELETE statement. The LIMIT offset only exists for SELECT. So the DELETE query should instead be
Code: [Select]
DELETE FROM messages LIMIT 10

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2780
    • View Profile
    • NeDi
Re: Deleting events
« Reply #8 on: May 13, 2009, 03:39:57 PM »
That's right, but I get ...LIMIT 10 on here  ???
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

gumba

  • Guest
Re: Deleting events
« Reply #9 on: May 13, 2009, 03:47:16 PM »
That's right, but I get ...LIMIT 10 on here  ???

Your right, it really seems to be LIMIT 10 on both NeDi 1.0.4 and NeDi 1.0.
So genji0714, what's your NeDi version and how did you install it?
You may also post line 60 (I hope) from your html/Monitoring-Messages.html (this line should begin with "$query = GenQuery(...")