chriscrowe43
New Member
- Messages
- 23
- Reaction score
- 0
- Points
- 0
Hello, I have been looking over the php mysql membership system tutorial and I made an attempt to do it on my site, however I am a total noob to php and it didn't work for me. Honestly I didn’t know what to do with the existing code as far as plugging in my own db info I also created a db and table in my cpanel but I’m not really sure I even did that right. If someone could help me out that would be great!!! (lead me through the steps for my first time) or point me to a person i can talk with to do that. Or even point me to more explanatory help so that I can teach myself and actually get it done correctly. Thank you guys very much.
---------- Post added at 05:25 PM ---------- Previous post was at 03:40 PM ----------
ok so here is the code for two php files that i am trying to use to test my database and check for a good connection. i put all the needed info into the files includeing the database name username and password but when i navigate to the php page www.pooperdoodles.ws/connect_to_mysql.php or www.pooperdoodles.ws/mysql_connect_quicktest.php i get a response that says "no database by that name" I have put the php files up in the www folder on my server. if that is the wrong place im not sure where i am suposed to put it. please help! thank you
<?php
$db_host = "localhost";
$db_username = "put_db_username_here";
$db_pass = "put_db_password_here";
$db_name = "put_db_name_here";
mysql_connect("$db_host","$db_username","$db_pass") or die(mysql_error());
mysql_select_db("$db_name") or die("no database by that name");
?>
<?php
include_once "connect_to_mysql.php";
echo "<br /><h2>You are successfully connected to your database.</h2><br /><br />
Otherwise you would see an include warning, or a mysql connection error.<br /><br />
Happy coding!
";
?>
---------- Post added at 05:25 PM ---------- Previous post was at 03:40 PM ----------
ok so here is the code for two php files that i am trying to use to test my database and check for a good connection. i put all the needed info into the files includeing the database name username and password but when i navigate to the php page www.pooperdoodles.ws/connect_to_mysql.php or www.pooperdoodles.ws/mysql_connect_quicktest.php i get a response that says "no database by that name" I have put the php files up in the www folder on my server. if that is the wrong place im not sure where i am suposed to put it. please help! thank you
<?php
$db_host = "localhost";
$db_username = "put_db_username_here";
$db_pass = "put_db_password_here";
$db_name = "put_db_name_here";
mysql_connect("$db_host","$db_username","$db_pass") or die(mysql_error());
mysql_select_db("$db_name") or die("no database by that name");
?>
<?php
include_once "connect_to_mysql.php";
echo "<br /><h2>You are successfully connected to your database.</h2><br /><br />
Otherwise you would see an include warning, or a mysql connection error.<br /><br />
Happy coding!
";
?>