# Config.php Help

**URL:** <https://forum.kirupa.com/t/config-php-help/258951>\
**Category:** programming\
**Created:** [April 29, 2008, 7:43pm UTC](https://forum.kirupa.com/t/config-php-help/258951 "2008-04-29T19:43:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonhardwick](https://avatars.discourse-cdn.com/v4/letter/j/c68b51/32.png) [@jasonhardwick](https://forum.kirupa.com/u/jasonhardwick)\
**Post date:** [April 29, 2008, 7:43pm UTC](https://forum.kirupa.com/t/config-php-help/258951/1 "2008-04-29T19:43:58Z")

</div>

Warning: mysql\_connect(): Lost connection to MySQL server during query in /home/content/j/a/s/jasonhardwick/html/LoginScript/config.php on line 5  
I cannot connect to the database because: Lost connection to MySQL server during query

For some reason I keep getting this error from the code below any ideas

```php
<?php 
$dbname='mycreativeadmin';
$host='p3smysqladmin01.secureserver.net';
$user='mycreativeadmin';
$dbh=mysql_connect ($host,$user,'XXXX') or die ('I cannot connect to the database because: ' . mysql_error(). '');
mysql_select_db ('$dbname') or die('I cannot select the database because: ' . mysql_error());

?>

```
