|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here! |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I am trying to set up Dreamweaver to work with my DB. I am using the phpdev build of PHP, MySQL and Apache, and for the life of me I cannot figure out what I should be putting in the connection fields in DW to make the DB connection work.
If anyone has some experience with this, please help me out. Rob
__________________
Rob |
|
||||
|
Not sure what is so special about Dreamweaver, but connecting to DB is really quite straightforward:
Try: <?php # - mysql_connect.php // This file contains the database access information. // This file also establishes a connection to MySQL and selects the database. // Set the database access information as constants. DEFINE ('DB_USER', 'username'); DEFINE ('DB_PASSWORD', 'password'); DEFINE ('DB_HOST', 'host'); DEFINE ('DB_NAME', 'dbname'); // Make the connnection. $dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() ); // Select the database. @mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() ); ?> save as defs.php or mysql_connect.php or similar, bung in an "includes" folder and then insert into your php at appropriate place, include ('./includes/yourfile.php'); Ian
__________________
SEO Specialist, CSS Developers |
|
||||
|
First you need to clarify - is your problem in the script you are coding, or are you trying to setup the testing/remote server features of DW.
If it is the latter, then the suggestions mentioned will not work, and we need a bit more information before we can offer a solution, such as any errors, what dialog/screen you are on when it happens, etc. If it is the first one I mention, then the help already offered should handle the request. Many people who are not familiar with DW will simply tell you how to make your script connect to the DB not knowing that you can connect DW directly to the DB for use during development and testing, and even use the live preview and view the live data right in the design view of DW. |
|
|||
|
I was just trying to set it up in the test environment within in DW. Went back to look at it again and get the steps to post here, and played with the settings a bit and made it work.
Writing a connection code is no problem, but I need the testing environment within DW to work too. Thanks
__________________
Rob |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |