(Q) I have a web page that contains forms, and I want to be able to use the information that the user insert in these forms (after submitting) in order to run a SQL query and search the databese using php and show the results.

I successfully made a page that gets information from the user and insert these information to a table in the database, I think what I've explained in (Q) above should be similar to inserting but I'm stuck.

Heres the code that I wrote for inserting, it works, can You show me please how can I search the database?

```
<html>
<body>
<?php
    // Connecting to the database
$con = @mysql_connect('localhost','XXXXXXX','YYYYYYYY');
if (!$con) die("Could not connect to the server!");
if (!@mysql_select_db('XXXXXXXX')) die('Couldn\'t locate the database!');
// If form has been submitted - take action
if (isset($_POST["submit"]))
{
    // Inserting data to Branch
    $sql = "INSERT INTO Branch(branchName,address,size)
            VALUES('".$_POST["BRANCHNAME"]."','".$_POST["ADDRESS"]."',".$_POST["SIZE"].");";
    $result = mysql_query($sql);
    // In case of failure
    if (!$result) {
        die("Couldn't add the part to the catalog.<br>".mysql_error());
    }

    // Inserting data to Customer
    $sql = "INSERT INTO Customer(memberNum,telephoneNum,firstName,lastName,birthDate,branchName)
            VALUES(".$_POST["MEMBERNUM"].",'".$_POST["TELEPHONENUM"]."','".$_POST["FIRSTNAME"]."','".$_POST["LASTNAME"]."','".$_POST["BIRTHDATE"]."','".$_POST["BRANCHNAME"]."');";
    $result = mysql_query($sql);
    // In case of failure
    if (!$result) {
        die("Couldn't add the customer specified.<br>".mysql_error());
    }

    // In case of success
    echo "<b>The details have been added to the database.</b><br><br>";

}?>

<form action="<?php $_SERVER['PHP_SELF'] ?>" method="POST">
    <table border="0" cellpadding="9">
    <tr>
        <td>Member number</td>
        <td><input name="MEMBERNUM" type="text" size="10"></td>
    </tr>
    <tr>
        <td>Telephone number</td>
        <td><input name="TELEPHONENUM" type="text" size="20"></td>
    </tr>
    <tr>
        <td>First name</td>
        <td><input name="FIRSTNAME" type="text" size="10"></td>
    </tr>
    <tr>
        <td>Last name</td>
        <td><input name="LASTNAME" type="text" size="10"></td>
    </tr>
    <tr>
        <td>Birth date</td>
        <td><input name="BIRTHDATE" type="text" size="10"></td>
    </tr>
    <tr>
        <td>Branch name</td>
        <td><input name="BRANCHNAME" type="text" size="10"></td>
    </tr>
    <tr>
        <td>Address</td>
        <td><input name="ADDRESS" type="text" size="10"></td>
    </tr>
    <tr>
        <td>Size</td>
        <td><input name="SIZE" type="text" size="10"></td>
    </tr>
    <tr>
        <td colspan="2"><br><input name="submit" type="submit" value="Send"></td>
    </tr>

    </table>
</form>

<?php
    // Closing the connection
    mysql_close($con);
?>

```