« first day (3703 days earlier)      last day (1238 days later) » 
00:00 - 22:0022:00 - 00:00

12:04 AM
@IluTov it's slightly weird to have type name be something that isn't legal as a class name...
 
@Danack Felt the same at first. The big advantage is that it can't clash with any user-defined type.
Also, autoloading. Given that Foo::Bar itself is a type (we're still unsure about this part) the autoloader could understand that it needs to look for a file called Foo.php, not Foo/Bar.php (if we were to have used Foo\Bar instead).
 
12:23 AM
Looks like I need to record some podcasts soon... even though I don't want to release them until 2021
!!rfcs
 
12:47 AM
blaming @PeeHaa intensifies
2
 
@IluTov re: enums, it's nit-picky but I'd expect a reflectionenum getType call to return a ReflectionType, rather than a string name
 
1:08 AM
@MarkR I was mostly just going by gut for that section. If it's more conventional with the rest of the reflection API to return a ReflectionType, I'm good with that.
 
1:45 AM
Having methods but no state seems weird: wiki.php.net/rfc/enumerations#enumerated_case_methods.
I do not like this, Sam I am.
I still think using objects for these simple enums is the fundamentally wrong model.
These seem conflicting:
> A Primitive-Equivalent Case will automatically down-cast to its primitive when used in a primitive context.
> Passing a Primitive Case to a primitive-typed parameter or return will produce the primitive value in weak-typing mode, and produce a TypeError in strict-typing mode.
ReflectionEnum::getType() needs to return ReflectionType|null. This is invalid inheritance.
The outlined behavior should probably be getUnderlyingType(), but should probably still return ReflectionType|null, not string|null.
Err, I guess ReflectionEnum::getType() isn't invalid inheritance; no getType on ReflectionClass. I still think getUnderlyingType is better than getType.
> Should it be possible to type against a specific enum case?
Is Suite::Heart an object, or a type? If the answer is the latter, then yes it should be allowed. If it's the former, then no it shouldn't.
The only blurry part there is new $class() where $class is an object. The only legitimate use for such functionality is anonymous classes, but I think the way that got implemented was a mistake. Oh well, too late.
> Because they are objects, enum cases may not be used as keys in an associative array.
I think that answers the former question: they are objects.
/cc @Crell and @IluTov
 
2:02 AM
@LeviMorrison It is both - (singleton) object and type
 
 
1 hour later…
3:15 AM
PHP returns static when expecting self ・ Class/Object related ・ #80487
 
 
3 hours later…
6:22 AM
@Crell @IluTov enumerations look really nice, kudos
 
7:01 AM
@Danack @IluTov isnt there precedence for illegal class names in anon classrs using @?
 
 
2 hours later…
8:34 AM
morns
 
Wes
8:50 AM
porns
 
oh yeah, thats the stuff :p
 
 
1 hour later…
10:19 AM
o/
 
10:48 AM
@LeviMorrison Agreed. Created a Github issue for discussion: github.com/Crell/enum-comparison/issues/35
@LeviMorrison @JoeWatkins @beberlei Thanks for the feedback!
@beberlei Yes. 3v4l.org/6UEGQ I forgot about this, this eases my mind a bit.
 
11:07 AM
Getting this error for attributes in PHP 8
https://3v4l.org/TLXJT
 
@Exception 3v4l.org/Y9Csg you can't add attribute itself on non-classes. You have to create your own attributes. Attribute itself marks classes as attributes.
Also, if you want to add attributes to the constant you'll have to look for the attributes on ReflectionClassConstant 3v4l.org/RkE9Y
 
11:27 AM
@Crell reddit.com/r/PHP/comments/k6w74p/rfc_enums So, the primary criticisms seem to be: 1. per-case methods 2. not being able to use them as array keys (in this RFC). As mentioned I have mixed feelings on per-case methods myself. I can investigate point 2 to see how easy it is to implement (likely not easy). Other than that people seem to like it.
 
Are we married to the keyword case?
I love the thing otherwise, but that keyword is an eyesore
 
@DaveRandom nice work my man. Was it just trial/error to work that out, or did you get confirmation from someone who worked on it?
@Wes is that like Badger Badger Badger, but php?
 
Wes
MUSHROOM MUSHROOM
 
what as in mushroom cloud?
on an unrelated note, I spend most of today starting to build a workbench in the shed... I came inside and remembered the components for an eGPU turned up today, so I guess I know what I'm doing tonight
 
@beberlei yes. But is that an argument for or against that pattern?
 
11:53 AM
@IluTov although enums are going to be class based as an implementation detail, what's the actual use case for needing to support get_class(Foo::Bar);? aka, would hiding that they are based on classes stop useful things from being done with them?
@IluTov For supporting using them as array keys, would it be an okay trade-off to require that only primitive backed enums can be used like that?
 
12:46 PM
@Danack What do we gain from hiding the fact that they are objects? The possibility to swap out the implementation I guess, but is that realistic anyway (with the current feature set)?
@Danack So just use the primitive value as a key? I guess, yes. But then also we'll have a BC break if we want to allow storing the actual object as a key because suddenly it won't convert to the primitive value anymore.
 
1:02 PM
@IluTov Thankyou so much for the example.
@cmb Thanks
 
@IluTov IMO the enums as array keys issue screams as one of those "if we don't get it right the first time we're going to spend 20 years trying to work around it because of BC" issues.
 
@IluTov not currently feasible, but long term maybe.
 
1:27 PM
A primitive backed enum in PHP terms (types only checked when passing through gateways) could just be a list of allowed values, could it not?
 
Is there a way to do this:
```class foo {
const BAR = 0;
const FIZZ = 1;
public static $BUZZ = array($this::BAR, $this::FIZZ);
}```
 
self:: probably.
 
Morgebs
 
@PeeHaa Mornin
 
oh! Thank you!
It has been so much time I completely forgot about it
 
1:37 PM
I remember the first time I realised you could do public const BUZZ = array(self::X, self::Y) O_O ... that was after 10 years
 
@MarkR isn't that incompatible with PHP 5.x?
 
@yessure Perhaps, but my wellbeing is incompatible with PHP 5.x so I ignore it :)
 
