Sunday 30 March 2008

inserting text into a database in php

I am using addslashes() and stripslases() to keep the dirty data out and stop the php from erroring out

Wednesday 26 March 2008

foreign keys on a compound primary key

Here is the MYSQL command to create a compound primary key from two foreign keys:

create table loc_title(lid int(11) not null, tid mediumint(9), tag text, FOREIGN KEY(lid) REFERENCES location(lid) ON DELETE CASCADE, FOREIGN KEY(tid) REFERENCES title(tid) ON DELETE CASCADE, PRIMARY KEY(lid,tid));

Thursday 13 March 2008

safari javascript bug work around - selectbox.options.add

I found a work around for the old safari bug selectbox.options.add when I replaced it with this: selectbox.options[selectbox.options.length] = new Option(optn.text,optn.value);