I am beginning to re-develop a small database using PHP/MyQL; I have already sucessfully done this a year ago but no longer have access to the machine, code or credentials. It worked great! But now, I'm rebuilding it.

The test site (PHP) seems to be fine. I see no problems with the MySQL on the server.

The problem seems to be the connection between the two systems.

Honestly, I always have trouble with the smaller things such as this problem.

I am submitting data via the site, but the tables are still empty.

I'm confused at this point.

It may have something to do with this snippet:

$dbhost = sql2**.********.com;
$dbuser = b8_14160***;
$dbpass = c*******;
$port = 3306;
$conn = mysql_connect($dbhost, $dbuser, $dbpass, $port);
if(! $conn )

Any help, hint or point in the proper direction would be greatly appreciated

Thank you in advance!

4 Years
Discussion Span
Last Post by The_Thorn

The variable values, in this case, must be strings, so surround them with quotes:

$dbhost = "sql.domain.tld";
$dbuser = "username";
$dbpass = "password";

The port value can be submitted as integer, so you can omit the quotes. Anyhow, by adding mysql_error() you should be able to see the error.

Since you're rewriting the code I suggest you to switch to PDO or MySQLi libraries, because the one you're currently using is going to be removed from PHP, so check:

Edited by cereal

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.