SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    CO
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    simple search field using LIKE

    I am building a simple search form with a text field where I am trying to have it embed the name entered in the query on the processing page.

    I am getting this error when I test the page:

    Parse error: parse error, unexpected T_VARIABLE in /home/greaterg/public_html/busdirectory_profiles_test.php on line 15

    Here is the query code I am using. Line 15 is the line beginning with '$query_rs_businessdetails':

    mysql_select_db($database_gg_conn, $gg_conn);
    $search_text = $_POST['search_name']
    $query_rs_businessdetails = "SELECT * FROM businesses WHERE businesses.coname LIKE '%$search_text%' ORDER BY coname ASC";
    $query_limit_rs_businessdetails = sprintf("%s LIMIT %d, %d", $query_rs_businessdetails, $startRow_rs_businessdetails, $maxRows_rs_businessdetails);
    $rs_businessdetails = mysql_query($query_limit_rs_businessdetails, $gg_conn) or die(mysql_error());
    $row_rs_businessdetails = mysql_fetch_assoc($rs_businessdetails);

    Does anyone know what I am doing wrong? I am very new to PHP so I'm sure it is something silly.

    I appreciate any help ahead of time.
    JB

  2. #2
    SitePoint Evangelist klik's Avatar
    Join Date
    Jan 2005
    Location
    Scotland, UK
    Posts
    547
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $search_text = $_POST['search_name']

    You are missing a semi-colon from this line

    $search_text = $_POST['search_name'];

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2005
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You don't have a semicolon on line 14.

    *Ha, I knew someone else would get it while I was typing.


Bookmarks

Posting Permissions

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