Jump to content

Creating Table


BREZ

Recommended Posts

Installing db i got this error..

ERROR: query failed: CREATE TABLE `form_prior_auth` ( `id` int(11) NOT NULL auto_increment, `pid` int(11) default NULL, `activity` tinyint(4) NOT NULL default '0', `date` datetime NOT NULL default '0000-00-00 00:00:00', `prior_auth_number` varchar(35) default NULL, `comments` varchar(255) default NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM

 

Error: 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 'TYPE=MyISAM' at line 9

 

So i had my first go ever at creating the table.

#1067 - Invalid default value for 'pid'

 

The only thing in "default" is NULL as the above suggests.

Link to comment
https://forums.phpfreaks.com/topic/266575-creating-table/
Share on other sites

"TYPE" is deprecated... try "ENGINE" instead?

This i dont understand.... I am a novice pensioner learning late :D

 

anyway, i left the default as NONE.

 

Now this happens..

#1067 - Invalid default value for 'prior_auth_number'

so i changed the default to NONE

Not sure if i should but now.....

#1064 - 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 'id) NOT NULL, PRIMARY KEY (`id`)) ENGINE = MyISAM' at line 1

Link to comment
https://forums.phpfreaks.com/topic/266575-creating-table/#findComment-1366172
Share on other sites

this worked

CREATE TABLE `form_prior_auth` ( 
`id` int(11) NOT NULL auto_increment PRIMARY KEY, 
`pid` int(11), 
`activity` tinyint(4) NOT NULL default 0, 
`date` datetime NOT NULL default 0, 
`prior_auth_number` varchar(35), 
`comments` varchar(255) 
) ENGINE=MyISAM

Link to comment
https://forums.phpfreaks.com/topic/266575-creating-table/#findComment-1366230
Share on other sites

Barand got ya.... I'm just gonna add this...

 

"TYPE" is deprecated... try "ENGINE" instead?

This i dont understand.... I am a novice pensioner learning late :D

 

"Deprecated" means that a particular piece of code is marked for removal.  It's highly encouraged never to use deprecated code, because upgrading could break your software.  In the case of MySQL, I believe "TYPE" was deprecated in version 5.1 and support was dropped in version 5.5?

Link to comment
https://forums.phpfreaks.com/topic/266575-creating-table/#findComment-1366240
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.