Jump to content
xisto Community
Sign in to follow this  
iGuest

A lttle Help! Please

Recommended Posts

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

It wont let in cpanel   ive tried http://forums.xisto.com/ & http://domain/cpanel
What 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

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

<?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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.