ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


There are no languages installed And mysqlfetchassoc warnings


  • 2010-11-24 11:25:57

    There are no languages installed And mysqlfetchassoc warnings

    I was getting multiple warnings (Warning: mysql_fetch_assoc()...) and ending with "There are no languages installed!". When I looked through the forums, the only solutions I found were to "reinstall", or related to installing a new language file.

    The problem in my case was different, and I thought that perhaps other people have had the same problem. My development machine is a Windows XP PC running XAMPP. The remote PC is a Linux machine running Apache.

    I made a complete back-up of the working files and database and put them onto the remote site, and got the problems mentioned above.

    My problem ended up being the TABLE_PREFIX setting in the conf file. It defaults to "AT_", but some databases are case sensitive while others aren't. So, the tables that were created were "at_users", etc but on the Linux PC it was looking for "AT_users".

    By changing the TABLE_PREFIX to "at_" it worked... so can I ask that a convention of lower-case names be used for tables and fields?

    As an added note, I think it would be better if there were better error handling on the core queries as some of those warnings could have been suppressed, while others indicate a more serious config problem and should, in my opinion, gracefully exit the application.

  • 2010-11-24 13:53:10

    Re: There are no languages installed! And mysql_fetch_assoc() warnings....

    Its unlikely we'd change the prefix convention. It has been that way since the beginning, without any issues. It is windows really that does not distinguish case. You can always change the prefix during an install.

    Error messages are controlled in the php.ini file, if you want to suppress warnings.

  • 2010-11-24 15:09:09

    Re: There are no languages installed! And mysql_fetch_assoc() warnings....

    Yes, I understand that it would be tricky to change it at this stage.

    It was mainly a "fyi"... I'd argue it is likely that I'm not the only person that has moved atutor between Windows and Linux (a lot of people develop in Windows and use Linux-based hosting), and possible that they have had similar problems. Checking your forums, I thought that one or two people had been asking something that may have related to this issue, so I thought I'd share what I'd found.

    I also don't think it's a good idea to suppress warnings during development. They usually have a purpose, and MySQL related ones point to something that can (often should) be handled - in this case, that the database had connected but the sql failed because of the table names and how the database was created (and on the assumption that $result contains a valid handle).

    Anyway, I hope come across as constructive rather than critical in my comments!

  • 2010-11-24 16:47:03

    Re: There are no languages installed! And mysql_fetch_assoc() warnings....

    thx Alex. I'll will think about adding another case to handle table prefix mismatches.