I love a good create_function(), me
 
I think I realised it was possible around PHP 7.1ish but I've not gone back to see when it was introduced as I always try to stick to the official releases, so entirely possible it wasn't supported until 7.0
 
const arrays were 5.6 I think, so probably then
not sure if the self:: reference would have been possible until AST with 7
 
2:06 PM
@MarkR possible since PHP 5.6
yeah like Chris says :-D
 
@yessure There you go :-)
Thanks Dave, Bob
 
2:17 PM
PHP 8 release page has a parse error in the provided example.
https://www.php.net/releases/8.0/en.php#constructor-property-promotion
Check the third parameter passed in the constructor for PHP7
a comma at the end LOL
 
Why would that be wrong?
Ahh PHP 7 you say
 
Yeah!
 
Yeah, it looks like someone made a typo
Can you suggest a PR, please?
 
I don't know how to do that. You can go ahead and do that, please.
Also, I check the example provided for the Attributes page below

https://www.php.net/manual/en/language.attributes.overview.php

and I found a similar error at line no 42.
$attributes = $reflection->getAttributes(SetUp::class)
 
Nice find. Also that @ should be removed
 
2:25 PM
@IluTov Twitter seems to generally approve, too.
 
@Dharman yep
 
@IluTov Any objection to changing ReflectionEnum::getType to return a ReflectionType instead of a string?
 
2:45 PM
@Crell Go ahead 🙂
 
Question from the list: ` Suit::Spades instanceof Enum` - Is that a thing? I don't recall if there was a base Enum class in the implementation.
 
