So what I've been doing is going in through phpmyadmin, dropping the table, and then reinstating it with the following commands.
first I drop the table
Code: Select all
DROP TABLE `tlb_itemdetail`Code: Select all
CREATE TABLE `tlb_itemdetail` (
`vItemCode` int(6) NOT NULL auto_increment,
`cat_id` int(11) NOT NULL default '1',
`txProductTitle` text NOT NULL,
`dPrice` double(6,2) NOT NULL default '0.00',
`iWeight` int(6) NOT NULL default '0',
`iVolume` int(8) NOT NULL default '0',
`ebayPrice` double(6,2) NOT NULL default '0.00',
`txHtmlCode` text NOT NULL,
`vProductImage` text NOT NULL,
`vCertificateImage` text NOT NULL,
`vVolumetricImage` text NOT NULL,
`vProductImage_Thumb` text NOT NULL,
`vCertificateImage_Thumb` text NOT NULL,
`vVolumetricImage_Thumb` text NOT NULL,
PRIMARY KEY (`vItemCode`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Code: Select all
$sql1="DROP TABLE tlb_itemdetail";
$drop = mysql_query($sql1);
if ($drop) $dropstatus=1; else $dropstatus=0;
$sql2="CREATE TABLE `tlb_itemdetail` (
`vItemCode` int( 6 ) NOT NULL AUTO_INCREMENT ,
`cat_id` int( 11 ) NOT NULL default '1',
`txProductTitle` text NOT NULL ,
`dPrice` double( 6, 2 ) NOT NULL default '0.00',
`iWeight` int( 6 ) NOT NULL default '0',
`iVolume` int( 8 ) NOT NULL default '0',
`ebayPrice` double( 6, 2 ) NOT NULL default '0.00',
`txHtmlCode` text NOT NULL ,
`vProductImage` text NOT NULL ,
`vCertificateImage` text NOT NULL ,
`vVolumetricImage` text NOT NULL ,
`vProductImage_Thumb` text NOT NULL ,
`vCertificateImage_Thumb` text NOT NULL ,
`vVolumetricImage_Thumb` text NOT NULL ,
PRIMARY KEY ( `vItemCode` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =1";
$add = mysql_query($sql2);
if ($add) $addstatus=1; else $addstatus=0;
$sql3="INSERT INTO tlb_itemdetail(cat_id,txProductTitle,dPrice,iWeight,iVolume, ebayPrice,txHtmlCode,vProductImage,vCertificateImage,vVolumetricImage,vProductImage_Thumb,vCertificateImage_Thumb,vVolumetricImage_Thumb) VALUES('$cat_id','$txProductTitle','$dPrice','$iWeight','$iVolume','$ebayPrice','$txHtmlCode','$vProductImage','$vCertificateImage','$vVolumetricImage','$vProductImage_Thumb','$vCertificateImage_Thumb','$vVolumetricImage_Thumb')";
$res = mysql_query($sql3) ;
if($res) $newproductstatus=1; else $newproductstatus=0;