mysql -u user -p -h localhost data-base-name < data.sql

 


We can view the single procedure using the command SHOW CREATE PROCEDURE proc_name;
To delete the procedure - DROP PROCEDURE proc_name;
To view all the procedures - SHOW PROCEDURE STATUS;

 


We can change the field attribute by using ALTER AND CHANGE keywords.
Ex:

ALTER TABLE table_name CHANGE old_feild new_field datatype AUTO_INCREMENT;

 


We can change the size and font of TEXTAREA or any element using the id of the element
Ex:

textarea cols="20" rows="10" id="txtarea"
input name="button" value="ChangeFont" onclick="changeFont()" type="button"

function changeFont() {
document.getElementById('txtarea').style.fontWeight = 'bold';
document.getElementById('txtarea').style.fontFamily = 'arial';
document.getElementById('txtarea').style.fontStyle = 'italic';
document.getElementById('txtarea').style.fontSize = '14px';
document.getElementById('txtarea').style.color = 'red';
}

 

MYSQL STORED PROCEDURE

By Webdevelopmentlogics


By creating SP for application, we can create our logic seperate from the application. The main advantage for using this is we can reuse the code for differenct languages with ease.
Ex:
CREATE PROCEDURE `sp_user`(
id int,
name varchar(64),
type_id int,
OUT out_status varchar(10)
)
MODIFIES SQL DATA
BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION,SQLWARNING,NOT FOUND
SET out_status = 'error';
IF id > 0 THEN
//Call the update query
ELSE
// Call the insert query
END IF;
SELECT out_status;
END;
You can call the procedures using the command : CALL `sp_user`(0,'user1','1',@out_status)

 


If you couldn't send mail from window server, please set the default confuguration for Windows in your code.
Ex:
ini_set("sendmail_from", "user_name@domain_name");
ini_set("SMTP","localhost");
ini_set("smtp_port","25");