3:03 PM
@Crell Nope there's no enum base class.
 
Should there be one?
 
Yes, yes there should.
 
(I think it would be useful.)
 
@MarkR why? What does it provide?
 
ORMs and related need a way to know to call ::from or whatever it is
 
3:04 PM
"Is this variable I'm holding an enumeration?" instanceof Enum is a simple way to achieve that.
 
@MarkR Aren't ORMs generally passing by method calls
 
I think we probably will need a value() method on primitive cases, too. But if it's only on primitives, then there probably needs to be a PrimitiveEnum type check as well. And of course now it gets complicated. :-)
 
@MarkR not all enums have thought. Adding an interface for scalar backed enums could make sense
 
@Crell that could potentially be an interface?
 
@DaveRandom An internal Enum interface rather than base class? 6 of one, half dozen of the other at that point, I think.
 
3:06 PM
actually they both could, unless they have static methods
 
@PeeHaa Not when doing the data mapping to / from the row
 
@MarkR Which one does that?
 
@Crell yes and no, the interface does not mandate a common base implementation
 
My gut sense is that a base implementation would be useful for cases() and values(), though I defer to Ilija on what makes sense in C since it doesn't always translate from userland.
 
they could still have a common base implementation, they just wouldn't be required to
 
3:11 PM
It's all in the engine anyway, so it's not like users would know the difference.
 
@Crell common base objects/classes are awful imo, for reasons that are hard to express, other than 'inheritance is shite'. btw I can't see in RFC what does gettype(Suit::Diamonds) and gettype(Suit), return?
 
90% of the time I'd agree. But sometimes you're in the other 10%.

gettype() would, I think, return "object". Right, @IluTov?
 
@Crell But what is that useful for?
 
it doesn't seem like it should be impossible just because you can't think of a use case right now
 
@Crell Yeah.
 
3:18 PM
as per chat.stackoverflow.com/transcript/message/51087843#51087843 I think maybe hiding that they are implemented as objects might be the right thing to do. Unless it isn't of course...
helpful message of the year nominee
 
@IluTov As noted, ORMs. So they know if there's a value() method (which we really should add) they need to use, or similar.
 
Ugh I hate this chat, why does esc irreversibly delete what you just typed???
 
@Danack The problem with folding enums to their primitive in an array key is that you lose the fact that it's an enum. If you then foreach() over it, your key is now a primitive, not the enum.
 
yeah.
 
@DaveRandom It might be more consistent to add a function enum_exists analogous to traits and interfaces. I could definitely see a use for PrimitiveBackedEnum (or what have you) that define static from() and value().
On another note, I'd prefer value { get; } but I'm assuming accessors won't be ready in time...
 
3:23 PM
@IluTov I know where you are coming from, but also it's already really annoying that you have to do class_exists() || interface_exists() || trait_exists(), afaik there is still no symbol_exists()... I'd rather not make that problem worse...
 
Why Before PHP 8 int and String were not used as type hint in the arguments? Because they are not Classes? OR because they are scalar types?
 
@Exception because scalar types were only introduced for 7 - wiki.php.net/rfc/scalar_type_hints_v5
 
like I can understand not wanting to use inheritance for it, but there should either be an instanceof route or an is_enum() function, for consistency if nothing else
 
@Danack So you are saying that adding them into scalar types makes them useful in type hint declaration?
 
@DaveRandom I can see that argument. How about class_exists returning true for enums and a separate is_enum function? I'm also ok with a marker Enum interface (although not sure it could be called Enum because of the keyword?).
 
3:28 PM
class_exists() returning true would be inconsistent
 
@Exception I'm saying that: i) they are types, not 'hints' ii) type systems are useful iii) type systems that cover primitive types as well as classes. These things took PHP internals 20+ years to come to accept.
 
