Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 7th, 2003, 10:00 PM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default config.php file (define "DSN" ) confusion

Hi,

I am trying to figure out what information it is that I need to put in this file regarding my 'DSN'.

I have the book 'PHP MySQL Website Programming', and it makes reference to a line that should be changed in my config.php file.

The book states that the following line should be changed:
 define("DSN", "mysql://root:@localhost/wrox");

The code downloaded from Wrox has different information:
 define("DSN", "mysql://admin:l3tm3in@localhost/wrox");

What is am trying to figure out is what each value represents.

I am running Windows 2000 and I have Apache(HTTP Server Version 1.3), PHP(latest version) and MySQL(latest version) installed and operational.

Any help would be greatly appreciated.

Thanks,

Paul



Reply With Quote
  #2 (permalink)  
Old July 8th, 2003, 11:43 AM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The above is just a URL, like any other URL you might be familiar with.

The full spec of a URL says that you can specify a username and password in the URL itself for accessing password-protected material. For HTTP, this covers sites where Apache is set up to use basic authentication with .htaccess files.

Simply stated, the format goes:

<protocol>://[<username>:<password>@]<host>[<path>]

The square brackets surround optional items.

Lemme break down this one for you:

define("DSN", "mysql://admin:l3tm3in@localhost/wrox");
<protocol> = mysql
<username> = admin
<password> = l3tm3in
<host> = localhost
<path> = /wrox



Take care,

Nik
http://www.bigaction.org/
Reply With Quote
  #3 (permalink)  
Old July 8th, 2003, 12:57 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I should've been more explicit: The DSN is a URL-esque identifier, it's not necessarily a URL.

For more info on the formats supported, with examples, read the manual at:
  http://pear.php.net/manual/en/packag....intro-dsn.php


Take care,

Nik
http://www.bigaction.org/
Reply With Quote
  #4 (permalink)  
Old July 8th, 2003, 07:29 PM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Thank you for your help.

Paul

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to config db connection in a DSN-less server congfuzi Dreamweaver (all versions) 4 June 27th, 2008 06:45 PM
Can I define a new xsl page inside .XML file flyfish XSLT 0 August 29th, 2005 03:33 PM
Linked Tables using file DSN Axra Access VBA 2 February 16th, 2005 02:05 PM
define location for file input tag bleitner Javascript 6 August 21st, 2004 09:47 AM



All times are GMT -4. The time now is 02:14 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.