When trying to run the below script on an apache/1.3.26 with mysql and
php I get the following error message:
Warning: mysql_connect() [function.mysql-connect]: Access denied for
user: 'n*****@software-ece.rutgers.edu' (Using password: YES) in
/ece/under/group14/public_html/insert.php on line 7
Unable to Select database
I have no idea what the cause is, any help would be appreciated.
Thanks in advance.
<?
$username = "group29";
$password = "xxxxxx";
$database = "group29";
mysql_connect('software-ece.rutgers.edu:3306',$user,$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(30) 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();
?> 3 49521
That error means that the database group29 doesn't exist. Check your
database names.
"photoelectric" <lu*******@aol.com> wrote in message
news:a9**************************@posting.google.c om... When trying to run the below script on an apache/1.3.26 with mysql and php I get the following error message:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'n*****@software-ece.rutgers.edu' (Using password: YES) in /ece/under/group14/public_html/insert.php on line 7 Unable to Select database
I have no idea what the cause is, any help would be appreciated. Thanks in advance.
<? $username = "group29"; $password = "xxxxxx"; $database = "group29";
mysql_connect('software-ece.rutgers.edu:3306',$user,$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(30) 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(); ?>
In article <a9**************************@posting.google.com >, photoelectric wrote: Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'n*****@software-ece.rutgers.edu' (Using password: YES) in /ece/under/group14/public_html/insert.php on line 7 Unable to Select database
So it says that the user nobody@host is not allowed to use $database.
<? $username = "group29"; $password = "xxxxxx"; $database = "group29";
mysql_connect('software-ece.rutgers.edu:3306',$user,$password);
Should be $username instead of $user.
Just as with mysql_select_db below, you could write
mysql_connect('host','user','pass') or die (mysql_error());
-- http://home.mysth.be/~timvw
"Tim Van Wassenhove" wrote $username = "group29";
[...] mysql_connect('software-ece.rutgers.edu:3306',$user,$password);
Should be $username instead of $user.
....which the original poster would have easily detected when enabling a
stricter syntax, either in code, per-directory in Apache's .htaccess or even
globally in php.ini: http://php.net/errorfunc
Adriaan This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
by: George Hester |
last post by:
Please take a look at this google artcle:
http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9
The op was having trouble with...
|
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...
|
by: servo |
last post by:
I created a user "test1" (which then got the username "debscrof_test1" from CPanel), a password for the user "test2", and then added the user to a new database "testdb" with all priviliges
Then a...
|
by: vozzek |
last post by:
Hi all,
I've got a mySQL database I've been working with as my localhost for several months now, no connection problems. I'm at the point however, where I need to connect to the database from...
| |
by: sbettadpur |
last post by:
hello
I am getting following error while connecting to mysql through php
Warning: mysql_connect() : Access denied for user: 'pds@localhost' (Using password: YES)
Actually I hosted one...
|
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...
|
by: Joel Phelan |
last post by:
I am getting the below error when attempting to run a php script on my server which accesses a mysql table I have created in an existing database. I can connect to the database table via the MySQL...
|
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,...
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
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...
| |