Here’s something that saves me time when I’m starting a new database and still testing PHP scripts which input to the database. I want to clear the database of all information, but don’t want to have to recreate the database structure. I just want a bare bones database with no content, so I can see exactly what information is going in and what information is getting messed up along the way.
I’m working in terminal. I write a series of commands to delete the contents of the tables I want cleared. Instead of pressing return each time, I separate them with a semicolon. Here’s an example:
delete from authors;delete from reports;delete from paper_authors; delete from journals;
This deletes all information from the four tables: authors, reports, paper_authors and journals.
Now I highlight the line, right up to the last semicolon, and drag it to the desktop to make a clipping. Next time I want to clear my db, I drag the clipping from the desktop onto the terminal window and press enter. Automagic.
You can do this with any command you want too, from ftp open commands to long folder names. Drag any folder onto the terminal window and the path shows up, saving lots of stubby fingers.
And for an extra bit of magic, look what happens when you drag a folder on a BBEdit or Textedit window. Useful for folders of mp3s.