PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
jayson.ph
Forum Contributor
Posts: 165 Joined: Mon Jan 02, 2012 9:20 am
Location: MP
Contact:
Post
by jayson.ph » Mon Jan 02, 2012 9:29 am
hi all
i am a beginner and i got this problem that never been load the output.
Code: Select all
<?php
$conn = msql_connect("localhost","jayson.ph", "usaqatai");
if(!$conn){
die("could not connect:" .msql_error());
}
echo "successfully connected";
mysql_close($conn);
?>
file:///C:/wamp/www/home/index.php
please help, thanks
social_experiment
DevNet Master
Posts: 2793 Joined: Sun Feb 15, 2009 11:08 am
Location: .za
Post
by social_experiment » Mon Jan 02, 2012 3:03 pm
Are any errors printed to the browser?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
jayson.ph
Forum Contributor
Posts: 165 Joined: Mon Jan 02, 2012 9:20 am
Location: MP
Contact:
Post
by jayson.ph » Fri Jan 06, 2012 8:22 am
ah no. nothing, and i dont know if it is connected to wamp i used, but the wamp is running.
social_experiment
DevNet Master
Posts: 2793 Joined: Sun Feb 15, 2009 11:08 am
Location: .za
Post
by social_experiment » Fri Jan 06, 2012 8:33 am
Code: Select all
<?php
$conn = msql_connect("localhost","jayson.ph", "usaqatai");
if(!$conn){
die("could not connect:" .msql_error());
}
else {
echo 'connected successfully';
}
mysql_close($conn);
?>
Try this; Also, are you using mysql or msql?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
jayson.ph
Forum Contributor
Posts: 165 Joined: Mon Jan 02, 2012 9:20 am
Location: MP
Contact:
Post
by jayson.ph » Fri Jan 06, 2012 8:50 am
hi social_experiment thanks and i get it.
social_experiment
DevNet Master
Posts: 2793 Joined: Sun Feb 15, 2009 11:08 am
Location: .za
Post
by social_experiment » Fri Jan 06, 2012 8:56 am
ok, if you do use msql you should use msql_close() instead of mysql_close()
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering