Home Sql Sqldate PHP WHERE clause example to fetch records from Database Table

Related Tutorials


 
 

Share on Google+Share on Google+

PHP WHERE clause example to fetch records from Database Table

Advertisement
PHP MYSQL Where clause example to fetch the records from the database table. PHP MYSQL WHERE clause can be used for any purpose ADD, EDIT, DELETE or Fetch records according to specified conditions. Go through the PHP MYSQL WHERE clause example that fetches records from the table employee.

You can query a MYSQL database based on multiple conditions. PHP & MYSQL Database offer various clauses to handle such kind of condition and perform different actions in MYSQL Database Tables. PHP WHERE Clause is one of them. We can use the WHERE clause in PHP & MYSQL to  add, edit or delete the data within the MYSQL database table. You can also fetch the results using the WHERE Clause in PHP.

Here is an example of how you can write the WHERE Clause query in PHP MYSQL example.

PHP MYSQL WHERE Clause Syntax

select * from employee1 where date = '2013-12-20';

This query will run on the MYSQL Server and will fetch the results from the database table employee date is equal to December 20, 2013.

The output of the Where Clause will look like this.

+-------+---------+------------+
| Empid | Empname | date |
+-------+---------+------------+
| 1 | Manish | 2013-12-20 |
| 4 | Gopal | 2013-12-20 |
+-------+---------+------------+
2 rows in set (0.00 sec)

To test the code we are using existing database table. You can create your own.

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 13, 2013

Related Tutorials

Discuss: PHP WHERE clause example to fetch records from Database Table  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com