/    Sign up×
Community /Pin to ProfileBookmark

Beginner problems

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

[code=php]<?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”;
?>[/code]

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

[QUOTE]

Connected to MySQL
Connected to Database

[/QUOTE]

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?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@mattyblahFeb 05.2008 — don't you have to wrap it in a condition? like: if .... {} else {}? Not an expert in php, fyi.
Copy linkTweet thisAlerts:
@chazzyFeb 05.2008 — 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....
Copy linkTweet thisAlerts:
@adeang_1Feb 05.2008 — 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.
Copy linkTweet thisAlerts:
@LyonBauthorFeb 05.2008 — 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
×

Success!

Help @LyonB spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...