SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: simple search field using LIKE
-
Jun 12, 2005, 11:35 #1
- 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
-
Jun 12, 2005, 12:07 #2
- 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'];
-
Jun 12, 2005, 12:08 #3
- 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