stephenblade
asked on
adding fields to mySOL
Am connecting using the following...
<<CODE SNIPPET>>
$dsn = "DBI:$dbDriver:database=$d bName";
$db_handle = DBI->connect($dsn, $usrName, $dbPassword);
<<END CODE SNIPPET>>
How can I add fields to the db?
::StephenBlade
<<CODE SNIPPET>>
$dsn = "DBI:$dbDriver:database=$d
$db_handle = DBI->connect($dsn, $usrName, $dbPassword);
<<END CODE SNIPPET>>
How can I add fields to the db?
::StephenBlade
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
create table addresses ( id integer not null auto increment, name VARCHAR(64), email VARCHAR(64), tel CHAR(16) );
ASKER
So what am I doing wrong? I just want to create the table right now..
$dsn = "DBI:$dbDriver:database=$d bName";
$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";
}
$dsn = "DBI:$dbDriver:database=$d
$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.
ASKER