No you are not getting my point
Look when you are using link for example
<a href="www.mysite.com/projects/<?$project_name?>/" ><?$project_name?></a>
the link made by this should be as
www.mysite.com/projects/School-project/
the spaces are not allowed in url so if you have space in your project name use string replace function and replace them with "-" not underscors as "-" is more effective for search engines.
when we will go at htacces file as
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^projects/(.*)/$ index.php?project_id=$1 [L]
understand the meaning of bold url rewrite rule
that means when it got
www.mysite.com/projects/ and (.*)=parameter that passes and that is project name means
projects/(.*)=www.mysite.com/projects/School-project/
then redirect this url to
index.php and the project name that is 1st parameter put the value of that in
project_id variable
means
at this stage
project_id='School-project';
now request the project_id variable on detail page
$project_id=$_REQUEST['project_id'];
this $project_id is just variable name it contains the value of project name not ID
now again apply string replace function on $project_id and replace that "-" with "%" that will help you to apply LIKE command for sql quesry
after apply replace function it will be
$proj_name="school%project";
now apply the select query like
select project_id from table-project where project_name like '$proj_name% or
project_name like 'school%name%'
that will match each word
now you will get the ID of that project name and use that if for your required results.
All this process is for proper url re-writing for dynamic urls