Hi there,
I have a form with some fields. Address is one of them. I used textarea tag for address. Now the problem is, when i search something according to one address, it only works for the one line addresses. I mean if i entered a newline (Paragraph format) in my address it doesn't show the result. All other search query working very well.Here is my codes,

Code for drop-down list of address :

    `<input type="hidden" name="category_address" value="address"/>
    <select name='criteria_address' style="width:100px;">
        <option selected="selected"> </option>
    <?php
        $order = "SELECT DISTINCT address FROM lh_clients ORDER BY clientname" or die (mysql_error());
        $result = mysql_query($order);
        while($data = mysql_fetch_array($result))
        {
         echo ("<option> $data[address] </option>");
        }
    ?>
    </select>`

Code of search query :

`if (isset($_POST['criteria_address']))
{
$category_address = $_POST['category_address'];
$criteria_address = $_POST['criteria_address'];
$query = "SELECT * FROM lh_clients WHERE $category_address = '$criteria_address' ORDER BY clientname";
$result   = mysql_query($query) or die(mysql_error());
$num_rows = mysql_num_rows($result);


while ($data = mysql_fetch_array($result)) { ?>
<tr>
<td style="vertical-align:top;"><? echo $data['clientname']; ?></td>
<td style="vertical-align:top;"><? echo $data['clienttype']; ?></td>
<td style="vertical-align:top;"><? echo nl2br($data['address']); ?></td>
<td style="vertical-align:top;"><? echo $data['contacts']; ?></td>
<td style="vertical-align:top;"><? echo $data['sensitivity']; ?></td>
<td style="vertical-align:top;"><? echo $data['acountmanager']; ?></td>
<td style="vertical-align:top;"><? echo $data['responsibleexecutive']; ?></td>
<td></td>
</tr>
<?php
}`

I think the search query doesn't work for the newline in addresses. Then what will be the search query for paragraph formate text?
Thanks a lot in advance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.