« first day (3751 days earlier)      last day (1180 days later) » 

12:01 AM
I've worn glasses since I was five. I no longer remember what it's like to see without glasses.
 
still not hearing any solid arguments against cutting them out
 
DGF
12:17 AM
@DaveRandom No, before you do the surgery you need to 2 years without your eyes not getting worse. Then, you can do the surgery, your vision will be normal and you will not need glasses anymore
*without your eyes getting worse
 
still not seeing (lol) how if can get any worse than cutting your eyes out
 
12:30 AM
zoopla.co.uk/for-sale/details/54285818 just in case anyone is looking to move house
although before you make a snap decision, consider this or perhaps this
I particularly enjoyed the description of an island as a "detached house"
 
12:48 AM
@DGF he's like 50/50 joking.
Something something, he's British, he's made of sarcasm
 
 
2 hours later…
2:36 AM
file_get_contents() maxlen fails above (2**31)-1 bytes ・ *Directory/Filesystem functions ・ #80654
 
3:12 AM
executor_globals undeclared ・ Compile Failure ・ #80655
 
 
2 hours later…
5:25 AM
Can anyone pitch in with some Opinion-based close votes @ stackoverflow.com/q/303609/2943403 ?
 
5:39 AM
@Ekin A bit belated, but thanks much for the sponsorship!
 
5:52 AM
str_contains() asserts that string contains null and empty string ・ Unknown/Other Function ・ #80656
 
6:35 AM
morns
@mickmackusa done, you can remove your comments from the answers there.
 
morning
 
cheers @mega6382
 
:)
 
 
2 hours later…
9:13 AM
Hi guys i have a query for example
SELECT
p.id
, p.name
, p.description
,MAX(IF(pa.fieldname = 'size', pa.fieldvalue, NULL)) as `size`
,MAX(IF(pa.fieldname = 'height', pa.fieldvalue, NULL)) as `height`
,MAX(IF(pa.fieldname = 'color', pa.fieldvalue, NULL)) as `color`
FROM product p
LEFT JOIN product_additional AS pa ON p.id = pa.id
GROUP BY p.id
I am getting the result correctly , but I have a condition where I have to apply conditions for size, for example (size in ('medium', 'large', 'small')) but I am getting error like unknown column size can anyone help me here
 
...but there is no column in your query named size
clearly the column is called something else
 
@vikasetagi So you want to filter by the computed value size? What database are you using? I think only MySQL allows that, this is not part of the SQL specification.
 
sorry for the confusion guys here is the updated query
SELECT
p.id
, p.name
, p.description
,IF(pa.fieldname = '1', 'medium', 'small') as `size`
,IF(pa.fieldname = '1', 'big', 'extra_big') as `height`
,IF(pa.fieldname = '1', 'red', 'green') as `color`
FROM product p
LEFT JOIN product_additional AS pa ON p.id = pa.id
GROUP BY p.id
and size, height and color are dynamic columns which I added in select query
 
So, what database are you using?
 
mysql IluTov
 
9:24 AM
@vikasetagi Hm, a simple WHERE size = ... should work then. Not sure if size is a keyword and needs to be escaped.
 
"unknown column" is pretty clear
it must be called something else
 
@IluTov it's not working I tried
 
@mega6382 You should check answers twice - those are very valuable. It's pity those won't be available anymore.
'Morning.
 
@da
@DaveRandom I tried giving different name , still getting errors.
 
@vikasetagi Can you post the full query with the WHERE clause?
 
9:40 AM
Linux namespace support ・ FPM related ・ #80657
SoapClient ignores element children when the XSD has a "group" include ・ SOAP related ・ #80658
unexp. Typecast at not fitting function return type declaration ・ Class/Object related ・ #80659
 
10:03 AM
@vikasetagi it doesn't need to be a different name, it needs to be the correct name... the error message is very clear, you are referring to a column that doesn't exist, therefore the column you are trying to reference is not named what you think it is.
it's not a keyword conflict or anything like that, otherwise you'd get a syntax error
the name in your query does not match the name of the column in the schema. it is that simple.
 
