<input type="text" onblur="this.value=this.value.toUpperCase()" name="" placeholder="all of this will be uppercase" />
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.
Sunday, June 30, 2013
how to change all to UPPERCASE in an input box
for a text box, here's the code.
Wednesday, May 22, 2013
How to update mysql table ignoring the duplicate fields that are already present
here's how you do it.
INSERT INTO thetable (pageid, name, somefield)
VALUES (1, "foo", "first")
ON DUPLICATE KEY UPDATE (somefield = 'first')
taken fromUpdate one Mysql table with results from another table on a different database
here's how you update one table with results from another database query.
UPDATE
target_database.target_table A //database to be updated-target
INNER JOIN source_database.source_table B //join source database to target
ON B.ProductID = A.ProductID //join fields
SET A.Markup = B.Markup //fields to be updated
UPDATE
target_database.target_table A //database to be updated-target
INNER JOIN source_database.source_table B //join source database to target
ON B.ProductID = A.ProductID //join fields
SET A.Markup = B.Markup //fields to be updated
Sunday, April 28, 2013
how to find duplicates in two columns of mysql database table
any one column can have duplicates. but both columns together are unique. this is how you find duplicates
select columnA,
columnB,
count(*)
from table_name
group by columnA,
columnB
having count(*) > 1
Monday, January 7, 2013
how to get the no of days in the current month in php
this function will get the days in the current month
date('t');
Monday, July 9, 2012
how to use the switch statement in php
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
}
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
}
Monday, February 27, 2012
check existing mysql triggers
SELECT * FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA= 'database_name';
OR
SHOW TRIGGERS;
OR
SHOW TRIGGERS;
Subscribe to:
Posts (Atom)