-
SitePoint Enthusiast
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.
-
$search_text = $_POST['search_name']
You are missing a semi-colon from this line
$search_text = $_POST['search_name'];
-
SitePoint Zealot

You don't have a semicolon on line 14.
*Ha, I knew someone else would get it while I was typing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks