Jump to content

Archived

This topic is now archived and is closed to further replies.

Biax

Parsing is...halting?

Recommended Posts

Hello, I've been setting up my own website, developing on my local machine. I've got PHP and Apache and all that working, and everything has been running smoothly until I started trying to do things with the database. I try to load the page and it does nothing; blank white page. I started commenting out lines to find where it happens, and its due to this line:

$conn = mysql_connect("$location","$username","$password");

So it's having problems connecting to the database or something?? I don't know what to do, if anybody could help me I would greatly appreciate it.

Share this post


Link to post
Share on other sites
well, what are you trying to do with the database? If you're just connecting and seeing blanks, it works. Otherwise, it would output some errors.

Share this post


Link to post
Share on other sites
Here's the full code for it:

<?php
$conn = mysql_connect("$location","$username","$password");
if (!$conn) die("Could not connect MySQL");
mysql_select_db($database,$conn) or die("Could not open database");

echo 'database connected<br>';
?>

I dont get any of those output messages. If it was working, wouldnt it output "database connected"?

I have this code included at the very start of a page. None of that page loads, it just gets to the
$conn = mysql_connect("$location","$username","$password");
line and does no more after that.

Share this post


Link to post
Share on other sites
Do you have PHP5? When you installed PHP5 did you enable the mysql extension and if you are on a unix based server did you compile PHP with the --with-mysql command? This the only reason I can see why this isnt working.

Share this post


Link to post
Share on other sites
Thank you very much! That wasnt written anywhere in any of the setup tutorials I was using. I had to enable some things in the ini and move a .dll. All working now. Thanks again.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.