Server Name

Status
Not open for further replies.

LashRash

New Member
Messages
47
Reaction score
0
Points
0
I am having trouble linking my PHP to the MySQL database. The code is designed to install it directly into the database, but I do not know the hostserver name, nor the correct way to input it.

Here is the script for my config.php file the text in red is what I need help with
<?php
$datpass="<not shown>"; //mysql password
$dathost="<>"; //databse server
$datusr="<not shown>"; //user name
$datname="<not shown>"; //normally the same as above
?>

Here is a cropped print screen view of the error I am getting.

Advice?

edit: I highlighted the wrong thing. My issue is where to get the address to the host server.
 

Attachments

  • error.jpg
    error.jpg
    38.4 KB · Views: 17
Last edited:

Russ

<b>Retired *****</b>
Messages
3,168
Reaction score
2
Points
38
From your cPanel, scroll to the Databases section, click on MySQL databases link and from there you have to create a username.
 

Blazer9131

New Member
Messages
411
Reaction score
0
Points
0
<?php
$datpass="<Database pass here>"; //mysql password
$dathost="<localhost>"; //databse server
$datusr="<database user name>"; //user name
$datname="<database name>"; //normally the same as above
?>


Change everything but the localhost part =P

Rep + if this helps please =P

~Blaze
 

LashRash

New Member
Messages
47
Reaction score
0
Points
0
The red text is the config info.

<?php
$datpass="<hacker23>"; //mysql password
$dathost="<localhost>"; //databse server
$datusr="<lashrash_admin>"; //user name
$datname="<lashrash_phpbank>"; //normally the same as above
?>


The mods that you had me do did not work, is there any other advice?
 

Blazer9131

New Member
Messages
411
Reaction score
0
Points
0
Well, one note of advice is to remove your SQL login... Espically since it looks like you're using a Bank type script, meaning you might have customers or saved CC numbers.

Also, what mods are you trying to use/install?

*Note: Always change any type of info that might affect you directly when asking for support, only give out the info to Admins or account managers/Staff when asked for, via PM*

~Blaze
 

kajasweb

New Member
Messages
1,723
Reaction score
0
Points
0
Login to your cPanel. Navigate to MySQL Databases. Create a database. If you create a DB with name dbname, the Database name will be "yourcpanelusername_dbname". Create a MySQL User and assign that user for the Database you just created. The MySQL username will also have the same format of "yourcpanelusername_username".

MySQL Host = localhost
MySQL User = yourcpanelusername_username
Database Password = Password for MySQL User (Yourcpanelusername_username)
Database = yourcpanelusername_dbname

Hope, this will help you.

All the best.
 

LashRash

New Member
Messages
47
Reaction score
0
Points
0
I am still receiving, recreated the database, assigned the user, and updated the config file on the server. However I am still getting the below error.

error.jpg

Edit:
I could really use some more help, and I am willing to add to anyones rep.
 
Last edited:

Jarryd

Community Advocate
Community Support
Messages
5,534
Reaction score
43
Points
48
Any chance that you can create the SQL tables manually? instead of letting the script do it? o_O
 

Jarryd

Community Advocate
Community Support
Messages
5,534
Reaction score
43
Points
48
Ahh, it probably can't be done anyway, unless you can find the query to execute on the internet somewhere, i wish i could help, but i have never ever used PHP bank and wouldn't have a clue about it, have you tried googling the error?
 

bigmanbfa2

New Member
Messages
67
Reaction score
0
Points
0
your php code is giving an error that the commands being sent aren't valid. You need to create the tables manually. Go into your cPanel->PHPmyAdmin and create a database and some tables. Also check to make sure that you have a valid MySQL username and double check the permissions granted to that user.
btw the server you are trying to connect to should deffinately be LocalHost.
 

LashRash

New Member
Messages
47
Reaction score
0
Points
0
Here is the coding. Can anyone see anything wrong with it.

