What do you think is/are error(s)

Problems with the Windows version of XAMPP, questions, comments, and anything related.

What do you think is/are error(s)

Postby oculus » 11. May 2009 14:51

When I click CD Collection, this appears:
CD Collection (Example for PHP+MySQL+PDF Class)
(Requests allowed from localhost only)

A very simple CD programm.

CD list as PDF document.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in C:\xampp\htdocs\xampp\cds.php on line 77
Could not connect to database!
Is MySQL running or did you change the password?



In Excel_Writer, when I type a word in the box and hit "Submit Query," Microsoft Excell opens with the word I've typed in the box.


In ADOdb, I entered the corresponding info in each box, but something appears on the top:

DBServer: mysql

Question: Is this normal?



Thank you.
oculus
 
Posts: 18
Joined: 11. May 2009 10:16

Re: What do you think is/are error(s)

Postby Wiedmann » 11. May 2009 15:48

Question: Is this normal?

Yes.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: What do you think is/are error(s)

Postby oculus » 11. May 2009 15:54

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in C:\xampp\htdocs\xampp\cds.php on line 77
Could not connect to database!
Is MySQL running or did you change the password?


But I really can't connect to the MySQL (database).

I just tried this putting on index.php

<?
$user="root";
$password="mypass";
$database="db1";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30) NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))";
mysql_query($query);
mysql_close();
?>
but when I access the page, it says,

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: YES) in C:\xampp\htdocs\login\index.php on line 5
Unable to select database



What do you think is the problem with the code(s)?
oculus
 
Posts: 18
Joined: 11. May 2009 10:16

Re: What do you think is/are error(s)

Postby Wiedmann » 11. May 2009 16:02

What do you think is the problem with the code(s)?

Sure.
PHP can't know that you mean the same with $user and $username.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: What do you think is/are error(s)

Postby oculus » 11. May 2009 16:06

Oh my gosh! I haven't seen it. hahaha
Well, yes... you're right. I've changed it now; they're both $username now. But when I access the page, nothing appears on the browser. It becomes blank. :(
oculus
 
Posts: 18
Joined: 11. May 2009 10:16

Re: What do you think is/are error(s)

Postby Wiedmann » 11. May 2009 16:08

But when I access the page, nothing appears on the browser. It becomes blank.

Correct, the above script does not output anything to the browser.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: What do you think is/are error(s)

Postby oculus » 11. May 2009 16:13

HUWAAAT?!!!

I should have connected to the database named "contacts," shouldn't I?
oculus
 
Posts: 18
Joined: 11. May 2009 10:16

Re: What do you think is/are error(s)

Postby Wiedmann » 11. May 2009 16:21

I should have connected to the database named "contacts," shouldn't I?

No.
- You are connect to a MySQL at "localhost"
- Your current (selected) database is "db"
- You have created a table "contacts" in that database (well, i have not verified if this statement can work)
That's all.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: What do you think is/are error(s)

Postby oculus » 11. May 2009 16:23

I guess, this is affected by the following output in http://localhost/xampp/index.php

CD Collection (Example for PHP+MySQL+PDF Class)
(Requests allowed from localhost only)

A very simple CD programm.

CD list as PDF document.


Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in C:\xampp\htdocs\xampp\cds.php on line 77
Could not connect to database!
Is MySQL running or did you change the password?



I just can't figure out the error...
oculus
 
Posts: 18
Joined: 11. May 2009 10:16

Re: What do you think is/are error(s)

Postby oculus » 11. May 2009 16:26

Oh my bad! It was supposed to be "database named 'db1' not actually the 'contacts'"

I'm just following a tutorial in PHP and I have "insufficient" knowledge with regard to this... All I know is simple HTML, but it's not secured. This is why I'm learning PHP.
oculus
 
Posts: 18
Joined: 11. May 2009 10:16


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 143 guests