PDA

View Full Version : page wont show


trevor
01-10-03, 00:14
well i got php working fine, thanks to all who helped my at my below post.

anyways my NEW problem is I made a page that is supposed to allow e to enter a username and password, which i have in a mySQL database, (testdb) in a table called users. now for some reason when I go to test the site using apache, nothing loads. nothing at all. if I remove this code it loads fine. (but of course it doesn't do anything worthwhile) can anyone see what is wrong?

<! DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<?
//database
$host = "localhost";
$name = "";
$pass = "";
$dbname = "testdb";
$link = mysql_connect($host, $user, $password)
or die("could not conenct");
mysql_select_db("testdb")
or exit ("couldn't get into database");
$query = "insert into sitestats values('hit')";
mysql_query($query, $link)
?>

thanks,

Trevor

trevor
01-10-03, 00:49
i think it might have something to do with permissions, but i dont know how to fix it. right now the only user with access to 'testdb' is root.

aZa
01-17-03, 17:35
Try checking out variable names in mysql_connect function and the ones that you define (in mysql_connect you use $user and you define $user, in mysql_connect you use $password and define $pass). Everything is ok with them?

Does it gives away any error code or something?