Results 1 to 4 of 4
  1. #1

    How to have multiple search keys

    I have a database wherein the files are named abcd100.00b, abcd101.00b,..... i need a code where wen the user enters abcd separate then 100 to 110 . all the files with the name abcd and in the range 100 to 110 should get displayed now the following code can display pnly the first four characters how do i implement this??????
    <?php

    //capture search term and remove spaces at its both ends if the is any
    $searchTerm = trim($_GET['keyname']);

    //check whether the name parsed is empty
    if($searchTerm == "rinex_file")
    {
    echo "Enter name you are searching for.";
    exit();
    }
    if($searchTerm == "rinex_file")
    {
    echo "Enter name you are searching for.";
    exit();
    }

    //database connection info
    $host = "localhost"; //server
    $db = "rinex"; //database name
    $user = "m"; //dabases user name
    $pwd = "c"; //password

    //connecting to server and creating link to database
    $link = mysqli_connect($host, $user, $pwd, $db);

    //MYSQL search statement
    $query = "SELECT * FROM rinexo WHERE rinex_file LIKE '%$searchTerm%'";

    $results = mysqli_query($link, $query);

    /* check whethere there were matching records in the table
    by counting the number of results returned */
    if(mysqli_num_rows($results) >= 1){
    echo '<table border="1">
    <tr>
    <th>rinex version</th>
    <th>program</th>
    <th>date</th>
    <th>maker name</th>

    <th>maker number</th>
    <th>observer</th>
    <th>agency</th>
    <th>position_X_Y_Z</th>
    <th>delta</th>
    <th>wavelength</th>
    <th>rinex file</th>
    </tr>';
    while($row = mysqli_fetch_array($results)){

    echo '<tr>
    <td>'.$row['rinex_version'].'</td>
    <td>'.$row['pgm'].'</td>
    <td>'.$row['date'].'</td>
    <td>'.$row['marker_name'].'</td>
    <td>'.$row['marker_no'].'</td>
    <td>'.$row['observer'].'</td>
    <td>'.$row['agency'].'</td>
    <td>'.$row['position_X_Y_Z'].'</td>
    <td>'.$row['delta'].'</td>
    <td>'.$row['wavelenth'].'</td>
    <td>'.$row['rinex_file'].'</td>
    </tr>';

    }
    echo '</table>';

    }else{

    echo "There was no matching record for the name " . $searchTerm;


    }

  2. #2
    Join Date
    Mar 2003
    Location
    WebHostingTalk
    Posts
    16,963
    Moved > Programming Discussion.
    Specially 4 You
    .
    JoneSolutions.Com ( Jones.Solutions ) is on the net 24/7 providing stable and reliable web hosting solutions and services since 2001

  3. #3
    hey i don understand what u mean by moved> programming discussion

  4. #4
    Please HElp!!! m clueless

Similar Threads

  1. how to have three search keys in php?
    By madu in forum Programming Discussion
    Replies: 3
    Last Post: 10-22-2013, 03:18 AM
  2. SSH Keys for Multiple Uses - Basic Question
    By rangy in forum Hosting Security and Technology
    Replies: 2
    Last Post: 02-14-2011, 01:16 AM
  3. Replies: 0
    Last Post: 08-11-2010, 05:18 AM
  4. Using quote marks to group search keys
    By dbryant in forum Programming Discussion
    Replies: 1
    Last Post: 07-09-2004, 12:11 AM

Tags for this Thread

Posting Permissions

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