Closed neckarpixel closed 6 years ago
What's your $database->error()
output?
Query
$database->select("data(content)",[
"[>]users(user)" => ['content.lastmodifiedby' => 'id']
],
[
"content.id(dbid)",
"content.timestamp",
"content.status",
"content.process",
"content.description",
"content.duration",
"content.lastmodified",
"content.lastmodifiedby",
"content.paidjob",
"content.sorting",
"content.pinned",
"user.fullname(lastmodifiedbyname)",
"weekday" => Medoo::raw('WEEKDAY ( FROM_UNIXTIME( <content.timestamp> ) )'),
],
[
"weekday" => date('w',time()),
"userid" => '1',
"ORDER" => [
"content.sorting" => "ASC"
]
]
);
Error Output
array(3) { [0]=> string(5) "00000" [1]=> int(1054) [2]=> string(42) "Unknown column 'weekday' in 'where clause'" }
@dhe This error is about "weekday" in $where. Remove it, or add table name to identify from which table.
You're right: it is not possible to use a dynamic generated virtual table field inside the same query in where clause. Sorry for that issue.
Hey Cat, thanks for your great development, i really like Medoo.
Today I've noticed (while looking for the doku) that the new 1.5 version is released. But the raw() function doesn't work.
I've tried your example:
Result: blank page, even if I use the debug(), last() function.
I'm trying to run a query like that
select WEEKDAY( FROM_UNIXTIME( timestamp ) ) as weekday from table ...
with following codeAny ideas?
thx