PDA

View Full Version : database access



Andy128
03-31-2006, 04:40 AM
I am trying a program- phpMagic. This program is supposed to create a form with fields to fill in and then (via php) generate the scripts so that the information will be posted in my mySQL database that I created in c-panel.

Question- How does it know where to look for my mySQL database? Should I (and is it possible) to move the database into the same folder where the programs set up function will be run?

I am new and very green to database set up/php code etc. etc......

Thanks in advance

Andy

navaldesign
03-31-2006, 05:11 AM
It can't know. You should provide the info: database name, port (usually 3306), database table (if already existing), field names, host (usually localhost"), username and password. I don't know phpMagic, but the above are standard in all database writing programs. Have a look at this post: Trying to capture form info on database (http://www.vodahost.com/vodatalk/forms/5775-trying-capture-form-info-database.html)

Andy128
03-31-2006, 05:29 AM
naveldesign,
Good morning. My Database name is GPPINFO, Local host I assume would be my website= http://netisopen.com how do I put it all together including the username and password? Could not figure it out from the post you referenced. Example- http://netisopen.com/GPPINFO??????

One of the boxes I have to fill in for the program asks for the server- this I again assume is the http://netisopen.com

Sorry to be so dense about this.

Andy

navaldesign
03-31-2006, 05:48 AM
Host is usually "localhost" server should be http://netisopen.com

To include username and password, i suppose the program will ask you somewhere during the setup. The table and fields names should also be included. But then, again, i don't know phpMagic

Andy128
03-31-2006, 04:30 PM
Navedesign-
here is my connection string as presented in c-panel;
dbh=mysql_connect ("localhost", "andy128_andy128", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("andy128_GPPINFO");

In phpmagic I am asked to provide: Server, User name,Password,Database Name

Here is how I have provided that info:
Server = localhost
User Name=andy128_andy128
Password= ******
Database Name =andy128_GPPINFO

In your opinion- is this right? Or should server be netisopen.com:3306 ?

I know you haven't used phpmagic's program- I am just trying to get the basics that apply across the board.

Thanks again for all your help.

Andy

navaldesign
03-31-2006, 04:43 PM
Navedesign-
here is my connection string as presented in c-panel;
dbh=mysql_connect ("localhost", "andy128_andy128", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("andy128_GPPINFO");

In phpmagic I am asked to provide: Server, User name,Password,Database Name

Here is how I have provided that info:
Server = localhost
User Name=andy128_andy128
Password= ******
Database Name =andy128_GPPINFO

In your opinion- is this right? Or should server be netisopen.com:3306 ?

I know you haven't used phpmagic's program- I am just trying to get the basics that apply across the board.

Thanks again for all your help.

Andy

Don't know much about DB but i think it is correct as it is

Andy128
03-31-2006, 04:54 PM
Thanks Navedesign!

Andy