- Stored Procedure can return zero or n values whereas function can return one value which is mandatory.
- Functions can be called from procedure whereas procedures cannot be called from function.
- Procedures can have input/output parameters for it whereas functions can have only input parameters.
- Procedure allows select as well as DML statement in it whereas function allows only select statement in it.
- Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
- We can go for transaction management in procedure whereas we can't go in function.
- Procedures can not be utilized in a select statement whereas function can be embedded in a select statement.
We are Web Technology Experts Team who provide you Important information on Web Development, Interview Questions and Answers, live project problem and their solution and online free tutorials.
Monday, 1 June 2015
Differences between Stored Procedures and Functions in MYSQL
Sunday, 31 May 2015
Wordpress insert record into table and get last insert Id
In Wordpress, Record insertion into table is quite simple.
1. Create an Object of $wpdb;
2. Set the data in an Array.
3. Set the table name.
4. Use insert function to insert record.
5. In insert function, first argument is table name and Second argument is array.
See Example Below:
global $wpdb;
$tableName = $wpdb->prefix . "users";
$saveFieldArray=array(
'user_login' => 'mylogin',
'user_pass'=>'pass',
'user_nicename' => 'Poonam',
'user_email' => 'email@no-spam.com',
'user_registered' => date('Y-m-d H:i:s',time()),
'user_status' => '1',
'display_name' => 'Arun Kumar');
//Insert Into Database
$wpdb->insert( $tableName, $saveFieldArray);
//get the last inert Id
$lastInsertId = $wpdb->insert_id;
Best Related Posts are Following:
- Wordpress Interview Questions and Answers for experienced
- How do I get wordpress global variable and functions in custom file [SOLVED]
- How to send Email in wordpress
- How to change the author of a post in Wordpress
- How can delete a user without deleting the post and comments in wordpress?
- Wordpress redirect https to http with htaccess [SOLVED]
- Wordpress Website title repeated two times in browser header [SOLVED]
- Wordpress Interview Questions and Answers
Subscribe to:
Comments
(
Atom
)

