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

First of all I'm new to php n' mySql . So I just can't figure out what's the wrong in my code. I'm using WAMP and I've created a db named "Try" and in that there is a table named "test". this is my php code and it dosen't give me a

First i created the log in page now i want to connect to the database from where username and password table is save.How i create the php codes to give relation between them?

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

Welcome by regersteration form First name: last name:

What is the correct way to connect to a MySQL database?



Custom Search