Anyone can tell me how can I rewrite my url from and id=1 will get the name from mysql.

Like example id=1 user name is "abcdef". Now the parameter(id=1) will get result from database and display "abcdef" to url(

I think you have it backwards... Dont you want your visitors or links to have the more friendly version.. say: and then you want that to be mapped to a page user.php and display user information?

If so, that's a rewrite. However if your users are accessing and you want to show them in the URL, that's going to be a redirect.

I would think you are interested in the first example. If so, you need a simple rewrite rule something like this (im doing this from memory so test it)

RewriteRule ^(.+)$ user.php?id=$1 [NC,L]

A rewrite rule like this should take any number of characters after the and send them to user.php and passing the value as a parameter.

Then on user.php, you read the value and perform a database lookup (based on ID or username, or whatever parameter you are passing) and display the information to the user.

I would think a better approach would be to be more specific in the friendly URL so that you can do other rewriting and redirecting. For example, I would suggest...

RewriteRule ^user/(.+)$ user.php?id=$1 [NC,L]

The difference here is that your friendly URL would look something like this: which maps to user.php?id=devianleong

Anyway, this should help you to move forward...