MySQL Forums
Forum List  »  Newbie

Newby-Help with connection
Posted by: David Rix
Date: August 19, 2005 04:39PM

Hi,

I have set up a dbase and table but when trying to connect get this message..

Error! Could not select the database: Access denied for user 'naturals_webmast'@'localhost' to database 'naturals_nsfnewsletter'

I have checked in cpanel and the dbase is there and OK and the db name and pwd seem correct .

Is there anything that is obviously wrong here please?

Thanks

David

This is my table..

-- phpMyAdmin SQL Dump
-- version 2.6.3-pl1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 20, 2005 at 08:26 AM
-- Server version: 4.1.13
-- PHP Version: 4.3.11
--
-- Database: `naturals_nsfnewsletter`
--

-- --------------------------------------------------------

--
-- Table structure for table `newsletter`
--

CREATE TABLE `newsletter` (
`regID` int(8) NOT NULL auto_increment,
`regDATE` date NOT NULL default '0000-00-00',
`FirstName` varchar(30) character set utf8 NOT NULL default '',
`LastName` varchar(30) character set utf8 NOT NULL default '',
`Phone` varchar(25) character set utf8 NOT NULL default '',
`Email` varchar(50) character set utf8 NOT NULL default '',
`Adr1` varchar(40) character set utf8 NOT NULL default '',
`Adr2` varchar(40) character set utf8 NOT NULL default '',
`City` varchar(40) character set utf8 NOT NULL default '',
`State` varchar(25) character set utf8 NOT NULL default '',
`Zip` varchar(12) character set utf8 NOT NULL default '',
`Country` varchar(30) character set utf8 NOT NULL default '',
`Expertise` varchar(60) character set utf8 NOT NULL default '',
`Comments` varchar(200) character set utf8 NOT NULL default '',
PRIMARY KEY (`regID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `newsletter`


This is the connection area of my php..


<?php
// editing/adding script

// get the id from the URL request
$id = $_REQUEST['id'];

if( $id )
{
// connect to the server
mysql_connect( 'localhost', 'naturals_webmast', 'starlite' )
or die( "Error! Could not connect to database: " . mysql_error() );

// select the database
mysql_select_db( 'naturals_nsfnewsletter' )
or die( "Error! Could not select the database: " . mysql_error() );
--

Options: ReplyQuote


Subject
Written By
Posted
Newby-Help with connection
August 19, 2005 04:39PM
August 22, 2005 07:41AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.