PDA

View Full Version : Need some PHP/mySQL help


megahertzman
10-9-02, 11:21 PM
Someone please help me!

I downloaded a PHP/MySQL-based forum script from a website which I forgot, but I'm having trouble setting it up.

I uploaded all the files here:
http://www.monstria.com/forums/roar/

The instructions were to set up the variables in the vars.php file and then to run the admin.php file. I ran it, logged in, and it then said to click on 'Create Database'. So I clicked the link, but it gave me these errors:

Warning: Access denied for user: 'admin@66.227.37.191' (Using password: YES) in /home/monstria/public_html/forums/roar/createdb.php on line 6

Warning: MySQL Connection Failed: Access denied for user: 'admin@66.227.37.191' (Using password: YES) in /home/monstria/public_html/forums/roar/createdb.php on line 6

Warning: mysql_create_db(): supplied argument is not a valid MySQL-Link resource in /home/monstria/public_html/forums/roar/createdb.php on line 7


I would really appreciate it if someone could help me.

So you can better understand what I'm talking about, you may download all the files required for this program in zip from http://www.monstria.com/forums/roar/forum.zip

My e-mail: hoth83@hotmail.com

Thanks.
;)

Atomic-Design
10-11-02, 11:27 AM
Your password is wrong, so it won't connect to MySQL.

megahertzman
10-11-02, 06:56 PM
Hi. My password is right. I'm the one who made the password.
The password to login is the password I made up in the variables of the vars.php file. And I used the exact one to login.

I don't know what's the problem.
:confused:

Atomic-Design
10-11-02, 07:18 PM
Right here:

Warning: Access denied for user: 'admin@66.227.37.191' (Using password: YES) in /home/monstria/public_html/forums/roar/createdb.php on line 6

It is denying you. You either have the wrong username or the wrong password when you setup MySQL.

megahertzman
10-11-02, 08:39 PM
Thanks Atomic-Design,

BUT I'M GETTIN SO DAMN FRUSTRATED.

OK, LOOK, I CHANGED DA PWD AND USER NAME 4 DA MYSQL DB.
MY USERNAME IS NOW MY FIRST NAME, HAIDER. BUT NOW I GET DIS FREAKIN MESSAGE AGIN:

Warning: Access denied for user: 'haider@66.227.37.191' (Using password: YES) in /home/monstria/public_html/forums/roar/createdb.php on line 6

Warning: MySQL Connection Failed: Access denied for user: 'haider@66.227.37.191' (Using password: YES) in /home/monstria/public_html/forums/roar/createdb.php on line 6

Warning: mysql_create_db(): supplied argument is not a valid MySQL-Link resource in /home/monstria/public_html/forums/roar/createdb.php on line 7

BUT DO I HAVE TO USE DAT THING CALLED TABLES B4 I USE DA MYSQL DB?

OH YEA N I GOT DA SCRIPT FROM XGRA.COM

THANKS! PLEASE REPLY!

HalfaBee
10-11-02, 10:27 PM
/home/monstria/public_html/forums/roar/createdb.php

This is not a powweb server.

There must be some configuration line that you have not set to your site.
How about posting the config file with the password removed.

HalfaBee

megahertzman
10-12-02, 03:02 PM
Good idea, HalfaBee.

Here is the only file in which modification is required:
vars.php:

(NOTE: I made the User ID and PWD for the DB (MySQL) same for that of the Adminisrator's login.)

<?
$forumTitle = "The Monstria Forums > ROAR Threaded Discussion"; // Forum title
$homeTitle = "Monstria"; // Homepage name
$homeURL = "http://www.monstria.com"; // Homepage URL
$replyURL = "http://www.monstria.com/forums/roar/reply.php"; // URL to 'reply.php' file

$dbHost = "monstria.com"; // MySql host name
$dbName = "roar"; // Database name
$dbUser = "haider"; // User name
$dbPasswd = "hello"; // Password

$adminName = "haider"; // Admin name
$adminPasswd = "hello"; // Password, please change them

$badWordFilter = 1; // allow bad words checking? 1=yes, 0=no
$banIP = 0; // ban ip? 1=yes, 0=no
$emailAdmin = 1; // sent new posting to admin? 1=yes, 0=no
$adminEmail = "post-forums.roar@monstria.com"; // email address where new posting sent to

$maxThread = "20"; // Thread number per page
$fontFamily = "Verdana";
$fontSize = "9pt";
$linkColor = "#0080C0";
$visitedColor = "#0080C0";
$hoverColor = "#0080C0";
$bgColor = "#FFFFFF"; // background color
$bgImage = ""; // background image
?>


Also, I get this information from the server. I don't know what it means - do I need it?

Connection Strings

Perl $dbh = DBI->connect("DBI:mysql:monstria_roar:localhost","monstria_haider","<PASSWORD HERE>");

PHP $dbh=mysql_connect ("localhost", "monstria_haider", "<PASSWORD HERE>") or die ('I cannot connect to the database.');
mysql_select_db ("monstria_roar");

JDBC (may not be avalible) <%@ page import="java.sql.*" %>
Connection connection = null;
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
connection = DriverManager.getConnection(
"jdbc:mysql://localhost/monstria_roar?user=monstria_haider&password=<PASSWORD HERE>");

BTW, Thx :)

dispatcher
10-12-02, 05:43 PM
Does the script create the tables needed in a setup script???
If not you usually need to run a separate SQL script in PHPmyAdmin (or similar) to set them up, or do it manualy

Without that- there are no tables to access!

Bob
4driver.com

megahertzman
10-12-02, 06:42 PM
What exactly is a table?

dispatcher
10-12-02, 06:46 PM
Step One:
Do you have any Database experience?
If so - any with MySQL???

It's not essential - to start - but it is necessary to know where to start


Bob

megahertzman
10-12-02, 06:50 PM
No :rolleyes:, I don't have any experience in databasing, or any MySQL. But I do have minor experience in programming.

All I want is this stupid script to work! Could you help me get it to work?!

dispatcher
10-12-02, 07:04 PM
1. you must have a MySQL database
(set up thru your web host)
You will need the servername, databasename, username, and password

2. the scripts have to be installed in a directory on your server
this should be done with FTP not Front Page, if you use it
- some hosts require that it be in the CGI-BIN
- some hosts require that file "permissions" be set
for example to "755"
(this only applies to Unix/Linux/BSD hosts)
if you are not familiar with permissions - let me know
they are essential for any PHP/CGI/Perl work

3. The tables are like folders within the database
generaly the script itself does not create them
but a setup or install script may

That MUST be run, to set everything up

If it does not exist, usualy the programmer supplies a
separate script typicaly named "????.sql"
with the data to set up the tables

To run it, the easiest way is with a program like
PHPmyAdmin (but thats a whole settup of its own, but very easy - there are other programs too)

If THAT doesn't exist, the tables can be manually created
but that requires detailed info about the formats

Once setup you are almost there!

Do you need help this far????


Bob

megahertzman
10-12-02, 07:32 PM
I already have a MySQL database setup, called roar (as you can see in the vars.php code). The MySQL host name (as required by the vars.php file) is my domain name (right?) and the username and password have already been setup via the webhost and filled in the variables in the script.

All files are uploaded in one directory (forums/roar), but are not in the CGI-BIN. I don't think it is required for PHP scripts to be located inside the CGI-BIN folder. I uploaded everything with my WS_FTP LE program. I am familiar with permissions, as I have set owner to read, write, and execute; and group and others to read and execute. And we're on UNIX.

Now, my understanding through you is that tables are locations in a MySQL database where the information retrieved by the user is stored.

The server does have phpMyAdmin.

I found that there is an option to create a table.
The options I get to create the table are as follows:

---> Create new table on database monstria_roar :
Name _______
Fields________

What do I fill it up with?

