Skip to main content.

2002-Feb-20

More MySQL learning. (Also see 31/Jan/2002 above.) You can find out the structure (and columns) of a table ("user" in this example) with:

DESCRIBE user ;
I could retrieve information from a table by searching using pattern matching with "LIKE". A "_" (underscore) matches a single letter and "%" percent matches zero or multiple characters. The pattern must match exactly, so the following email must start with "sherwood":
select * from tbl_coding_forum where email like "sherwood%" ;
(If you want to match any "sherwood" then use "%sherwood%".)

Then I could use this info (like a user_id) to look at another table:

select * from user where user_id = 124666 ;

Later, I made a change with:

UPDATE tbl_coding_forum SET email_reply="" WHERE  email like "%susan.com%" ;

For some reason pkgsrc for mplayer, ogle, and libdvdread weren't retrieved. The CVS log said "Updating" for these. (Hubert's bulk-builds pkgstat said both of these were broken for 1.5.3_ALPHA/i386, and the csvweb showed they still exist.) So I tried again:

time cvs update -d -P 2>&1 | tee LOG ; date

During the cvs update, netscape became unusable again; my X was unusable and I would have to wait minutes between mouse moves. Finally, after about ten minutes, I was able to close the problem netscape window. Right after:

$ scripts/free.sh
total       used       free    buffers
Mem:        126096      41908      84188          0
Swap:       197564     156676      40888