0

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.

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.