I think there probably does have to be an enum_exists() function, annoyingly
ffs
and yes I think you are right about the base type @IluTov, it feels wrong to have to do enum_exists(get_class($obj)) but there is no precedent for this, it doesn't apply to interfaces or traits because you don't instantiate those in the same way
I really really really would like symbol_exists() to be added, or some kind of shorthand way to check if a name exists in the ce table
 
Does PHP manual follow any coding standards e.g. PSR?
For example when writing an example of a class definition, should the { come on a new line of on the same?
At the moment manual uses both styles interchangeably.
 
@Dharman In theory, PEAR circa 2000. In practice, please be consistent within a given page but otherwise it's not consistent.
 
3:37 PM
@Dharman Try to be consistent, anyway... :-)
 
@Crell it's better to be consistently inconsistent, than inconsistently consistent..
 
3:53 PM
@Exception I created PR like you asked. github.com/php/web-php/pull/379/files
 
@IluTov If we add value(), what does that do on non-primitive enums? Not exist? Error? random_int()?
 
itself?
 
@IluTov github.com/Crell/enum-comparison/issues/40 - Interesting question from stof. I think right now they'd pass that type check, yes?
 
4:15 PM
@Crell method not defined
 
Then we'd need a way to type check that an enum has primitives.
 
@Crell IMO yes.
 
@Dharman cool.
 
Thinking aloud:

if ($var instanceof Enum) {
  if ($var->enum::type() == 'primitive') {
    $var->value();
  }
}
Not sure I like that.
 
@Danack yeah! very long time they took. kind of slow brainer?
 
4:19 PM
if ($var instanceof Enum && $var instanceof ScalarEnum) {
return $var->value();
}

I like that better.
Also, I think I like "Scalar Enum" better than "Primitive-Backed."
 
@Exception 'smooth brain' is slightly more accurate......and mean.
 
haha yes but too slow can kill the patience level ;)
 
Thinking ahead:

interface Enum
interface UnitEnum extends Enum
interface ScalarEnum extends Enum
interface TaggedEum extends Enum
 
4:33 PM
@IluTov ^^ Thoughts?
Although perhaps we need UnitEnumCase, not UnitEnum? I guess no, since the enum itself cannot be instantiated...
 
4:44 PM
I see that the PHP website uses boolean HTML attributes in this way: selected="selected" Why is that?
 
It was coded back when people cared about XHTML compliance. As God Intended(tm).
 
I am looking at the new PHP 8 page
Which was coded I assume few weeks ago
 
Probably because it was written by people who still care about XHTML compliance even if the rest of the world doesn't. ;-)
(I still always include a trailing / in my br tags.)
 
Even I did until not so long ago, but it is just verbose for no reason.
 
@Crell interface Enum probably wouldn't work because of the keyword as $foo instanceof Enum would be invalid syntax, or at the very least require some hacks to get working.
@Crell Since each case is a subclass of enum they'd automatically also "inherit" the Enum interface...
 
4:58 PM
hm.
Then what about:

interface EnumCase
interface UnitEnumCase extends EnumCase
interface ScalarEnumCase extends EnumCase
interface TaggedEumCase extends EnumCase

All available on the case only; there's nothing on the Enum itself.
 
5:12 PM
Hey @Danack. Are you up for a quick light zoom/conference call by any chance?
 
@PeeHaa yeah, in say 20 minutes time?
 
Cool cool <3
 
@IluTov ^^
 
@Dharman You seem to be questioning a lot of "why" it has been done x way, which I honestly wouldn't bother too because from my understanding not many people deal with the web side of the PHP project and just follow what was done before, to be somewhat consistent
 
It's the way a human learns. If I am told to repeat the mistakes of my predecessors then I will, otherwise I will keep up with modern standards and then introduce an inconsistency in the project.
 
5:30 PM
I believe inventions happen because we ask the question Why? &
Questions also get solved when we run behind "Why".
:)
 
@Crell Maybe I missed it, but what's the point of these "type tags" instead of making it available through reflection?
 
