iGuest 3 Report post Posted January 14, 2005 Hi guys,Im try to install a php hit counter! But im having problems creating a mysql database. include "phphits.php";//---------- Set general variables ----------$sql_name = "";$sql_list = "";//---------- Connect to MySQL server, using settings from above ----------if (!($sql_id = @mysql_connect(SQL_HOST, SQL_USER, SQL_PWD))){ if (SQL_SHOW_ERRORS <> 0) phphitsShowErrorMsg("mysql_connect", $sql_id); Do i go into cpanel and create a database? then edit-$sql_name = "";$sql_list = "";Please help! Im clueless with php Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 you have to create mySql Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 It wont let in cpanel ive tried http://forums.xisto.com/ & http://domain/cpanelWhat should i do?I tried the normal way of loggin in. my username plus my hosting password (not my forum password.Can some-one check to see if they can login into cpanel click here for cpanel Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 do you have domain or subdomain?? Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 do you  have domain or subdomain??subdomain Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 It wont let in cpanel  ive tried http://forums.xisto.com/ & http://domain/cpanelWhat should i do?I tried the normal way of loggin in. my username plus my hosting password (not my forum password.Can some-one check to see if they can login into cpanel  click here for cpanel I can log in to http://domain/cpanel just fine. Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 i can't login now beacuse my account is not created yet Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 Im in Cpanel dont know why it would`nt let me in. I tried over & over and it finally let me in Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 meyby some timi problems with server and login to cpanel Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 Im stuck again :| Ive created a new mysql database $dbh=mysql_connect ("localhost", "djbungle_djbphph", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());mysql_select_db ("djbungle_phphit"); How and where do i input that information in here :?: <?phpinclude "phphits.php";//---------- Set general variables ----------$sql_name = "";$sql_list = "";//---------- Connect to MySQL server, using settings from above ----------if (!($sql_id = @mysql_connect(SQL_HOST, SQL_USER, SQL_PWD))){ if (SQL_SHOW_ERRORS <> 0) phphitsShowErrorMsg("mysql_connect", $sql_id); }//---------- Check if MySQL database already exists ----------$sql_list = @mysql_list_dbs($sql_id);$i = 0;$found_db = false;while($sql_name = @mysql_dbname($sql_list, $i)){ if($sql_name == SQL_DB) Â { Â Â $found_db = true; Â } Â $i++;}//---------- Create MySQL databse if necessary ----------if(!($found_db)){ if (!@mysql_create_db(SQL_DB, $sql_id)) { Â if (SQL_SHOW_ERRORS <> 0) phphitsShowErrorMsg("mysql_create_db", $sql_id); }}//---------- Activate MySQL databse ----------if (!@mysql_select_db(SQL_DB, $sql_id)){ if (SQL_SHOW_ERRORS <> 0) phphitsShowErrorMsg("mysql_select_db", $sql_id);} Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 <?php include "phphits.php"; //---------- Set general variables ---------- $sql_name = "here must be something "; $sql_list = ""; //---------- Connect to MySQL server, using settings from above ---------- if (!($sql_id = @mysql_connect(SQL_HOST, SQL_USER, SQL_PWD))) {  if (SQL_SHOW_ERRORS <> 0) phphitsShowErrorMsg("mysql_connect", $sql_id);  } //---------- Check if MySQL database already exists ---------- now you se where you must write the sql name Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 thanks for the help kisiek! Ive done it Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 I have the same problem in the past now I now how to help Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 I have the same problem in the past now I now how to helpNice.. it's true Experience makes a man perfect.... Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 FNh have admins Moderetors meybe they need some one to support Share this post Link to post Share on other sites