// first check if a querystring exists at all (avoiding errors)
// escape the value form the url (security)
$customer_name = mysql_real_escape_string($_GET['customer_name']);
// then use the value in WHERE statement
$sql="SELECT id,customer_name FROM Customers WHERE customer_name='$customer_name'";
So it has nothing with rewriting with the URL? I'm just curious can you explain how this works. Maybe I got confused what he is asking. So by Selecting id, customer_name and using Where clause will automatically make the name appear without add or changing the URL?
As far as I understood the question he wants to display data about a particular user. The user is defined in the querystring ?customer_name=John+Doe. So you can get cuustomer name from the $_GET array where variables from query string are stored. You have to use this info in the query to filter out the record with appropriate data.
Where the querystring comes from I do not know since it was not posted. It could be dropdown box or input box etc.
So it has nothing with rewriting with the URL?
I am not saying that. I haven't checked your proposal for solution. As far as I know rewriting the URL makes URLs look nicer, easier to bookmark, easier to get read by search engines etc.
The url can't affect the SQL unless it has a where clause and the querystrng parameter is used in it. Rewriting has nothing to do with this. After all, rewriting is just prettifying exisiting domain and associated querystring