Jump to content

CREATE TABLE help


dennismonsewicz

Recommended Posts

I am trying to load a text file that contains a create table script but keep getting a weird error.

 

function create_tbl($file) {
	$report = mysql_query($file)or die(mysql_error());

	if(!mysql_error()) {
		return TRUE;
	} else {
		return FALSE;
	}
}

$create_file = readfile($xml->create->name);
create_tbl($create_file)

 

Text File contents

CREATE TABLE coxdeductible (
rowid int(11) NOT NULL AUTO_INCREMENT,
make varchar(400) NOT NULL,
model varchar(400) NOT NULL,
deductible varchar(255) NOT NULL,
published int(1) NOT NULL,
PRIMARY KEY (rowid)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11;

 

I keep getting this error:

CREATE TABLE coxdeductible ( rowid int(11) NOT NULL AUTO_INCREMENT, make varchar(400) NOT NULL, model varchar(400) NOT NULL, deductible varchar(255) NOT NULL, published int(1) NOT NULL, PRIMARY KEY (rowid) )You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '207' at line 1 

Link to comment
https://forums.phpfreaks.com/topic/196146-create-table-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.