You are here: What is a DataSource(Connecting to MySqL)? « PHP SQL « IT news, forums, messages
What is a DataSource(Connecting to MySqL)?

Posted by nobody on 08/21/06 03:07

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация