Hi, I am new with MySQL!
I have created now a small PHP class to create two tables in my database, but when I run it, I got following error message:
Call to a member function Execute() on a non-object
Can somebody have a look and explain what I missed or made wrong!
Here come my class:
<?php
error_reporting(E_ALL);
include('adodb5/adodb.inc.php');
include('adodb5/adodb-active-record.inc.php');
try {
$db = NewADOConnection("mysql://$user:$pwd@$server/$db?persist");
$db->Execute("CREATE TABLE 't_vehicle' (
'id' int(20) NOT NULL auto_increment,
'manufacturer' varchar(50) unsigned NOT NULL auto_increment,
'model' varchar(50) NOT NULL default '',
'color' varchar(50) NOT NULL default '',
'price' varchar(50) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
");
$db->Execute("CREATE TABLE 't_vehicleoptions' (
'id' int(20) NOT NULL auto_increment,
'model' varchar(50) NOT NULL default '',
'airbags' int(1) default NULL,,
'aircondition' varchar(3) NOT NULL default 'NO',
'radio' varchar(50) NOT NULL default '',
'snowtyre' varchar(50) NOT NULL default '',
PRIMARY KEY ('id')
) ENGINE=MyISAM;
");
} catch (exception $e)
{ var_dump($e);
adodb_backtrace($e->gettrace());