If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

The $_POST function and apostrophes.

I writing an installer script, and the first part creates the file containing the database information then writes the info into the file.

I have my installer ordered is so after the form is submitted with the database information it checks to make sure the install file can connect to the database. This is where my problem is. I want to submit the $db_host and then it be surrounded by apostrophes on each side. (example: 'hostname') Since the script checks the connection right away I can't simply put the apostrophes in the host_name field. So I'm guessing my only choice is in the third piece of code I've supplied below. How would i go about surrounding the host name in apostrophes using the $dbhost variable in the thid piece of coding I've provided?

Here are specific sections of the script to help understand my question:

mysql_connect($db_host,$db_user,$db_pass) or die('There was an error connecting to the database, please make sure you have your details correct.<br>
<a href="install.php?x=1">Go back</a>.');
mysql_select_db($db_name) or die('There was an error selecting the database, please make sure your details are correct.<br>
<a href="install.php?x=1">Go back</a>.');