PDA

View Full Version : PHP MySQL Contact Form Problem


jjplay
05-04-2011, 09:32 PM
Hello I've built my first site using a PHP contact requested form linked to a MySQL database on a hosted server (www.expeditussoftware.com (http://www.expeditussoftware.com)). When I try it out on my local test server I get this message at the top of the page:

Warning: mysql_pconnect() [function.mysql-pconnect (http://www.dreamweaverclub.com/forum/function.mysql-pconnect)]: MySQL server has
gone away in C:\xampp\htdocs\bid-lok\Connections\database.php on line
9

I assumed it might be looking for the actual database on the remote so I uploaded the files to In Motion. Now I get this message instead of a page display or anything:

Warning: mysql_pconnect() [function.mysql-pconnect (http://www.dreamweaverclub.com/forum/function.mysql-pconnect)]: Access denied for
user 'expedi11_dbadmin'@'ecbiz76.inmotionhosting.com' (using password: YES) in
/home/expedi11/public_html/Connections/database.php on line
9

Fatal error: Access denied for user
'expedi11_dbadmin'@'ecbiz76.inmotionhosting.com' (using password: YES) in
/home/expedi11/public_html/Connections/database.php on line 9

Has anybody come across this before? My database.php file in Connections folder has this:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_database = "expeditussoftware.com";
$database_database = "expedi11_BIDLOK";
$username_database = "expedi11_dbadmin1";
$password_database = "dbadmin1";
$database = mysql_pconnect($hostname_database, $username_database, $password_database) or trigger_error(mysql_error(),E_USER_ERROR);
?>

But when I tried "localhost" I basically had the same issue. Any ideas? Thank you.

edbr
05-05-2011, 12:50 AM
this is wrong
$hostname_database = "expeditussoftware.com"; it is usually localhost but the server can be called something else for example mysql.host.com but your hosting should sulpply you with that information. secondly did youu give the database permission for the user with that password?

jjplay
05-05-2011, 03:28 PM
Thanks for the reply. I've tried that in the past but Dreamweaver will only connect me to the MySQL database on the remote if I use the actual IP or domain name. If I try localhost it just creates an empty database on my local that doesn't contain any of the tables done by the client through his host c-panel. Once I finally connected to his host MySQL, I made a recordset off his tables then dropped in text fields corresponding to those field names. Not sure what went wrong.But thanks for your fast reply.