Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Moderated Pro PHP
|
Moderated Pro PHP This is a moderated forum for discussing advanced, professional level issues with PHP. Your posts will not appear until a moderator approves them. Posts that are not the right level for this forum will be responded to and you'll be asked to post them in the [url="http://p2p.wrox.com/sql-server-2000-20/9"]Beginning PHP[/url] forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Moderated Pro PHP 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 July 31st, 2006, 09:09 AM
Registered User
 
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 'mysql_select_db' $branch="?"

"connection.php"
<?
$db_name="diary";
$connection=mysql_connect("localhost","user","user " or die("Can't connect");
$db=mysql_select_db($db_name,$connection) or die("Can't select DB");
$branch="personal"; //Table name

How if possible can i connect to a different table, i am currently using the same form in seperate directories with accompanying "connection" files.
I would like to be able to just edit the connection file, cos i use the same form field for different tables in the same database, and therefore will not need multiples of the same files on the server.

$branch="some_other_table";

I was thinking of something like using fopen() or is there some really easy way i just haven't thought of.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone from Tampines branch - Informatics pshan33 MySQL 0 November 28th, 2003 12:08 PM





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