Forum Moderators: coopster

Message Too Old, No Replies

copying php/mysql problems

php and mysql and phpmyadmin

         

rcw13

7:57 pm on Oct 14, 2003 (gmt 0)



I'm having trouble with a new database I create in phpmyadmin as a copy from another database. I made duplicate copies of all the php files accessing the database and renamed them to source the new database but it's not connecting. The old existing database and files are still running properly so I'm not sure what I missed. I have an open_db_inc.php file that sources the database. The actual table is sourced in my other php files.

<?php
$link = mysql_connect("", "", "") or die("Could not connect");
mysql_select_db("") or die("Could not select database");
?>

Do I need to try to do anything different on the mysql_select_db("") statement. It worked on my original using it this way. (I'm on a Windows server.)

coopster

8:50 pm on Oct 14, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



mysql_select_db() sets the current active database on the server that's associated with the specified link identifier. If no link identifier is specified, the last opened link is assumed. If no link is open, the function will try to establish a link as if mysql_connect() was called without arguments, and use it.

Check the post by coopster on this thread
[webmasterworld.com...]
The first few lines show how to make a connection to your database.