The dangers of using MYSQL commands? Ignored? Worse? Cache?

Re: The dangers of using MYSQL commands? Ignored? Worse? Cache?

by Timothy Takemoto -
Number of replies: 4

Dear Thomas and Eloy

Thank you very much for your advice. I had not noticed that there was a place to set the role of the teachers - all is now well.

I think that changed the role by mistake when fiddling with the database. That is one of the dangers of changing the database directly, it is easy to change the wrong cell.

Thanks also Thomas for the extra SQL command, "WHERE" - now that is a useful command. SQL is more intelligent than I hoped.  I have been wondering what I should do about courses that start on different days, e.g. two days later. I think that the following should do the trick

UPDATE moodle_quiz SET timeopen = timeopen+2880, timeclose = timeclose+2880 WHERE course = 5

Thanks to Thomas Robb's tip and the MYSQL manual
http://mysql.cbn.net.id/doc/mysql/en/UPDATE.html

The above command should (I have not tested it yet, scary) make all quizes on course 5 start and stop two days later?

In spite of the dangers, I am getting excited about MYSQL and phpmysqladmin, the guru's way of controlling a moodle? While dangerous, I think that a knowledge of SQL could save hours for Moodle adminstrators.

Are all you Moodle Gurus out there using SQL commands regularly?

Tim
Takemoto

In reply to Timothy Takemoto

The excitement of using SQL commands directly

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Every time you click a button in the Moodle GUI you are issuing a pile of SQL commands to the database. So everyone is, yes. wink And yes, I often go straight to MySQL Admin to do things that there isn't yet a GUI for, or to patch things together.

By the way, this might be a nice time to mention the updated MySQL Admin for Moodle 1.4 which has a lot of nice improvements.
In reply to Martin Dougiamas

Re: The excitement of using SQL commands directly

by Herbert Keijers -
Yes,
the new MySQL Admin looks quite nice.
You can even make/choose your own theme, independent from your Moodle theme !
Is there a reason why logo_right.png and logo_left.png are left out of the Moodle theme ?


Attachment phpmyadmin.png
In reply to Herbert Keijers

Re: The excitement of using SQL commands directly

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Because I found them too distracting ..

A hidden feature: If you have MySQL 4.1 or later then there are all sorts of cool features for relational linking between tables (you can click on data in one table and hyperlink straight to the other table). My Moodle-packaged version will install the extra tables you need for this automatically (the normal PhpMyAdmin doesn't).  I haven't gone though and pre-defined all the links yet, though, I need to do that sometime.
In reply to Martin Dougiamas

Re: The excitement of using SQL commands directly

by Herbert Keijers -
Well, I tried to install mysql-server-4.1.0_1 from the port system FreeBSD 5.2.1 (testing machine) but that didn't go smootly ...
So I had to reverse back to 4.0.16, maybe I will give it another try ...
Thanks for your info.