Page 1 of 1

PHP

PostPosted: 25. February 2010 15:37
by Drago85
Hello

I have just loaded xxamp onto my system, now I have inserted some php code into dreamweaver to test but when i type the URL in http://localhost/C:/User.... etc for the saved php script to connect to my phpmyAdmin database the broswer states its forbbin, whats the best way to start out with the script, remembering i am just learning the basics.

Thnaks Martin

Re: PHP

PostPosted: 25. February 2010 15:50
by Stepke-DSL
Drago85 wrote:URL in http://localhost/C:/User.... etc


Thats not the right URL.
You have to save your files in the htdocs-Folder of your xampp (or in a subfolder).
Then you can test your script by typing http://localhost/filename.php in your browser.
If you use subfolders then you have to type http://localhost/subfolder/file.php

Greetings Stepke

Re: PHP

PostPosted: 04. March 2010 13:00
by Drago85
I have tried to insert the new URl but it simply states the object can't be displayed, does the username and password effect the code?
<?php
$host="localhost";
$username="phpeasystep";
$password="1234";
$db_name="db_MBDesign";


mysql_connect("$host", "$username", "$password")or die("cannot connect to server");
mysql_select_db("$db_MBDesign")or die("cannot select db");

?>

Thanks

Re: PHP

PostPosted: 04. March 2010 13:25
by Altrea
Code: Select all
mysql_connect("$host", "$username", "$password") //...
mysql_select_db("$db_MBDesign") //...

Try without the quotation-marks