Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Beginning PHP 5.3
|
BOOK: Beginning PHP 5.3
This is the forum to discuss the Wrox book Beginning PHP 5.3 by Matt Doyle; ISBN: 978-0-470-41396-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP 5.3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 6th, 2010, 04:01 AM
Registered User
 
Join Date: Sep 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 14 db_connection

Hi I am trying to connect to database through local-host with the below codes it does not work

<?php
define( "DB_DSN", "mysql:dbname=db_members" );
define( "DB_USERNAME", "username" );
define( "DB_PASSWORD", "pass" );
define( "PAGE_SIZE", 5 );
define( "TBL_MEMBERS", "members" );
define( "TBL_ACCESS_LOG", "accessLog" );
?>

I get warning

Query failed: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_members.members' doesn't exist


How can I make the db connection please?
Lokang
 
Old September 29th, 2010, 11:49 PM
Registered User
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This error means you need to setup the database first (MySQL-phpMyAdmin) and create a table called 'db_members.members'. After the database has been created and an empty table setup, you should be able to connect to it.
 
Old September 30th, 2010, 12:19 AM
Registered User
 
Join Date: Sep 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default thanks

thanks for the help.

I made Database and this is what I got.

Connection failed: SQLSTATE[28000] [1045] Access denied for user 'lokang'@'localhost' (using password: YES)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 14 - Try It Out p. 491 bladejay BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 August 9th, 2010 02:35 AM
chapter 14 vthunder70 BOOK: Beginning ASP.NET 2.0 and Databases 2 October 3rd, 2007 02:11 PM
Chapter 14 example pkumar@ech BOOK: Professional Jakarta Struts 0 November 15th, 2006 09:10 AM
Chapter 14 JonG BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 March 21st, 2006 10:04 PM
Chapter 14 Mike Smith BOOK: Professional C#, 2nd and 3rd Editions 2 January 4th, 2004 05:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.