Comments (6)
Not sure, need more info, could be:
$db->query("CREATE TEMP TABLE temp.history( . . . )");
You could remove "TEMP". see https://database.guide/create-temporary-table-sqlite/
Or do:
$db->query("CREATE TABLE IF NOT EXISTS temp.history( . . . )");
How is the db connection setup?
from ezsql.
exact query is:
$db->query("DROP TABLE IF EXISTS temp.history");
$db->query("CREATE TEMP TABLE temp.history(s, id, oid, oli, p, q, qq, c, ca, t, ib, im, ibm)");
foreach ($history as $h)
{
$db->insert('temp.history', $h);
}
connection is:
use ezsql\Database; // Load ezSQL Database Class
$db = Database::initialize('sqlite3', ['./database/', 'b.sqlite3']);
$db->connect();
from ezsql.
What's $history
contents?
You should check see if the actual "$db->query(...)" returns false
, which indicates not successful/error.
Or echo $db->getLastError();
after query call.
The warning line 441 referenced is actually for some other error logged.
Also your create table is not valid as you have it. No column types, primary keys, etc...
from ezsql.
$history is:
["s"]=> string(7) "ALLINONE"
["id"]=> int(37544933)
["iod"]=> int(620365953)
["oli"]=> int(-1)
["p"]=> string(10) "214.19500000"
["q"]=> string(11) "942.45473600"
["qq"]=> string(12) "5352.56700000"
["c"]=> string(10) "12.67415903"
["ca"]=> string(3) "WHATNEXT"
["t"]=> int(1747210393384)
["ib"]=> bool(true)
["im"]=> bool(true)
["ibm"]=> bool(true)
from ezsql.
You need to supply full sample,, so far what you have is not correct.
Why you doing a for loop on $history
array?
That $db->insert(...)
should fail the way you have it, each step thru it's not filling all columns.
Look over our Tests script.
ezsql/tests/sqlite/sqlite3Test.php
Line 152 in 4bc6a25
ezsql/tests/sqlite/sqlite3Test.php
Line 98 in 4bc6a25
from ezsql.
I am assuming your issue is resolved now, reopen if not.
from ezsql.
Related Issues (20)
- Tests for JOIN needs fixing
- ezFunctions.php - Errors HOT 4
- Return 500 error while getting more than 100000 rows HOT 1
- Call to undefined function eq() HOT 3
- How to check if connection has worked? HOT 2
- Warning appears on query_prepared method. HOT 1
- Add disconnect function the can be initialized again in loop. HOT 4
- Access a query error rather than an array of errors HOT 1
- try catch with ezsql HOT 4
- Can't insert emoji in utf8mb4 table & column HOT 4
- Could SOMEone speak to ezsql lineage... HOT 1
- Deprecated: define(): Declaration of case-insensitive constants is deprecated in xxx\ezsql-3\shared\ezFunctions.php on line 189 HOT 4
- Not compatible with php 8.0 HOT 1
- $db->num_rows not working HOT 6
- lastval throws an error in postgres HOT 2
- Fatal error: Uncaught Error: Call to undefined method ezSQL_mysqli::count() HOT 1
- How to use? HOT 1
- SHOW CHARACTER SET and SET NAMES '' HOT 4
- Argument #2 ($arg) must be passed by reference, value given HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ezsql.