Fix table issues
- Get rid of Y2K38 problems https://xkcd.com/607/ - This also removes default value and on-update value for the timestamp, but these were being set explicitly so no harm done. - Set the text field's character set to UTF-8. - Set the link's character set to UTF-8.
This commit is contained in:
parent
a1b4e36cf4
commit
ae6745f26a
1 changed files with 4 additions and 2 deletions
|
@ -36,6 +36,8 @@ $link = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname) or die("Error " . mys
|
|||
if (mysqli_connect_errno()) {
|
||||
die ("Connect failed: " . mysqli_connect_error());
|
||||
}
|
||||
// Set the character set for communication with the database
|
||||
mysqli_set_charset($link, 'utf8');
|
||||
|
||||
if($_REQUEST['action']=="install" && $allow_install==true){
|
||||
$sql = "DROP TABLE IF EXISTS $avpos_table;";
|
||||
|
@ -45,11 +47,11 @@ if($_REQUEST['action']=="install" && $allow_install==true){
|
|||
`webkey` varchar(36) default NULL,
|
||||
`owner_uuid` varchar(36) default NULL,
|
||||
`owner_name` varchar(63) default NULL,
|
||||
`text` TEXT default NULL,
|
||||
`text` TEXT CHARSET utf8 default NULL,
|
||||
`keep` tinyint(1) default 0,
|
||||
`count` int(5) default NULL,
|
||||
`ip` varbinary(16) default NULL,
|
||||
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
`timestamp` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE (`webkey`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue