#36576 [Opn->Bgs]: Mysql access denied
| From: | bjori@php.net | Date: | Wed, 01 Mar 2006 18:53:43 +0000 |
| Subject: | #36576 [Opn->Bgs]: Mysql access denied | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93812@lists.php.net to get a copy of this message | ||
ID: 36576
Updated by: bjori@php.net
Reported By: jndavs at netscape dot net
-Status: Open
+Status: Bogus
Bug Type: MySQL related
Operating System: Windows XP
PHP Version: 5.1.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Erhm. Are you mixing ext/mysql and ext/mysqli.. ..and OO and
procedural?
If I understand you correctly you have one file where you connected to
the mysql database just fine - then completly diffrent file which
doesnt even try to connect?
No bug here..
Previous Comments:
------------------------------------------------------------------------
[2006-03-01 18:33:58] jndavs at netscape dot net
Description:
------------
Windows XP
PHP 5.1.2
Apache 2.0.55
Mysql 5.0.18
I wrote some code using mysquli() to connect to a Mysql database and
list the contents of a table:
$host = "localhost";
$user = "root";
$pass = "password";
$db = "database";
$mysqli = new mysqli($host, $user, $pass, $db);
$query = "SELECT * FROM table";
This worked fine, outputting the expected table data.
I added some code to insert data into the table utilising a form:
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
data: <input type="text" name="data"><br />
<input type="submit" name="submit">
</form>
$query = "INSERT INTO table (data) VALUES ('$data')";
$result = mysql_query($query) or die ("Error in query: $query.
".mysql_error());
This resulted in an error message when the submit button was clicked:
"You don't have permission to access /< on this server."
So I stripped out the form code, hard coded the data to be inserted in
the table and re executed the query:
// Data to be inserted into database
$data = "dummy";
$query = "INSERT INTO table ( data ) VALUES ('$data')";
// execute query
$result = mysql_query($query) or die ("Error in query: $query.
".mysql_error());
and was rewarded with the following Mysql message: "Access denied for
user 'ODBC'@'localhost' (using password: NO)"
Any idea what's causing this?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36576&edit=1