dispatcher
10-12-02, 07:45 PM
The MySQL host name (as required by the vars.php file) is my domain name (right?)
not necessarily!

If this is here on powweb - use your SERVER name
(server.powweb.com)
same as your FTP address
Using "localhost" may work also (it does for me)

and the username and password have already been setup via the webhost and filled in the variables in the script.

All files are uploaded in one directory (forums/roar), but are not in the CGI-BIN. I don't think it is required for PHP scripts to be located inside the CGI-BIN folder.

that'll work - at least on POWWEB servers

I uploaded everything with my WS_FTP LE program. I am familiar with permissions, as I have set owner to read, write, and execute; and group and others to read and execute. And we're on UNIX.

that should work - though some scripts require that some files/folders have other settings

Now, my understanding through you is that tables are locations in a MySQL database where the information retrieved by the user is stored.

That's probably your problem!

The server does have phpMyAdmin.

Good

I found that there is an option to create a table.
This is the options I get to create the table is as follows:
---> Create new table on database monstria_roar :
Name _______
Fields________

Well - first of all -

the database name in your script vars.php is "roar"
and it appears the correct name is "monstria_roar"

try changing that first!

megahertzman
10-12-02, 07:56 PM
Okay, I changed the $dbHost variable in vars.php to "localhost" and changed the name of the database in the variable to monstria_roar.

Now I get this error when I try to execute the createdb.php file:


Warning: Access denied for user: 'haider@localhost' (Using password: YES) in /home/monstria/public_html/forums/roar/createdb.php on line 6

Warning: MySQL Connection Failed: Access denied for user: 'haider@localhost' (Using password: YES) in /home/monstria/public_html/forums/roar/createdb.php on line 6

Warning: mysql_create_db(): supplied argument is not a valid MySQL-Link resource in /home/monstria/public_html/forums/roar/createdb.php on line 7


But is my interpretation of tables wrong or right....

>>>Okay, we'll continue this stupid problem tomorrow morning. I'm tired for the day...:o

dispatcher
10-12-02, 08:45 PM
Originally posted by megahertzman
Okay, I changed the $dbHost variable in vars.php to "localhost" and changed the name of the database in the variable to monstria_roar.

Now I get this error when I try to execute the createdb.php file:


Warning: Access denied for user: 'haider@localhost' (Using password: YES) in /home/monstria/public_html/forums/roar/createdb.php on line 6

Warning: MySQL Connection Failed: Access denied for user: 'haider@localhost' (Using password: YES) in /home/monstria/public_html/forums/roar/createdb.php on line 6

Warning: mysql_create_db(): supplied argument is not a valid MySQL-Link resource in /home/monstria/public_html/forums/roar/createdb.php on line 7




This is not a POWWEB host, right?
different hosts use different configurations

many host setups use ONE MySQL server for all sites
each has a unique DATABASE NAME
(many assign it as "yoursiteusername_databasename" to assure that each is different

sometimes localhost wont work
(especialy when its on a different server!)
check with your Host co


Who is the host????

Bob

HalfaBee
10-13-02, 03:59 AM
It looks like you are trying to use a Powweb database on another host.

Instead of localhost put "yourserver.powweb.com" to the site that has your mysql database.

HalfaBee

dispatcher
10-13-02, 08:33 AM
I think a couple of parameters have to be stated here to get this working:
1. Is the forum you are setting up on POWWEB, if not where???
2. Are you setting up a POWWEB mysql database and using it from another (non-powweb) site?

Any combination should be do-able, but configurations may vary!

Incidentaly, for a very easy to set up (basicly self installs everything!) forum, considerInvision Board (http://invisionboard.com)

Very flexible, lots of features, very easy setup, great support, and totaly FREE

Bob

megahertzman
10-13-02, 04:26 PM
ok i got. thx dispather and HalfaBee.

u were rite halfabee, i had to put the myserver.powweb.com if i wanted to use a mysql db from here.

:)