[EventCalendar] Event Editor not saving date

Lisa C. Boyd lisab at lisaboyd.com
Wed Oct 15 21:30:56 UTC 2008


Alex Tingle wrote:
> [Short version: I bet your DB user doesn't have INSERT privs to the
> ec3_schedule table.]
>   
I'm checking into how MU sets up it's users and databases. This 
installation of MU is accessing several different databases and I'm not 
exactly sure how that madness is working yet.
> Failing that, if you are happy to mess abiout with the code, then try changing
> the code I quoted above to...
>
>       elseif($action=='create'):
>         var_dump($vals);
>         $wpdb->show_errors();
>         $result = $wpdb->query(
>          "INSERT $ec3->schedule
>           (post_id, ".implode(', ',array_keys($vals)).")
>           VALUES ($post_ID,".implode(', ',array_values($vals)).")"
>         );
>         var_dump($result);
>         exit(0);
>       endif;
>
> (THIS WILL OBVIOUSLY BREAK YOUR WORDPRESS - so save the file first and put it
> back when you've finished.)
>   
I did this and put it back the way it was. Here's the message I got when 
trying to edit the post:

array(3) { ["allday"]=>  int(1) ["start"]=>  string(18) "'2008-10-18 
18:00'" ["end"]=>  string(18) "'2008-10-18 18:00'" } bool(false)
> ...I really think it should be "INSERT INTO $ec3->schedule". However, I've
> read the PHP manual, and it doesn't seem to mind the missing INTO - however
> strictly you tell it to check the SQL.
>   
I added the INTO and it worked! I'm so doing a happy dance right now :D 
So for whatever reason, even if it shouldn't have mattered, that was the 
problem! And just FYI, the versions of MySQL is 4.1.22.

Thanks so much for your patience and help with this :) Perhaps someone 
will need to add INTO for all the INSERT commands? for future releases.

Lisa B.



More information about the EventCalendar mailing list