i hav downloaded php script from a site but while running it gives error
Access denied for user 'ODBC'@'localho st' (using password: NO) in C:\wamp\www\for um\db.class.inc .php on line 29
i use this for my connection and works well
$conn=mysql_con nect("localhost ","root","" );
while this doesnt work
function db($localhost=' localhost',$dat abase='ncstd',$ username='root' ,$password='')
kindly help as i m new to php
7 6551 Dormilich 8,658
Recognized Expert Moderator Expert @kkshansid
then you should check, whether db() works correctly.
- function db($localhost='localhost',$database='ncpul1',$username='root',$password=''){
-
$this->localhost=$localhost;
-
$this->database=$database;
-
$this->username=$username;
-
$this->password=$password;
-
$this->conn=mysql_connect($this->localhost,$this->username,$this->password);//line29
-
mysql_select_db($this->database,$this->conn);
-
}
i dont think there is any error in this function
Dormilich 8,658
Recognized Expert Moderator Expert
just to make sure… how do you call db()?
on index page after including connection file function call as - $db=new db($DB_LOCALHOST,$DB_DATABASE,$DB_USERNAME,$DB_PASSWORD);
Dormilich 8,658
Recognized Expert Moderator Expert
is $DB_USERNAME a variable or a constant?
Markus 6,050
Recognized Expert Expert
In your first example, you say it works when user = root. However, the error is saying that you're connecting as 'ODBC' (I assume that's no username). So you're doing something wrong.
Dormilich 8,658
Recognized Expert Moderator Expert
I suspect that’s the username used when no username ("", null) was given. if the username is indeed saved as DB_USERNAME (you* hardly name variables uppercase) it would be the explanation.
* at least the ones who read the naming convention
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Savas Ates |
last post by:
in asp page
im getting this error how can i solve it..
yesterday the codes work but i setup visual studio 6.0 now it doesnt
works..
|
by: Ryan Schefke |
last post by:
------=_NextPart_000_0077_01C34C8B.2B90C960
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
..I just sent this out to the win32 distribution list but no one has
replied.can someone on this list please help? The issue should be
trivial for experienced MySQL users, I'm just a novice, thanks!
|
by: Ike_strong |
last post by:
Can anyone help me to figure out why each time I
try to access my database using:
c:\mysql\bin\inmysql -root -p
and afterwards:(i.e. after inputting my at the password prompt)
Enter Password: '******'
I get the following:
|
by: greg_s_007 |
last post by:
Just wanted to share a solution I found to this common problem that I
have not yet seen posted.
I am in the process of migrating an application from NT/IIS 4.0/SQL 6.5
to Win2003.
The SQL server and ASP web application are on separate servers in an NT
domain. While migrating the web app to a Windows 2003 server (which is
not in the domain), I was unable to connect to the database via ODBC
using named pipes.
|
by: Xerxes |
last post by:
Hi,
I would like to import the tables from MySQL database into Access
database and I am not sure how to go about it. I tired to "Import
External Data" from Access, selected "ODBC database" from file type
dropdown, selected "New data source" and picked SQL Server from the
list. I specified the server name (mydomain.com) along with user id
and password. But when I clicked on "Next", I got: "connection failed:
SQL Server Error:10060,...
| |
by: ASP.Confused |
last post by:
I have an ASP.NET page writtein in VB that uses ADODB. I just had to
force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host uses
this, and I wanted to be compatible with them.) I had to manually install
all of the ODBC drivers and the rest of the DLL's, and now I am getting
"Access is Denied" errors on any page that uses ADODB.
How do I fix it? I already gave the ODBC drivers in the folders in
"c:\program files\common...
|
by: ASP.Confused |
last post by:
The old message looked a little stale, so I am re-posting it here. Anybody
have any ideas of what I could do?!? The previous responses to this
question are below. If you want to look at the original question, the
subject line is:
ADODB.NET and "Access Denied"
I have an ASP.NET page writtein in VB that uses ADODB. I just had to
|
by: SKB |
last post by:
Hi,
I am absolutely new to this area. I am getting the following difficulty
:
Access denied for user 'ODBC'@'localhost' (using password: NO)
when I try the mysql command from within the C:\Program
Files\MySQL\MySQL Server 5.0\bin on the command window.
Please note that the MySQL is runnging as I have tried the command NET
START MySQL and it gives the following output:
The requested service has already been started.
More help is...
|
by: jolinlim |
last post by:
Warning: mysql_connect(): Access denied for user: 'ODBC@localhost' (Using password: NO) in c:\appserv\www\sql.php on line 12
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in c:\appserv\www\sql.php on line 13
Warning: mysql_query(): Access denied for user: 'ODBC@localhost' (Using password: NO) in c:\appserv\www\sql.php on line 14
Warning: mysql_query(): A link to the server could not be established in...
|
by: lisles |
last post by:
i have a page funtion.php which hs the function to connect to the db
/* Mysql Connection */
function connect(){
global $db_server,$db_user,$db_pass,$db;//Global Values from the config.php
$conn = @mysql_connect($db_server,$db_user,$db_pass) or die("Connection to Database Server Failed");
@mysql_select_db($db) or die("Database Selection Failed");
return $conn;
}
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |