Connecting to Local Host (Vista) 1.7.5 [SOLVED]

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Connecting to Local Host (Vista) 1.7.5 [SOLVED]

Postby DavidCraster » 20. November 2011 23:10

I am a beginner in Web design and databases.

I have saved a file written in notepad called mysql_connect which was written to test my local host connection. The fle is saved in my Xampp/htdocs directory. It reads as follows:

<?php


$db_host="localhost";
$db_username="root";
$db_db_pass="golfer99";
$db_name="racestats";


@mysql_connect("$db_host","$db_username","$db_db_pass") or die ("could not connect to my sql");
@mysql_select_db("$db_name") or die ("no database");

echo "successful connection";

?>


When I type the address into IE http://localhost/mysql_connect.php I get an "Object Not Found" error. I have also tried typing the full file path, removing the php extension and have tested successfully the connection to local host/xampp from IE. Can anyone help please ?
DavidCraster
 
Posts: 2
Joined: 20. November 2011 22:55
Operating System: windows vista

Re: Connecting to Local Host

Postby Sharley » 20. November 2011 23:13

Read the \xampp\apache\logs\error.log file for details about the 404 object not found error.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Connecting to Local Host

Postby Altrea » 20. November 2011 23:14

Are you sure the file is named mysql_connect.php and not mysql_connect.php.txt?
Windows notepad can be very confusing. I recommend you to use a better editor like Notepad++
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Connecting to Local Host

Postby DavidCraster » 20. November 2011 23:42

Many thanks for the prompt and helpful reply. I downloaded Notepad++ and my problem is now sorted.
DavidCraster
 
Posts: 2
Joined: 20. November 2011 22:55
Operating System: windows vista

Re: Connecting to Local Host

Postby Sharley » 20. November 2011 23:44

Thanks for the feedback. 8)

Best wishes. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 125 guests