Jump to content


Photo

Parsing is...halting?


  • Please log in to reply
4 replies to this topic

#1 Biax

Biax
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 03 August 2006 - 09:18 AM

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.

#2 extrovertive

extrovertive
  • Members
  • PipPipPip
  • Advanced Member
  • 235 posts

Posted 03 August 2006 - 09:22 AM

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.

#3 Biax

Biax
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 03 August 2006 - 09:29 AM

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.

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 03 August 2006 - 11:24 AM

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.

#5 Biax

Biax
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 03 August 2006 - 01:57 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users