Results 1 to 1 of 1

Thread: [RESOLVED]Query not displying result

  1. #1

    Thread Starter
    Lively Member rasana's Avatar
    Join Date
    Jan 2007
    Location
    Mumbai, (India)
    Posts
    94

    Smile [RESOLVED]Query not displying result

    Hi All,

    I'm very new to PHP and MySql

    I've written following code to display port name and country after clicking on go button.
    query is correct but it does not display result..
    is there any syntax problem..

    <form name="frmPort" method="POST" action="<?=$thisPage?>">
    <table align="center">
    <tr>
    <td>Port Name:</td>
    <td><input type="text" name="srchPort" /></td>
    <td><input type="submit" name="submit" value="GO" /></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <? if(ISSET($_POST['submit'])){
    $port_name=$_POST['srchPort'];
    $selport="select port,country from selectport where port like '%$port_name%'";
    //echo $selport;
    $result=mysql_query($selport,$conn);
    while($row = mysql_fetch_array($result))
    { ?>
    <tr>
    <td><?=$row['port']?></td>
    <td><?=$row['country']?></td>
    <td>&nbsp;</td>
    </tr>
    <? }
    }
    ?>
    </table>
    </form>
    Actually, my connection string was wrong....my syntax is correct.
    Last edited by rasana; Feb 8th, 2007 at 04:34 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width