This is supposed to be what creates the tables in the database.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>
<TITLE>PHPBank - Installation</TITLE>
<META NAME="GENERATOR" CONTENT="MAX's HTML Beauty++ ME">
<style>

<!--
body { background-color: #FFFFFF; color: #000000; font-size: 11px; font-family: "Tahoma"; }

table { background-color: #000000; }

.centertable { background-color: #FFFFFF; }

td { background-color: #FFFFFF; font-size: 11px; font-family: "Tahoma"; }

i { font-size: 12px; font-style : italic; font-family: "Tahoma"; }

a { font-weight:bold; text-decoration: none; color: #888888; }

a:hover { font-weight:bold; text-decoration: none; color: #BBBBBB; }

h1 { color: #444444; font-size: 15px; font-weight:bold; }

h2 { color: #888888; font-size: 13px; font-weight:bold; }

h3 { color: #FF0000; font-size: 11px; font-weight:bold; }

-->
</style>
</HEAD>
<BODY>
<table height=100% width=100% class=centertable><tr><td class=centertable height=100% width=100% valign=middle align=center>
<table cellpadding=15><tr><td align=center colspan=2>
<img src="topimg.png">
<h1>PHPBank Installation - Installing</h1>
<?php
$nation=strip_tags($_POST['nation']);
$currencysymbol=strip_tags($_POST['currencysymbol']);
$apassword=$_POST['apassword'];
$intromessage=$_POST['intromessage'];

$login=strtolower(strip_tags($_POST['login']));
$password=md5($_POST['password']);
$name=strip_tags($_POST['name']);
$description=strip_tags($_POST['description']);
$balance=$_POST['balance'];
$email=strip_tags($_POST['email']);
//Checks
function checkChars($stringToCheck,$allowedChars)
{
$returnvalue=TRUE;
for ($i=0;$i!=strlen($stringToCheck);$i++)
{
$curchar = substr($stringToCheck, $i, 1);
if (!strstr($allowedChars,$curchar))
{$returnvalue=FALSE;}
}
return $returnvalue;
}

if(!checkChars($login,"abcdefghijklmnopqrstuvwxyz"))
{die ("<h3>ERROR: Your login ID can contain only letters.</h3>");}

if(!checkChars($balance,"1234567890."))
{die ("<h3>ERROR: Balance must be a number.</h3>");}

if (strlen($description)>100)
{die ('<h3>ERROR: The description is longer than 100 characters. Please limit its length to 100 at max.</h3>');}

if (strlen($name)>30)
{die ('<h3>ERROR: The account name is longer than 30 characters. Please limit its length to 30 at max.</h3>');}

if (strlen($login)>20)
{die ('<h3>ERROR: The login id is longer than 20 characters. Please limit its length to 20 at max.</h3>');}

//create structure

//connect
require "config.php";
if ($datpass=="")
{$db = mysql_connect($dathost, $datusr);}
else
{$db = mysql_connect($dathost, $datusr, $datpass);}
mysql_select_db($datname,$db);

$query="CREATE TABLE phpb_accounts ( id int(11) NOT NULL auto_increment, login text NOT NULL, password text NOT NULL, name text NOT NULL, description text NOT NULL, balance text NOT NULL, active int(11) NOT NULL default '0', email text NOT NULL, PRIMARY KEY (id) ) TYPE=MyISAM;";
$result = mysql_query($query,$db);
if (!$result)
{die ('<h3>ERROR: Could not create the account table. Your MySQL info might not be correct.</h3>');}
echo "..Account table created.<br>";
$query="CREATE TABLE phpb_layout ( bordercolor text NOT NULL, bgcolor text NOT NULL, insidecolor text NOT NULL, h1color text NOT NULL, h1size text NOT NULL, h2color text NOT NULL, h2size text NOT NULL, h3color text NOT NULL, h3size text NOT NULL, acolor text NOT NULL, ahovercolor text NOT NULL, size text NOT NULL, textcolor text NOT NULL, font text NOT NULL ) TYPE=MyISAM;";
$result=mysql_query($query,$db);
if (!$result)
{die ('<h3>ERROR: Could not create the layout table. Something must be wrong with MySQL.</h3>');}
echo "..Layout table created.<br>";
$query="CREATE TABLE phpb_other ( accounts int(11) NOT NULL default '0', transactions int(11) NOT NULL default '0', latesttransaction text NOT NULL, intromessage text NOT NULL, nation text NOT NULL, currencysymbol text NOT NULL, topimg text NOT NULL, apassword text NOT NULL ) TYPE=MyISAM;";
$result=mysql_query($query,$db);
if (!$result)
{die ('<h3>ERROR: Could not create the information table. Something must be wrong with MySQL.</h3>');}
echo "..Information table created.<br>";
$query="CREATE TABLE phpb_transactions ( id int(11) NOT NULL auto_increment, requester int(11) NOT NULL default '0', acceptor int(11) NOT NULL default '0', direction int(11) NOT NULL default '0', amount double NOT NULL default '0', comment text NOT NULL, status int(11) NOT NULL default '0', timestamp text NOT NULL, PRIMARY KEY (id) ) TYPE=MyISAM;";
$result=mysql_query($query,$db);
if (!$result)
{die ('<h3>ERROR: Could not create the transaction table. Something must be wrong with MySQL.</h3>');}
echo "..Transaction table created.<br><br>";

//insert data
$query="INSERT INTO phpb_other VALUES (1, 0, '', '$intromessage', '$nation', '$currencysymbol', 'topimg.png', '$apassword');";
$result=mysql_query($query,$db);
if (!$result)
{die ('<h3>ERROR: Could not insert bank data! Something must be wrong with MySQL.</h3>');}
echo "..Bank data inserted.<br>";

$query="INSERT INTO phpb_layout VALUES ('000000', 'FFFFFF', 'FFFFFF', '444444', '15', '888888', '13', 'FF0000', '11', '888888', 'BBBBBB', '11', '000000', 'Tahoma');";
$result=mysql_query($query,$db);
if (!$result)
{die ('<h3>ERROR: Could not insert layout data! Something must be wrong with MySQL.</h3>');}
echo "..Layout data inserted.<br>";

$query="INSERT INTO phpb_accounts (`login`,`password`,`name`,`description`,`balance`,`active`,`email`) VALUES ('$login','$password','$name','$description','$balance','1','$email')";
$result=mysql_query($query,$db);
if (!$result)
{die ('<h3>ERROR: Could not insert government account data! Something must be wrong with MySQL.</h3>');}
echo "..Government account data inserted.<br><br>";
?>
<h2>Installation complete!</h2>
The installation was sucessfully completed. You may now go to the <a href="index.php">Index</a>.<br>
Before continuing, delete the files "install.php" and "doinstall.php"!<br>
If you don't delete them, anyone could erase the database!<br>
</td></tr></table>
</td></tr></table>
</BODY>
</HTML>

Edit:
I input the shared IP address, is there anyway to get THE ip address directly to the database? I have been looking around and it seems that this might help, also if it does, is the a special way to enter it?

<81.11.91.991> is what I have, the IP is fake btw, all help is more than appreciated.
 
Last edited:

Blazer9131

New Member
Messages
411
Reaction score
0
Points
0
Alright, Umm I can help you.. do you have MSN? If so add me,

Blazer9131@hotmail.com

Or e-mail me blazer9131@gmail.com

I will install it for you.. since it's easy *for me* xD... I think that the table's to big for the script to activate, Most PHP configs allow a max data transfers of 10mb.

~Blaze
 

LashRash

New Member
Messages
47
Reaction score
0
Points
0
I do but it is for internal use at dell only, no outside people can be saved. I sent an e-mail, just tell me what you need.
 
Status
Not open for further replies.
Top