10:21 AM
@Tpojka lol
they are still there, its just that nobody else will be able to answer to it anymore
 
I thought it's going to be deleted. :/
[This](https://stackoverflow.com/questions/303609/should-i-capitalize-my-constants#answer-303621) is what I won't be able to know for long period of time until I'd work with that language for example.
 
nope, it has enough answers to not get deleted
 
10:34 AM
Thanks.
 
11:11 AM
@Tiffany I bought the e-copy, but haven't read it yet :P
 
DGF
12:10 PM
I have this query to display products ` $query = "SELECT * FROM `products` ORDER BY quantity ASC";
$result = mysqli_query($db, $query);

while($row = mysqli_fetch_array($result))`
I have a system ratings and I want to get the AVG rating, the rating is in another table. How can I get the AVG while displaying the products?
 
window function maybe?
 
DGF
the rating table has the id of products as foreign key
sindow function?
window*?
 
yes
SELECT *, AVG OVER() FROM products but I can't remember the exact syntax right now
 
@Tpojka this is amazing
 
DGF
I made this inside the "while" ` $query = "SELECT AVG(rating) AS avg_rate FROM product_rating WHERE id_products=".$row['id_products'];`but I think is wrong..
 
12:24 PM
That will get you only the average
 
12:44 PM
Good Morning
 
also a select query in a loop is almost always wrong
SELECT p.*, pr.avg_rating
FROM products p
LEFT JOIN (
    SELECT id_products, avg(rating) as avg_rating
    FROM product_rating
    GROUP BY id_products
) pr ON p.id_products = pr.id_products
ORDER BY p.quantity ASC
@DGF ^
I'm sure mysql has some utterly bizarre ambiguous way to compact the aggregation into the top level query
disclaimer: I haven't written a SQL query for quite a long time
 
DGF
12:59 PM
I made it work inside the while
` $query = "SELECT * FROM `products` ORDER BY quantity ASC";
$result = mysqli_query($db, $query);

while($row = mysqli_fetch_array($result)) {

$query = "SELECT AVG(rating) AS avg_rate FROM product_rating WHERE id_products=".$row['id_products'];
$teste = mysqli_query($db, $query);
$data = mysqli_fetch_array($teste);

echo intval( ($data['avg_rate']) );


?>`
 
don't do that
it will be very very very slow
 
DGF
Your query you display the products from the products table while displaying the rating from another table?
*will
 
start by running the inner query on it's own first, see what that produces
that gives you just a map of product IDs to average ratings for that product
you then join that map onto the original product query
 
@DGF this is BAD!!
 
(with a left join to ensure you don't filter out products that don't have any ratings)
if the "average ratings" virtual table is useful in several places, you might consider creating it as a view
 
DGF
1:05 PM
@mega6382 if it works it ain't that bad ahahah. You might say, not efficient
 
@DGF just remember you will be the one cursing yourself in a month or so.
 
DGF
@DaveRandom Okay, thanks, will try that
@mega6382 why?
 
I don't want to spoil it for you.
 
@DGF play around with it, separate the queries out, and remember that an inner query is just a substitute for a table
 
DGF
@mega6382 it's for a school work (not real store)...
 
1:09 PM
@DGF the worst developer in the entire world is yourself >=1 month ago. this is a universal truth.
 
DGF
@DaveRandom that == always learning?
 
I suppose that's the glass-half-full approach yeh
I prefer to just hate on stuff
(jk obv :-P)
 
@DaveRandom ping
 
Still coming down to London?
 
1:14 PM
yeh will be, I have a meeting about it on Monday, waiting for final go-live date from BT but should be either next week or the week after
 
@DaveRandom I'm stealing this.
 
the fibre is in and stuff it basically just needs switching on
I'll let you know when I got definite date
 
@DaveRandom Roger :D
 
@MarkR you're welcome to it :-P
 
Also as maybe someone would have an idea, but I need to point a domain name to a sub-sub-sub folder on a server I don't have control over (it's a university server) is there anyway I can do that myself, or do I need to wait for the sysadmins to set it up
 
1:18 PM
@DaveRandom Where are you nowadays, France?
 
@Girgias Unless you have access to the server vhost or nginx config you'd need to wait for system admins.
 
@MarkR Well it's Apache, and I can write .htaccess files, dunno how helpful that is tho
 
@Girgias .htaccess won't help, but if the sub-sub-sub folder is available over some other domain/url then you can either create forwarding/proxy to it or something.
 
@mega6382 same as we do every night, Pinky
(Manchester, UK)
 
@mega6382 Well yeah I've got access to it via an URL, so in some sense I'd like to map that subfolder to the subdomain
 
1:26 PM
@Girgias You can't do it directly without changing the vhosts/site-enabled or whatever is in your apache config. So, you will need to point it to another server and have that server proxy to url for this subfolder(definitely a bad idea, so just wait for the sysadmin)
 
@Trowski thanks for all your work :-)
and happy friday!
 
@mega6382 Well I'll wait then, will just take bloody 6 months as they are slow AF
 
@DaveRandom Doesn't officer Jay live there too?
 
@Ekin \o/
 
yeh but I haven't seen him since he moved, we never managed to get it together and then covid
 
1:31 PM
starts dancing
 
@DGF Don't write SQL in a loop. Always avoid putting SQL in a loop. As I said before if you are using any modern MySQL/MariaDB version then you can use window functions. This will give you the average as well as the values for each row. e.g. SELECT *, AVG(b) OvER() as WindowedAVG FROM a. This query returns an average in every row together with each value.
 
dont write select statements in a loop, probably
it is often necessary to do insert/update/delete in a loop, and it can sometimes be necessary to run further selects in a loop after some computation
 
There are often ways to avoid that. It's acceptable to execute SQL within a loop, but not to prepare it. Generally, try avoiding N+1 queries.
 
@Danack they aren't easily executed but I do have them somewhere
 
@Sjon if not too much hassle, please could you check 3v4l.org/pU0LD against the alpha/betas. I checked it against RC1 and it has the same behaviour as released versions. Context - news-web.php.net/php.internals/112919 just wanted to check exactly which date he could have been testing that on.
 
1:45 PM
@Danack sure, give me a few minutes
@Danack I tested that on alpha1 and it throws the exact same error
 
cool. thanks.
 
np
 
FilesystemIterator foreach-loop fails on fuse filesystems ・ *Directory/Filesystem functions ・ #80660
 
@IluTov It has been running for some time, results are under the branches tab. I wanted to create a separate page for you but haven't gotten around to it
 
 
1 hour later…
3:23 PM
Goes with the music. =)
Adding that one to my playlist youtube.com/watch?v=bPe0ZXsHMjQ @PeeHaa @Ekin
 
4:24 PM
@StatikStasis you should also add this youtube.com/watch?v=kfVsfOSbJY0
to your playlist
 
DGF
5:02 PM
@Dharman Thanks, but I didn't learn about that.. Since it's for school, I will stick to what was said in classes
@DaveRandom I don't understand that query very well, but it worked thanks
I added this to the inner part: ` SELECT id_products, avg(rating) as avg_rating, count(id_products) as count_rate FROM product_rating`
the "count..." part
but it's not working. @DaveRandom Do you know why?
It's for counting the total "votes" on that product
It's working now. I needed to add "pr.count_rate " to the outter part, don't know why
 
5:27 PM
@Sjon Hm, how can I find it? It's not in the usual dropdown.
 
5:45 PM
@cmb Did anything with the Windows SDK change? Im getting CI failures for php 7.2 now
1 message moved to Trash can
 
cmb
6:01 PM
@Derick the 7.2 builds have been moved to the archive folder
if you want to keep testing with 7.2, I can provide an update for .appveyor.yml
 
I thought I was okay with working with Magento 1 for a few months, but now my manager just said not to use a generator because it's "Not in line with the way Magento works" and that I will instead need to load everything into memory at once and loop through it.

Wonderful
 
