I have a variable
$document_number="AM101010"
I need to create a variable that will take the first 2 characters from $document_number and add wildcards to the end like this
$document_number_wildcard = "AM%%%%%%"
then I will be able to use the $document_number_wildcard like this for querying a table
<?
$find_department_supivisor=mssql_query("SELECT *
FROM supivisor_tracking
WHERE department LIKE '$document_number_wildcard'
");
while($row2=mssql_fetch_array($find_department_supivisor))
{
$department=$row2["department"];
}
if(!empty($department))
{
echo $department;
}
?>
after I run the script I sould get a result like this
AM
thanks