473,508 Members | 2,382 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem mysql_connect with php

1 New Member
sir
i wrote the code to connect php with mysql
but it create error
CODE
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $con = @mysql_pconnection("localhost","utsavi",****);
  3. if ($con)
  4. echo("connect");
  5. }
  6. ?>
ERROR
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in E:\vnr\utsavi1\xampp\htdocs\cnc.php on line 6
Error connecting to mysql

PLEASE
send me right information & code
Mar 24 '10 #1
1 1552
Dormilich
8,658 Recognized Expert Moderator Expert
mysql_pconnection() is no native PHP function (that would be mysql_pconnect()), however, you connect through mysql_connect(), reason for that: your function fails, but by calling mysql_select_db(), it tries to open a connection with mysql_connect() using the default values.

you manage to log in as "root", not as "utsavi". obviously the two passwords don’t match.

no neet to use @ to suppress errors (that usually backfires to you in some way)
Mar 24 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
3857
by: das dsf | last post by:
Hi there! I have both PHP 4.0( RPM) installed and MySQL 4.0.20 installed with the mysqld daemon up and running. But when I look at the output of phpinfo() , I do not see it there, which is...
12
3266
by: Gustaf Liljegren | last post by:
I've been learning using PHP and MySQL from the tutorial at freewebmasterhelp.com. Everything works fine, except deleting things. The script is invoked with a URL like this: ...
1
1353
by: Bob Garbados | last post by:
I have the following sitution... MySQL version 3.23.47 PHP version 4.3.2 Redhat Linux version 7.1 Apache version 1.3.29 I have a MySQL user called 'user' that is set up with full rights for...
2
2823
by: Sugapablo | last post by:
I have a small test script connecting to a MySQL database. It seems to work, unless I try to use the resource link identifier returned by mysql_connect(); This works and returns all the rows in...
19
8090
by: Michael | last post by:
Hi, I'm trying to do something which should be very simple - connect to the MySQL database. Here is the call, followed by the error msg. $conn = mysql_connect("localhost", "root", ""); ...
6
3253
by: TonyB | last post by:
I'm running the zip'd version of PHP (PHP 5.1.2 zip package) downloaded from here: http://www.php.net/downloads.php. PHP won't connect with MySQL. >From docs and threads, it seems enabling...
8
1489
by: dude | last post by:
this is the code: $user = "user"; $pass = ""; $connect = mysql_connect('localhost',$user,$pass); or die('could not connect: '. mysql_error()); mysql_close($connect); i'm a beginer, and i...
6
3351
by: GD | last post by:
Hi All, I've got MySQL 5.0.21 running on Windows Server 2003, and php running on Apache on a Linux box (Fedora Core 4). Previously when the pages were running on an IIS server the connection...
1
1909
by: goodmann | last post by:
Paris, Le 30 08 MMVII, Hi, I have a problem using to connect to MYSQL from one server to another server. In other words, On server A, I have my PHP files, and on server B, I have MySQL...
10
1658
by: paul814 | last post by:
I am having a bit of a problem with some code....can someone give me some suggestions? Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\production \date2.php on line 28 line 28 is...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7133
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...
0
7336
Oralloy
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,...
0
7405
jinu1996
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...
1
7066
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...
0
7504
tracyyun
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...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.