That's breaking my CI for Xdebug 3.0 with PHP 7.2 :-/
I'm currently hacking around it, but if you have a neater solution, that'd be nice?
(my hack is: flag elements as LEGACY: yes, and if that $env is set, use a different download URL)
fwiw, this hack is being typed up as we speak.
 
cmb
@Derick I thought about setting the full version (i.e. 7.2.34), and fetch these from archives/
 
yes, that's what I am also doing
 
cmb
anyway, please finish your solution; I'll have a closer look later today or tomorrow
 
6:12 PM
@scorgn D:
 
6:27 PM
php-snmp lacks a string output format function ・ SNMP related ・ #80661
 
6:39 PM
TIL:

```php
$date = new DateTime();

$date->format(DateTime::ISO8601) !== $date->format('c');
```
 
@cmb THis seems to work, if you have a nicer solution, I'm happy to hear: github.com/xdebug/xdebug/pull/723/commits/…
 
Does anyone know why that is? They are both documented as being formats for ISO8601.
 
string(24) "2021-01-22T18:43:26+0000"
string(25) "2021-01-22T18:43:26+00:00"
 
@Derick Yeah, I learned that it has the extra ":" in there. It's a bit odd. Not sure if there is a legitimate reason for them being different?
 
Hey guys I'm on apache + ubuntu and can't get files without an extension (such as config.php) to work. so mysite/config doesn't work. Please help. I've been struggling for a while and Google is not helping
 
6:51 PM
What have you tried? How did you set it up?
 
I installed apache2 package on ubuntu 20.04 I tried various additions on htdocs
 
Like what?
 
Rewrite engine on
Rewrite Rule
 
You have to be more specific, but I am not going to pull info out of you :P
Best of luck I guess :)
 
Sorry I'm on ubuntu terminal on my server and it's not letting me copy and paste, hold on
RewriteEngine On
 
6:55 PM
@d7l2k4 Are you just trying to get a simple development environment for PHP going or are you trying to setup a production server?
 
I'm on production server trying to get this directory app to work actually
 
Got it. Unfortunately I am not particularly nifty with apache as I have always mostly used Nginx for my servers.
 
RewriteCond %{SCRIPT_FILENAME} !-d
yes I was using nginx but had the same issue.
the way the app is written,
 
What kind of app is it?
Also, you said "can't get file to work without an extension". What is the action you're performing and the error/response that you are getting?
 
that's where the app is hosted at this time.
If I click a link, every time I have to add .php in the end just to make it work
 
7:07 PM
@d7l2k4 Why do you think it should allow you to call file without extension?
 
I just happened to follow installation instructions and that's what I got. For me to fix this, I have to add file extensions on every link. (Or do something with apache and make it redirect with file extensions somehow)
 
Some internal instructions or some link you could share?
 
@d7l2k4 Have you reviewed this php.net/manual/en/security.hiding.php#72630 ?
 
I messed up because I didn't know I had to edit the 000 conf file. Thanks guys
 
7:22 PM
Seems that is enterprise application. Fastest way to solve any kind of problem with those is to ask author/maintainer.
 
7:39 PM
Can you pause GitHub sponsors? I requested it but I'm still now sure I actually want it.
Oh nevermind, they already approved it, that was fast.
 
8:23 PM
@mega6382 Good grief... I clicked it without looking.
 
hahaha, gotcha :D
 
@scorgn how is your job hunting going?
 
Which way do you guys prefer:

if ($some_condition) {
$this->something();
return;
}

$this->else();
 
@Danack I kinda started a little bit but it didn't last long, didn't reach out to too many people. I decided to wait it out and see if we go back to developing with newer frameworks
 
or

if ($some_condition) {
$this->something();
} else {
$this->else();
}
 
8:27 PM
@GrahamS. early return ftw.
 
It's now the time they said they would switch back though and I haven't heard anything so probably gunnu fix up my resume this weekend
 
haha thanks @Danack, that's what I normally do, too
 
8:39 PM
I'm thinking of taking some time to get myself very familiarized with PHP 8 and new framework features before looking though
My current job takes up so much of my time though it makes it hard
It's a trap lol
 