@LeviMorrison Ease of use. And possibly some performance. The reflection API is not particularly use friendly and involves at minimum many more stack calls to do anything.
 
Sure, but why would you need this unless you are doing some kind of reflectiony task anyway? That's what I'm really asking, I guess.
 
ORMs were mentioned before as a use case. The other would be "is this a thing I need to down-cast from an enum before I can stick it in a DB."
 
Hello world!
 
5:40 PM
@Crell To me, this is exactly the kind of thing reflection should be for...
 
^ the man has a point
 
@Crell I already asked, but what ORM?
As @LeviMorrison said. They generally do not work on methods
 
@PeeHaa eta?
 
I can come and dance naked as a screen saver while you wait
 
@PeeHaa I haven't written many ORMs, so hard for me to say. :-) I'm repeating what was above.
 
6:14 PM
@cmb where do one need to add version info for the Attribute page? php.net/manual/en/language.attributes.overview.php
 
the hero of the claw machine
 
@Tiffany oh yeh I remember that at the time
 
Thanks :)
 
@Crell i expext ReflectionEnum::getValue to work like ReflectionProperty::getValue from ORM perspective
But i need a way to differentiate between a value/object that is a case of an enum and those that are not
 
enum_exists(get_class($obj)) would suffice though, presumably?
 
Maybe my thoughts are bogus
 
6:37 PM
of all of the people in this room you are probably the most qualified to talk about ORM :-P
 
@beberlei If we only allow fetching the primitive value through reflection maybe we don't need special syntax at all. Attributes would suffice.
 
I would not expect to have to use reflection to convert enum to int or vice versa
 
yes my generic wish would be is_enum($value) $value->asPrimitive(); or something
you need to convert enums to strings for HTML as well
 
@beberlei Ok. Yeah ->value() was something I was always assuming but failed to notice we didn't actually write it down in the RFC.
 
Thanks for your time @Danack. Always good to see you :) <3
 
6:52 PM
The RFC mentions coercion but in strict mode that won't happen anyway. So you need a way to convert it to the primitive value explicitly.
 
as for $value instanceof enum being a fatal error, that is just bcause enum is a keyword, but if it becomes a class or interface in global namespace, it wouldnt need to be a keyword anymore
 
@beberlei Enum being a keyword is a parser thing. I might be able to add T_ENUM to the class_name non-terminal (that seems to work without conflicts).
 
@PeeHaa @Danack indeed, thank you!
 
@IluTov I'm against only allowing the scalar to be fetched via reflection. :-)
I want to ensure most users don't need to mess with reflection.
 
what is the value of a paramterized case?
 
7:01 PM
@Crell Ok, so is ->value() ok?
 
A TaggedCase wouldn't have one the way a ScalarCase does.
@IluTov Yes. I'll add it to the RFC.
 
@beberlei I think Swift is closest to what we're doing. They don't allow mixing raw values with associated values. When you have associated values the raw value is no longer a full / unique representation of the enum case.
enum Foo: Int {
    case Bar(String) = 10;
}
// error: enum with raw type cannot have cases with argument
(This is Swift syntax, not PHP)
 
yes but how does a parametrized enum serialize?
 
The same as any object with properties.
 
get_object_vars($enum)?
 
7:06 PM
I presume that would work. Or serialize($enum).
 
but how is the case represented in that?
 
The reason we're using objects under the hood is because in most cases "it does what objects do" is then the default answer.
 
@beberlei Our ADTs have mandatory names for the assoc values (Swift does not, they can also be handled positionally) so we're just converting them to properties that go on the given case class.
@beberlei Each case has its own class.
 
so essentially get_class($enum) + get_object_vars($enum) (in case of publc properties) would give me all data i need to store and reconstruct?
 
