|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Connecting to MySQL
Hello Everyone,
This is my first post and I am so new you could say I do not exist yet. When you add the following to a PHP page, do you place it before the opening <HTML> ? <?php $dbServer = "http://www.littlerussian.net"; $dbUserName = "your_username"; $dbPassword = "your_password"; $dbDatabase = "your_database_name"; $con = mysql_connect("$dbServer","$dbUserName","$dbPassword") or die ("Connection Error to Server"); $db = mysql_select_db("$dbDatabase",$con) or die("Connection Error to Database"); ?> Also, can anyone see this code if they do a view source? Thanks, Ed Plummer Saratoga, NY |
|
#2
|
|||
|
|||
|
RE: Connecting to MySQL
To keep it simple ... after. However, I would suggest putting that inside a file that is outside of your web servers root.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Connecting to MySQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|