• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

automating connection string to mysql?

Community Beginner ,
May 29, 2013 May 29, 2013

Copy link to clipboard

Copied

I've just started to venture into some of my own php scripts that don't not follow the step by step beginner tutorials. What I can't seem to understand though is how do you get dreamweaver to automatically write the script to establish a database connection.  I've connected to the database by going to  DataBase -> Connect and inputting the settings in the dialogue box.  DW acknowleges that the connection exists.  But it doesn't automatically write the code to facilitate the connection, ie

$hostname_conntest = "my_hostname";

$database_conntest = "my_db";

$username_conntest = "my_username";

$password_conntest = "my_password"; etc..

I have to first create a record set to get this connection code written and then it seems to include about 25 more lines of code that don't seem necessary for what I'm trying to do, such as inserting magicquotes formula and so on. 

does anyone know a simple one button solution to get the very basic connection settings to write to the source code of a new php doc.? 

Thank you.

TOPICS
Server side applications

Views

494

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 29, 2013 May 29, 2013

Copy link to clipboard

Copied

LATEST

I usually just put the connection details in a stand alone file and use an include file in each page which needs a database connection

<?php include('database_connection.php'); ?>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines