rochelle Posted July 20, 2008 Share Posted July 20, 2008 Connection Strings Perl $dbh = DBI->connect("DBI:mysql:ssvbwect_nuke:localhost", "ssvbwect_roch","<PASSWORD HERE>"); PHP $dbh=mysql_connect ("localhost", "ssvbwect_roch", "<PASSWORD HERE>") or die('Cannot connect to the database because: ' . mysql_error()); mysql_select_db ("ssvbwect_nuke"); how do i fix it??? Link to comment https://forums.phpfreaks.com/topic/115740-whats-this-mean/ Share on other sites More sharing options...
Goldeneye Posted July 20, 2008 Share Posted July 20, 2008 That's what you would use to connect to a MySQL database. $dbh=mysql_connect ("DATABASE_HOST", "DATABASE_USERNAME", "DATABASE_PASSWORD") or die('Cannot connect to the database because: ' . mysql_error()); mysql_select_db ("DATABASE_NAME"); You just replace whatever is in capital letters with your own database details. DATABASE_HOST is usually "localhost" but it can also be a web address such as "mysql.foobar.com". Link to comment https://forums.phpfreaks.com/topic/115740-whats-this-mean/#findComment-594987 Share on other sites More sharing options...
Goldeneye Posted July 20, 2008 Share Posted July 20, 2008 Sorry, use this instead: <?php $dbh = mysql_connect("DATABASE_HOST", "DATABASE_USERNAME", "DATABASE_PASSWORD") or die('Cannot connect to the database because: ' . mysql_error()); mysql_select_db("DATABASE_NAME", $dbh); ?> Link to comment https://forums.phpfreaks.com/topic/115740-whats-this-mean/#findComment-594991 Share on other sites More sharing options...
rochelle Posted July 20, 2008 Author Share Posted July 20, 2008 WHERE DOES THAT GO??? Link to comment https://forums.phpfreaks.com/topic/115740-whats-this-mean/#findComment-594998 Share on other sites More sharing options...
Goldeneye Posted July 20, 2008 Share Posted July 20, 2008 Preferrably at the top of the page before you use anything like the following: <?php mysql_query("SELECT * FROM `table`"); mysql_error(); mysql_real_escape_string(); ?> Basically if you want to use any function that has 'mysql' in it, then you have to connect to your database before you can use those functions. Otherwise, it'll return an error. Link to comment https://forums.phpfreaks.com/topic/115740-whats-this-mean/#findComment-595001 Share on other sites More sharing options...
rochelle Posted July 20, 2008 Author Share Posted July 20, 2008 ok right so i hope thats the reason for my php nuke admin not working. So i copy that in the config?? Im new to this Roch Link to comment https://forums.phpfreaks.com/topic/115740-whats-this-mean/#findComment-595002 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.