switch statement can be extremely useful in complex situations.
switch($variable)
{
case "a":
// run the code if $variable = a .
break;
case "b":
// run the code if $variable = b .
break;
case "c":
// run the code if $variable = c .
break;
default:
// run the code if $variable is not equal to either a,b or c
}
Being a complete non programmer, i thought it would be a good idea to help others like me who have no programming knowledge but want to develop web based applications. Additionally i wanted to be able to access all these for my own repetitive use.
Monday, July 9, 2012
Monday, February 27, 2012
check existing mysql triggers
SELECT * FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA= 'database_name';
OR
SHOW TRIGGERS;
OR
SHOW TRIGGERS;
create mysql triggers
table names
testing.name
testing_T.fullname
CREATE TRIGGER addnm AFTER INSERT ON testing
FOR EACH ROW BEGIN
INSERT INTO testing_T SET fullname = NEW.name;
END;
delimiter |
Monday, February 6, 2012
find duplicate rows in a mysql table
example field = reference
example table = outstandings
" select reference from outstandings group by reference having count(*)>=2 "
example table = outstandings
" select reference from outstandings group by reference having count(*)>=2 "
Subscribe to:
Posts (Atom)