I believe so, yes. Give or take the specific syntax (which we can fiddle with to make sure it's as clean as feasible).
 
7:09 PM
@Crell I'm glad you're here to handle the mailing list situation, that was a nightmare to me for the last proposals ^^
(I have a pretty short attention span)
 
heh. I may still want your input on a number of the questions.
 
@Crell That's fine ^^ It was more about handling the same questions / being overwhelmed with feedback.
 
@IluTov Should I just tag you on parts that you should respond to, or ask here before responding?
 
But coincidentally never the feedback I needed.
@Crell If there's something you're uncertain about or something we haven't thought of / talked about I'd say create an issue on GitHub and respond whatever you feel makes sense. Nothing we say in the mailing list should be taken as final or absolute.
 
Roger.
You're still reading the thread, right? :-)
 
7:17 PM
@Crell No comment :P
Haha I haven't been too focused today but I'll make an effort to stay on top of things.
 
@Ekin np. it might actually be moot now, but it was still listed as an action item, so have a blank RFC repo: github.com/Danack/PHP_blank_RFC
 
k. :-) I just don't want to run too far ahead of you.
 
7:32 PM
@Crell An interface "Enum" would indeed work. I prefer it over "EnumCase" because I think it's more intuitive. Should we go that route?
What I mean with "would work" is "I tried it and it works" ^^
 
I'm down with it. Including then UnitEnum and ScalarEnum for the variants?
 
@Danack cool, this is very useful regardless and I might sneak in a short bit rfcs. I'll let you know about the final list of sections :-)
 
And are you OK with replacing "primitive equivalent" with "Scalar" in the RFC language? I just never liked the word "primitive'. :-)
 
@Crell Yeah. So UnitEnum would contain cases() (always implemented until we have adts) and ScalarEnum value() and static from()?
 
The static from() should be on the Enum, not the case. I... guess that doesn't matter? And cases() is present on both.
ScalarEnum doesn't extend UnitEnum, I'd think?
 
7:35 PM
@Crell I think all of them will be on the enum, that makes most sense to me. I take back what I said earlier (them being inherited not being good).
 
So you're now +1 on:

interface Enum
interface UnitEnum extends Enum  { cases() }
interface ScalarEnum extends Enum { cases(), value(), from() }
interface TaggedEnum extends Enum (or UnitEnum?)
 
@Crell It could but meh, doesn't really make a huge difference in practice. We will probably forbid implementing any of these interfaces yourself so whether they're inherited or both implemented under the hood probably doesn't matter.
 
Note this does add a few more reserved class names. Which is probably fine and no one will care, but I'm noting it anyway.
 
I expected ScalarEnum not to have cases(), the enum would just implement both the unit and scalar interface.
 
Ah, I see. Does it make more sense for the class to implement both, or for Scalar to extend Unit?
 
7:39 PM
@Crell I think so.
 
That was an either/or question. :-)
 
Oh, the former.
See, that's my mind at work. Starts reading half the sentence and thinks it knows how it will end ^^
 
hehe.
I don't feel that strongly either way at this point, so baring additional data I'm good with whatever.
I'll make a ticket for you and then update the RFC.
 
@Crell Yeah I'm assuming adding them to the root namespace shouldn't be an issue.
I hope it doesn't restart the PHP namespace controversy ^^
 
GLWT.
 
7:47 PM
@Crell To answer your question: "interface TaggedEnum extends Enum (or UnitEnum?)" Not UnitEnums, because we can't provide instances of assoc enums (as we don't know the assoc vaues)
ADTs, assoc enums, tagged unions, I don't know anymore 🤷🏻‍♂️
 
:)
 
@YODA I think you mean, World! Hello
 
8:04 PM
@IluTov There's a fair bit of discussion on the list about enum values assigned to consts, or as defaults in object properties, or making sets/intersections out of them. I'm not sure what to answer there.
RFC updated. Tickets assigned to you. :-)
 
8:23 PM
Which option do you prefer? I considered the one by CMB but it sounds too rude to me. github.com/php/web-php/pull/380
 
