0

i have sql database it's contain some data for clients
it's contain two table all one contain different type of clients
this is the code i uses to extract data from table

    <?php
require_once("includes/connection.php");
    require_once("includes/functions.php");

$query  = "SELECT name, id, comit FROM co_form";
$result = mysql_query($query);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "Name :{$row['name']} <br>" .
     "id : {$row['id']} <br>" .
     "comit : {$row['comit']} <br><br>";

} 
    mysql_close($connection); 

?>

the field comit divided clients to classes from 1 to 5
above code show all clients

i need to show only one class of it
i mean to show only clients with comit=1
i know it's easy but i can't doing this and I'm new in php

1
  • 1
    If you write new code, you should avoid mysql_* functions, because they're deprecated. Use mysqli or PDO instead! Commented Nov 21, 2012 at 0:10

1 Answer 1

1
$query  = "SELECT name, id, comit FROM co_form WHERE comit = 1";
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.