@scorgn the only advice I can give is to make sure you leave work on time, and then set yourself a target amount of time per week to do job hunting. As yeah, otherwise you can be trapped.
 
Yeah definitely
I know some people who will just put no effort in their current job while job hunting. I almost wish I could do that but I would just feel guilty about it. A company would have to really wrong me to do that
 
9:05 PM
Best of luck @scorgn. I am also doing job hunting right now, because I am the most senior(technically) person at my current place of work, and that has lead me to believe that if I am the most senior person at any job than that job is not worth having.
 
How well versed are you in AWS stuff @mega6382?
 
@mega6382 Yeah I wouldn't want to be the most senior person at my job either, at least not at this point of my career. I still have a lot to learn and if I'm the most senior person where I'm working it feels like there's never going to be much room for growth
 
@PeeHaa I can manage my own, I suppose. I am "AWS certified developer", if that helps not that it means much amyway.
 
The people I work with have quite a lot of experience with programming it seems, but they definitely don't keep up with the language
 
@scorgn Yes, that's exactly how I feel, I am not good enough to have that position, I want to gain a lot more skills.
 
9:14 PM
Good luck as well finding a new job!
 
Thanks, you too.
 
@mega6382 What kind of role are you looking for?
 
Backend engineer(PHP/TS) with some DevOps, little to no frontend would be the ideal role.
 
@mega6382 Do you have experience in interaction directly with customers and doing tickets?
 
I smell an interview happening in disguise
 
9:26 PM
Not much disguise here
 
haha
 
We will be hiring people in a relatively short time and would prefer somebody we know. We already have some candidates in our circle which is nie
Our roles are a bit different than "normal" dev roles though so it helps knowing what people want
 
@PeeHaa Yeah, I often interact directly with clients, at my previous company I was even on "the firefighting" team in a project. Even right now(2:30 am) I am receiving messages directly from client on my whatsapp, its a bit annoying on weekend, but it happens.
 
Damn, and I thought my job was stressful sometimes.
 
@GrahamS. For the client its like 3 pm(i think) on Friday, so its the middle of the working day for them.
 
9:32 PM
Mm makes sense. Are you in India? Just making a logical assumption based on the current time. Im in Florida so it's 4:30 here
 
Pakistan, actually.
 
Our teammates in India are always still up at this hour. I have to like almost force them to go to bed haha
oh sorry, haha
 
np, :D
 
:D
 
9:46 PM
 
Medium, obviously.
 
@mega6382 Well fuck that
We for sure don't do that
Whatever your next job is. Do not do that ever again :)
Rare or Medium rare. It's not even a question
 
Yeah, I really do hate it.
 
That's just awful :(
 
totally, :(
 
10:02 PM
Don't even cook it. Just walk it out.
 
@Tpojka I believe it depends on the cut of the meat too, like if its eye of the round, then I would rather not have any :D
 
DGF
rare :P
 
10:21 PM
@PeeHaa Blue rare in a way skilled veterinarian could even save it - taste here. :P
 
@Tpojka Juuust dead enough :D
 
@PeeHaa I've hoped. :D
 
@Tpojka Isn't the high quality a5 wagyu mostly eaten like that?
 
10:47 PM
Need to check, I watched several clips with kobe steak.
Seems similar wagyu and kobe.
I'd say those are pretty much medium to medium rare on image above.
Those are sliced into 2-2.5x2-2.5" cubes and burnt on sides, you get medium rare in the middle.
At the end it is sliced into 1/2" thick but point stays. Medium rare I'd say, not much more blood than that.
 
11:07 PM
Finally we are having useful discussions in this channel
3
:D
 
That's what PHP stands for: Pretty Hungry People
 
I thought it was PornHub Professionals
 
We used to be until it came out Pornhub had all that underage stuff
Now we have to do damage control
 
*Some minor damage control
 
@PeeHaa :D
 
11:16 PM
lmao
 
11:32 PM
I see what you did there
 

« first day (3751 days earlier)      last day (1180 days later) »