From 523dd5e597993039706934ed6eddf70334761cf0 Mon Sep 17 00:00:00 2001
From: "Jason D. McCormick" Could not write the QSOs to the DB. Transaction
+$inserts = explode("),(", $vals);
+foreach( $inserts as $insert){
+ $insert = preg_replace("/[\(\)]/", "", $insert);
+ $sql = sprintf("INSERT INTO qsos (callsign,band,freq,rstrcvd,qsodate," .
+ "timeon,operator,station,mode,county,logid) VALUES (%s)",
+ $insert);
+ $res = $conn->query($sql);
+ if( $res === false ){
+ printf(" Individual transaction insert failed due to bad input%s
", $conn->error);
+ printf("%s
", $sql);
+ printf("Transaction ID is:
%s
Could not write the QSO transaction to the DB. Transaction
ID is:
%s
Could not unlock transaction. Transaction diff --git a/qsl.sql b/qsl.sql index 4f1bf18..0a08fe6 100644 --- a/qsl.sql +++ b/qsl.sql @@ -56,10 +56,10 @@ CREATE TABLE `qsos` ( `timeon` char(14) DEFAULT NULL, `operator` char(10) NOT NULL, `station` char(10) NOT NULL, - `mode` char(10) DEFAULT NULL, + `mode` char(30) DEFAULT NULL, `tstamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `logid` int(11) NOT NULL, - `county` char(30) DEFAULT NULL, + `county` varchar(255) DEFAULT NULL, PRIMARY KEY (`qsoid`), KEY `callsign_idx` (`callsign`) ) ENGINE=InnoDB AUTO_INCREMENT=1883 DEFAULT CHARSET=latin1; @@ -88,4 +88,6 @@ CREATE TABLE `trans` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2017-06-04 16:01:21 +ALTER TABLE `qsos` MODIFY `mode` char(30) DEFAULT NULL; +ALTER TABLE `qsos` MODIFY `county` varchar(255) DEFAULT NULL; +