# Add table mySQL

**URL:** https://forum.kirupa.com/t/add-table-mysql/179390
**Category:** Uncategorized
**Created:** [February 19, 2006, 7:32pm UTC](https://forum.kirupa.com/t/add-table-mysql/179390 "2006-02-19T19:32:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pbrollwitme](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@pbrollwitme](https://forum.kirupa.com/u/pbrollwitme)
#### Post date: [February 19, 2006, 7:32pm UTC](https://forum.kirupa.com/t/add-table-mysql/179390/1 "2006-02-19T19:32:51Z")

</div>

hey all,  
I’m trying to add a table to an existing database using php. This is what i’ve come up with:

```php
<?php
$dbh=mysql_connect ("localhost", "townfre_clients", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db("townfre_connecticut");
$sql= ("CREATE TABLE 'newhaven'(
ID tinyint( 4 ) NOT NULL AUTO_INCREMENT ,
name varchar( 50 ) ,
email varchar( 255 ) ,
PASSWORD varchar( 50 ) ,
address varchar( 200 ) ,
phone varchar( 50 ) ,
link varchar( 250 ) ,
renew varchar( 50 ) ,
short varchar( 75 ) ,
town varchar( 50 ) ,
coupon1 varchar( 200 ) ,
c1count varchar( 200 ) ,
coupon2 varchar( 200 ) ,
c2count varchar( 200 ) ,
coupon3 varchar( 200 ) ,
c3count varchar( 200 ) ,
category varchar( 50 ) ,
PRIMARY KEY ( id ) ,
UNIQUE id( id ) 
)");
?>

```

However, its not working, and the only error message i have received is that the user townfre\_ does not have permission . It doesn’t say townfre\_clients just townfre\_ . I’ve set the permission for townfre\_clients to all privledges. Any ideas?  
Thanks  
Mat
