Simple Invoices logo
    • CommentAuthorDavy
    • CommentTimeSep 19th 2007 edited
     permalink
    Hello everybody,

    I have a problem. I installed Simple Invoices. Everything is working fine, except for the fact that I cannot modify any data.
    I can see the testproducts, invoices etc. , but it doesn't write anything to the database when I change or add something.

    The error is : Something went wrong, try saving again


    This is my setup :
    XP prof
    Apache 2.2.4
    Mysql 5
    PHP 5


    I have a (working) drupal site. I made a subdirectory in that site called extra/simpleinvoices

    Is it maybe a conflict with drupal ? (modrewrite, htaccess ???)

    phpMyAdmin is also under the extra directory ( extra/phpMyAdmin) and works just fine.

    Any help is greatly appreciated !

    Davy

    PS: tried it without the extra subdir ( simpleinvoices directory in root ) and that didn't solve the problem
    Yes I have all the privileges in mysql to modify the invoices DB
    • CommentAuthorDavy
    • CommentTimeSep 19th 2007 edited
     permalink
    Also running the sql "CREATE TABLE si_users ..." in login.php doesn't work.
    MySQL doesn't seem to take the empty values in the "insert into" for the auto_increment field user_id.
    I changed the empty field ' ' to '1' etc. for the user_id. Then it took the sql statements.
    Is that where my problem lies in my previous post ?
    All help is welcome
    • CommentAuthorDavy
    • CommentTimeSep 19th 2007 edited
     permalink
    Nevermind, I found the problem !!!

    I'm using MySQL 5

    And here's the problem :

    the error occurs when using quotes with empty string to let the autoincrement value do its job :

    INSERT INTO si_users (user_id, user_email, .... ) VALUES ('','guest@,. ....

    and user_id is an autoincrement integer

    replacing '' with NULL would be the best option ( for the future )

    so, you'll you have to change all the SQL code ( !!!! ) OR try this :

    change the following line in your mysql my.ini file :

    sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

    to

    sql-mode=''

    that's an empty string and makes mysql operate in traditional MySQL-mode

    or just escape the line with # ( that's what I did )

    restart mysql server

    Woehoe !! everything's good now.

    That was a HARD nut to crack ;)
    • CommentAuthorjustin
    • CommentTimeSep 19th 2007 edited
     permalink
    Hey Davy,

    thanks for you post - so is everything working OK now?

    re win xp /mysql
    - ive tested using WAMP5 on winxp pro and havent seen that issue
    -- note: haven't messed with my.ini on winxp

    Are you using WAMP5 or did you download mysql from mysql.com and install or other?

    Cheers

    Justin
    • CommentAuthorDavy
    • CommentTimeSep 20th 2007 edited
     permalink
    Hi,

    I installed everything from the latest available versions a couple of months ago.
    So MySQL directly from the MySQL site. Same for Apache and PHP.
    I like knowing what exactly is happening , so I edit the ini files always myself :)
    I also have a linux machine, and the problem didn't happen there( due to a lower MySQL version).
    I don't know when MySQL decided to change this default setting.
    It seems there are more "broken" PHP/MySQL packages out there. I've read the same problem happened to a commercial e-commerce package. ( don't remember what it was though )

    I know it's a lot of work, but for the future it may be necessary to change the autoincrements to NULL or just leave it out of SQL statements (that's fine to) . But not ' ' .

    Just one question : ideally I would like to put it on my live webserver so I can access my invoicing from anywhere and a backup is always up to date ( form hosting and myself). Is it safe enough to use it like that ? (I have enabled authentication.)

    And yes, everything's fine now :D


    Best Regards,
    Davy

    PS: great software !
    • CommentAuthorjustin
    • CommentTimeSep 20th 2007 edited
     permalink
    Thanks Davy

    re change '' to null
    - i'll test it out - didnt know about '' not working before
    - as you sound like you know your stuff your more than welcome to checkout svn and update all the sql statements - it shouldn't be to hard - most of them are controlled via ./include/sql_queries.php
    - thats assuming that null in an auto-increment field works fine on systems where '' currently works

    re safe enough
    - if you've enable authentication then it should be OK
    - previously there was an issue with the login system but its been fixed in the last release

    Cheers

    Justin