Re: Still got issue with 'odbc' user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ok, your mail made me realise why it wasn't working...the variable values were being assigned above, but outside the function I was enclosing the connect etc. in, but when I moved their assignment inside the function, it now seems to work.

This database specific code is also being set apart in a separate file that am including/requiring in the other pages using the require() function, and then am calling the connectDB() function that now includes assigning values to those variables, so seems like maybe it wasn't seeing the value assignments before trying to call the function or something.

The idea behind that part of it was to allow me to make one change to database details that would still affect all the pages as such.

Thanks either way, since it's now working.

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Sascha Meyer" <harlequin2@xxxxxx>
To: "Jacob Kruger" <jacobk@xxxxxxxxxxxxxx>; <php-windows@xxxxxxxxxxxxx>
Sent: Monday, June 21, 2010 5:45 PM
Subject: Re:  Still got issue with 'odbc' user


Hi Jacob,

Jacob wrote:
Still getting the following error although now created a specific user
that granted all privileges to for the specific database, using PHPMyAdmin,
and the error returned is still the following:
(Problem: Access denied for user 'ODBC'@'localhost' (using password: NO)

I bet the MySQL connection fails because of uninitialized variables, otherwise you'd see your passed username in the error message ('root'@'localhost') instead of ODBC.
Could you try the following instead to connect to MySQL:
[CODE]
$dbServer = "localhost";
$dbUser = "root";
$dbPass = "root";
$dbName = "YOURDB";

$conn = mysql_connect($dbServer, $dbUser, $dbPass);
if ($conn){
 $res = mysql_select_db($dbName);
 if ($res){
   print "Connection established";
 } else {
   print "Selecting db failed";
 }
} else {
 print "Connection failed with ".mysql_error();
}
[/CODE]

Could you give us some more info about your file structure of your web? Especially, where are the $my... variables initialized used in the mysql_connect() call?

Best regards,

Sascha
--
Freundliche Grüße / Kind regards,

Sascha Meyer
--------------------------------------------------
EE:  http://www.experts-exchange.com/M_761556.html
ZCE: http://www.zend.com/en/yellow-pages#show-ClientCandidateID=ZEND011290

GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


__________ Information from ESET NOD32 Antivirus, version of virus signature database 5216 (20100621) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com





__________ Information from ESET NOD32 Antivirus, version of virus signature database 5216 (20100621) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux