Quantcast
Channel: database – Tech ABC to XYZ
Viewing all articles
Browse latest Browse all 31

Cant open connection with phpmyadmin for new database [ANSWERED]

$
0
0

Cant open connection with phpmyadmin for new database

Asked By: Osadchy
Originally Asked On: 2014-01-05 22:57:13
Asked Via: stackoverflow

Try to open connection to phpmyadmin with this code: (have all time same issue – don’t see NEW database !

<?php
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "srinivas";
$prefix = "";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Opps some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");

?>

He received 1 answers
eventually accepting:

ilarsona’s answer to

Cant open connection with phpmyadmin for new database

Odviously, you have something right with mysql if you’re already using PHPMyAdmin. We won’t worry about that for now.

I would use better catches for your code. I noticed that you have the same error message for both scenarios. Such a simple like, such as this would help:

mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Oops, something went wrong WITH LOGIN");

if you feel like getting more techincal, do this:

mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Oops, something went wrong: " . mysql_error());

The last one will tell you basically exactly what’s wrong here.

If the selected answer did not help you out, the other answers might!

All Answers For: Cant open connection with phpmyadmin for new database

ilarsona’s answer to

Cant open connection with phpmyadmin for new database

Odviously, you have something right with mysql if you’re already using PHPMyAdmin. We won’t worry about that for now.

I would use better catches for your code. I noticed that you have the same error message for both scenarios. Such a simple like, such as this would help:

mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Oops, something went wrong WITH LOGIN");

if you feel like getting more techincal, do this:

mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Oops, something went wrong: " . mysql_error());

The last one will tell you basically exactly what’s wrong here.

Of course, you should really check out the original question.

The post Cant open connection with phpmyadmin for new database [ANSWERED] appeared first on Tech ABC to XYZ.


Viewing all articles
Browse latest Browse all 31

Latest Images

Trending Articles



Latest Images