8:38 PM
don't know what makes me feel worse. That this works, that it took me this long to realize that it works, or that I think it's cool: 3v4l.org/TLUvB
 
HI is there anybody that can help me with my PHP PDO script that is not working
?
 
@luxx Maybe, but please do not ask if you can ask. Just ask.
@Crell Which part of it? Also, if I were doing a code review on this I would fail it for unnecessary complexity.
 
@Dharman Using __invoke() as a bind() operation.
Everything else there is a perfectly normal Maybe.
 
You are just creating 4 objects.
It's something like a factory model
Also, None() method is never used
 
Not in that example. But it's a common part of a Maybe Monad implementation.
The weird part is __invoke() with a callable.
 
8:54 PM
Also, that match feels really forced there. A ternary operator would be cleaner
 
Maybe. Again, not the point.
 
guys but this it's a bug ?
https://3v4l.org/vSBhu
 
You are using strip_tags which is a bug in your code base :)
 
@BruceStackOverFlow Which part of it do you think is a bug?
 
the tag <ta> it's stripped
 
9:00 PM
@Crell I fixed it 3v4l.org/7lUI0M :D
@BruceStackOverFlow I think you are confused about it just as I was some time ago.
stript_tags is like a simple regex. Unfortunately XML is not a regular language so you can't use regex on it. This makes the core idea behind strip_tags broken.
You see <ta> tag, but that function doesn't know that. It thinks that the tag is <?xml <ta>
@BruceStackOverFlow See regex101.com/r/foLTbG/1
 
@Dharman yes exactly, my question was based after reading the source code
 
What do you use strip_tags for?
 
@Dharman I think they're just looking to contribute and fix bugs.
 
Ahh ok.
 
@Dharman Actually for nothing, but Is seeing the codebase to fix some bug, so my question was brought from that
I just fixed some behavior in my local branch, but I trying to embrace more strange or not know cases
in php8 the code it's more cleaner but again much complex
 
9:15 PM
@Dharman I have a little problem wth PDO PHP script and don't know what to do, cause I am just learining
 
9:25 PM
@luxx you didn't get any closer to actually asking your question.
The kind people here can only answer questions that have been asked.
 
Can I paste my code here or not? This is my first time in rooms
 
Depends on the length and formatting. If it's over ten lines, paste it into gist.github.com or pastebin
 
and what's the problem?
 
9:41 PM
When value isn't % I get nothing from database
 
You have way too many placeholders
 
But when values of variables is % I get rows from database where column value is either this or this, this is working properly
@Dharman what do you mean?
 
and there is no default value for $tachograf and $prehliadka if those conditions aren't met.
 
I meant variables in the execute()
You have 2 placeholders (the ?) but you have more than 10 variables
 
yeah, you have 2 ? in the statement and a dozen or so variabes.
 
9:45 PM
yeah because I deleted code before it where it works and forgot to delete this
 
I assume you are trying to adjust the code that Steven gave you
 
Yes exactly :)
 
Ok, then tell us what is it that you want to achieve
 
WHen
Wait i will write it
When the value of the variable is % I need rows that have both values to be displayed. When certain value is set I need rows that have this one value.
 
"I need rows that have both values to be displayed" What exactly does this mean? Can you give an example?
 
9:51 PM
@luxx share a screenshot or something of your database.
also, do you mean that only one of those values need to exist in the row or both?
 
One
 
then you might need an OR instead of the AND
 
you mean column_name ? OR column_name ?
 
yes
 
here is database screen: pasteboard.co/JDzEYxm.png
 
9:58 PM
hmm, maybe you it to be more like:
elseif($_POST['prehliadka'] == "Platná") { $prehliadka = "%Platná%";}
same for the other ones
 
00:00 - 22:0022:00 - 00:00

« first day (3703 days earlier)      last day (1238 days later) »