Click to See Complete Forum and Search --> : Beginner problems


LyonB
02-04-2008, 06:19 PM
Beginner problem here, I'm just starting my way through the tutorial here and I'm already having problems with step 1 (connecting to the user and database that I've created)

I've basically cut and pasted from the tutorial

<?php
mysql_connect("localhost", "wlfparty_admin", "1admin") or die(mysql_error());
echo "Connected to MySQL<br>";
mysql_select_db("wlfparty_test") or die(mysql_error());
echo "Connected to Database";
?>

but when I go to load the page, instead of reading as either an error or

Connected to MySQL
Connected to Database

it appears as nothing but a line of question marks. My host has MySQL, phpMyAdmin, and I HAVE run databases on my site, when I installed phpBB3. Would anyone know what is wrong with either my code, or maybe something to do with my permissions?

mattyblah
02-05-2008, 03:11 AM
don't you have to wrap it in a condition? like: if .... {} else {}? Not an expert in php, fyi.

chazzy
02-05-2008, 06:33 AM
I have no idea what you mean by a line of question marks, but since it looks like it's more of a PHP issue, I'm moving this thread over there....

adeang_1
02-05-2008, 07:10 AM
It worked fine for me, do you have your password, username, and database name in the correct places? And also I am using php 5 not sure what your using, and If you want to test php on your home computer go to search for wamp server so you can test before upload.

LyonB
02-05-2008, 11:57 AM
Ugh it seems to be a problem with my web host, I've been getting random bugs like this for a while now and it's driving me nuts. Some pages just randomly won't work in certain browsers on some days, and then others will. Random crap like that, without me even changing anything. I tried sending them an e-mail but it seems their support e-mail inbox is full, so I doubt they'll be any help to me

Can anyone recommend a good/cheap webhost to me? Keep in mind I'm just kind of teaching myself so nothing that's going to wind up being as high as $25/month