PHP Questions Home
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I include a conditional in my mysql query?


You will usually need to apply some logic to the query that you apply to a table, and this is easily done with the WHERE keyword.

This will be followed by a fieldname, or list of them, and then the condition you want to be met.

Thus if you want to select only rows from a table WHERE the user is called Quentin you would do the follow:

<?php
$peeps 
mysql_query("SELECT * FROM users WHERE firstname = 'Quentin'");
?>



ASK A QUESTION

More mysql PHP Questions

How do i list a record in front that is recently added to the table?

the uploading status shows success but not showing in the server is empty the written php file is first gave warning cannot uploaded warning in foreach loop but i corrected mistake by keeping above if condition and no error status shows success upload b

how to write sessions in php code?

How do I access the current time with mysql?

My website www.quicheandpie.com has navigation buttons which were added by going to admin/categorylist and adding a category. I can add category = navigation buttons and update them, but I can not delete them. Any ideas how I can find where the info



Custom Search