|
Posted by chrisv on 08/21/06 15:57
Quick question:
who is your isp?
some hosted/managed isps can have quirky database access rules. for
instance, i have several bluehost.com accounts. when i use CREATE
testdb from the command line, it is created on the bluehost 'localhost'
server with no problem. but, bluehost appends a small string from your
account name in front of my database name for their purpopses. so if
my account name is happy_blue_host_client, my 'testdb' name becomes
'happy_blue_testdb". i didn't know this at first and got serveral
script errors when i first opened my accounts. now its not an issue.
so read your isp's documentation because there could be special rules
for connecting to you mysql database.
this may be obvious, but i have to ask because i assume nothing about
you. did you replace 'username' and 'password' with the mysql username
and password you assigned to your mysql database instance?
nobody@thisaddress.net wrote:
> Hello,
>
> Im new to PHP and Databases. I created a MySQL db, installed phpMyAdmin
> and created a table and single field. I created a small PHP script. The
> PHP Script (called from a FORM action) is supposed to take the email
> field in the form and store it in the MySQL db. I obtained the
> mysql_connect()parameters from my ISP's Control Panel DBsection. However
> the PHP script is returning a "Could not Connect" message. (this is
> built into the PHP script - see snippet below):
>
> $connection = mysql_connect("localhost","username","password");
>
> if (!$connecttion) {
> die ("Could not connect: " . mysql_error());
> }
> echo "Connected";
>
> My ISP mentioned I might need to create a datasource to connect to the
> db. I found some info in their knowledge base, and started to creat one.
> I created a dataSource name, and It generated a text string in the form:
>
> "dsn=datasourcename;uid=XXXX;password=XXXX"
>
> I placed the string in the mysql_connect() Statement but it isnt
> working. Is there a special statement in PHP for DataSource Names? What
> is a datasource and why do I need one? Why aren't the original supplied
> parameters sufficient? Thank you for your time and words for this
> database newbie.
>
> George
>
> P.S. No answers from my ISP provided DB forum so I fiigured I try here.
>
>
> -------------------------------
> http://www.gpalzproductions.com
>
> "The world is full of Kings and Queens who blind your eyes and steal
> your dreams. Its Heaven and Hell!" - Ronnie James Dio
Navigation:
[Reply to this message]
|