Link to home
Start Free TrialLog in
Avatar of stephenblade
stephenblade

asked on

adding fields to mySOL

Am connecting using the following...
<<CODE SNIPPET>>
$dsn = "DBI:$dbDriver:database=$dbName";
$db_handle = DBI->connect($dsn, $usrName, $dbPassword);
<<END CODE SNIPPET>>

How can I add fields to the db?

::StephenBlade

ASKER CERTIFIED SOLUTION
Avatar of malec
malec

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stephenblade
stephenblade

ASKER

How do I create the table "addresses"?

create table addresses ( id integer not null auto increment, name VARCHAR(64), email VARCHAR(64), tel CHAR(16) );
So what am I doing wrong? I just want to create the table right now..


$dsn = "DBI:$dbDriver:database=$dbName";

$db_handle = DBI->connect($dsn, $usrName, $dbPassword);

if( $db_handle )
{
print "connected";
create table registrations ( id integer not null auto increment, name VARCHAR(64), email VARCHAR(64), add1 CHAR(64), add2 CHAR(64), add3 CHAR(64), bids CHAR(600));
print "Tables Created";
 } else {
print "Error";
}

see code above. 'create table' should be part of a query string that you define before preparing and executing a query.