can anyone help me, right now i' having a problem to do sql for retrieving data based on first character that user input. anyone have a solution?
mysql_select_db($database_COS, $COS);
$query_Recordset2 = sprintf("SELECT ast_formID, ast_model, ast_ownName, ast_ownDept, stf_id FROM asset WHERE ast_ownName LIKE '$colname_Recordset2%' ORDER BY ast_ownName ASC", GetSQLValueString($colname_Recordset2 . "%", "text"));
$query_limit_Recordset2 = sprintf("%s LIMIT %d, %d", $query_Recordset2, $startRow_Recordset2, $maxRows_Recordset2);
$Recordset2 = mysql_query($query_limit_Recordset2, $COS) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
if (isset($_GET['totalRows_Recordset2'])) {
$totalRows_Recordset2 = $_GET['totalRows_Recordset2'];
} else {
$all_Recordset2 = mysql_query($query_Recordset2);
$totalRows_Recordset2 = mysql_num_rows($all_Recordset2);
}
$totalPages_Recordset2 = ceil($totalRows_Recordset2/$maxRows_Recordset2)-1;
}
how exactly the sql for detecting first character in a string that user enter and match it with data in the database ?
please help me !