Jump to content

whats this mean??


rochelle

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.