Representational state transfer (REST) is a software system for distributing the data to different kind of applications. The web service system produce status code response in JSON or XML format.
Sample database users table columns user_id, user_fullname, user_email, user_password and user_status.
CREATE TABLE IF NOT EXISTS `users`
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`user_fullname` varchar(25) NOT NULL,
`user_email` varchar(50) NOT NULL,
`user_password` varchar(50) NOT NULL,
`user_status` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Persistent Connections are meant to reduce the overhead of recreating connections to MySQL. When a persistent connection is created, it will stay open even after the script finishes running. Since Apache reuses it’s child processes, next time the process runs for a new script, it will reuse the same MySQL connection.
It sounds great in theory. But from my personal experience (and many others), this features turns out to be not worth the trouble. You can have serious problems with connection limits, memory issues and so on.
Apache runs extremely parallel, and creates many child processes. This is the main reason that persistent connections do not work very well in this environment. Before you consider using the mysql_pconnect() function, consult your system admin.
There are multiple benefits to using prepared statements, both for performance and security reasons.
Prepared Statements will filter the variables you bind to them by default, which is great for protecting your application against SQL injection attacks. You can of course filter your variables manually too, but those methods are more prone to human error and forgetfulness by the programmer. This is less of an issue when using some kind of framework or ORM.
Since our focus is on performance, I should also mention the benefits in that area. These benefits are more significant when the same query is being used multiple times in your application. You can assign different values to the same prepared statement, yet MySQL will only have to parse it once.
Also latest versions of MySQL transmits prepared statements in a native binary form, which are more efficient and can also help reduce network delays.
There was a time when many programmers used to avoid prepared statements on purpose, for a single important reason. They were not being cached by the MySQL query cache. But since sometime around version 5.1, query caching is supported too.
"SELECT username FROM user WHERE state=?"
"%s is from %s\n"
First of all download the PHPMailer library from this link : http://sourceforge.net/projects/phpmailer/
copy-paste the following script using your editor and save this file as “sendmail.php” and try it in your localhost server
$mail = new PHPMailer();
$mail->CharSet = "utf-8";
$mail->SMTPAuth = true;
$mail->Username = "email@example.com";
$mail->Password = "your_gmail_password";
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = "465";
$mail->setFrom('firstname.lastname@example.org', 'your name');
$mail->AddAddress('email@example.com', 'receivers name');
$mail->Subject = 'using PHPMailer';
$mail->Body = 'Hi there ,
this mail was sent using PHPMailer...
echo "Message was Successfully Send :)";
echo "Mail Error - >".$mail->ErrorInfo;
In this tutorial we are going to discuss about simple CRUD (Create , Read , Update , Delete) PHP operations , these are some of the basic things of PHP web application , Datas are insert , select update and delete using PHP and MySQL let’s have a look.
Database Design and Table which are used in this tutorial
Database name : dbtuts
Table name : users
Table Columns : first_name , last_name , user_city
Copy-Paste the following sql schema in your MySql database to create database and table.
CREATE DATABASE `dbtuts` ;
CREATE TABLE `dbtuts`.`users` (
`user_id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`first_name` VARCHAR( 25 ) NOT NULL ,
`last_name` VARCHAR( 25 ) NOT NULL ,
`user_city` VARCHAR( 45 ) NOT NULL
) ENGINE = InnoDB;
In this post I will show You how creating form with several form elements.
Begin with open Netbeans IDE and selecting from main menu File->New Project.
In New Project window in Categories section select PHP and in Projects section select PHP Application and click on Next button.
In Project Name field write MyForm. It is your project’s name. Click on Next button.
In this tutorial we will show how to create a simple Web Application using Zend Framework in Netbeans. Netbeans is one of the most popular feature rich IDE for Java based development. It also provides extensive features for Web-based Application development using PHP and PHP based framework like Zend. To prepare your IDE for developing Zend application you need to Download Zend Framework and keep it in a known place such as Documents folder for easier to find out.