« first day (3025 days earlier)      last day (2148 days later) » 

01:33
hey
<?php


$user= 'root';
$pass= '';
$host= 'localhost';
$db= 'calculate';
$db= new mysqli($host, $user, $pass, $db) or die ("Error");
$select= "SELECT itemName, itemPrice FROM items ORDER BY itemPrice";
$sum= "SELECT ROUND(SUM(itemPrice), 2) FROM items";
$result= mysqli_query($db, $select);
$sumResult= mysqli_query($db, $sum);
$numRows= $result->num_rows;
if($_SERVER["REQUEST_METHOD"] == "POST"){
$delete= "DELETE FROM items WHERE itemName= " . 'itemName';
$deleteResult= mysqli_query($db, $delete);
(see full text)
(($delete= "DELETE FROM items WHERE itemName= " . 'itemName';))
This line is just deleting everything no matter what. I understand that but I want to only delete one specific row from the table
can i get some help
02:12
@moocow what is itemName supposed to be? it's not a variable
also you should probably have your code receive errors from MySQL so you can get a better picture of what's going on
02:42
hey
itemName is a field from the SQL table
I havent received any errors from the MySQL
I just don't know what to put in the (where itemName = ??)
Hey, does anyone know how to merge a topic branch into my master branch and there are some logs in my master branch that I'm willing to discard. In other words, I want my master branch to be completely overwritten when I merge my topic branch over, how do I do that?
@PrashinJeevaganth no....I always have to google that.
I bet it involves a force push somewhere...
well I'm talking about the merging here ... currently there isn't a force flag in merging so I don't know where to turn to
02:58
@PrashinJeevaganth really ....google this. There's different ways of doing it. The simplest would be to reset master to the latest change you want to keep, merge your feature branch locally, then force push it....but there will be other ways.
anyone wanna help me i need help
 
2 hours later…
05:05
Hi all great people.
Can someone please help me in my issue?
0
Q: During the object iteration process what does actually happen to the return values from few of the function definitions of 'Iterator' interface?

user2839497I'm using PHP 7.3.1 I'm trying to understand object iteration in PHP. I come across following code example from the PHP Manual : <?php class MyIterator implements Iterator { private $var = array(); public function __construct($array) { if (is_array($array)) { ...

@user2839497 Kinda hard to understand what you are asking, but are you maybe looking for the google query "php internal array pointer"?
@PeeHaa : No, I'm not asking for the query 'what is php array internal pointer'.
What are you asking than?
@PeeHaa : Let me explain my doubt to you. In general any function that returns some value gets stored in some variable or it gets used in some expression.
@user2839497 Or it gets just discarded
05:13
@PeeHaa : So, I want to know what happens to the return values from the functions which are present in the 'iterator' interface and defined in the 'MyIterator' class?
Nothing
They are gone
@PeeHaa : I want to know where the return values from these functions are getting stored and used during the object iteration process?
@PeeHaa : If they are not going to stored anywhere or getting discarded then why the interface has defined return values and their types for few of the functions?
next() does not return anything afaik (or at least should not according to the docs)
@user2839497 Because things like foreach uses it to determine how to process the iterable
Or you can manually iterate it
@PeeHaa : That I know and I'm not asking about next(). I've doubt in functions current(), key() and valid()
Your question tells me otherwise
So you are asking how foreach works internally?
05:19
@PeeHaa : No. I want to know how foreach() loop on object is making use of/storing the non-void return values from few functions during the object iteration process?
Yes. That's asking how it works internally
@PeeHaa : Only in case of object iteration by implementing the iterator interface
@user2839497 Can you read C?
@PeeHaa : I'm talking about PHP. Where does C come into picture?
I want to know how foreach() loop on object is making use of/storing the non-void return values
05:25
@PeeHaa : Please consider the complete statement which I've said. You are considering it half of it only and misunderstanding my doubt.
later o/
1465
A: How does PHP 'foreach' actually work?

NikiCforeach supports iteration over three different kinds of values: Arrays Normal objects Traversable objects In the following, I will try to explain precisely how iteration works in different cases. By far the simplest case is Traversable objects, as for these foreach is essentially only syntax...

^ If this doesn't answer your question you really will have to look at C code
yo
@Paul yooo
 
2 hours later…
07:05
morning ...
very fragile, head hurts ...
07:41
hi
shall I set null to $_POST['first_name']. currently when I set it then it is giving me value as false
08:00
oillionaire Canadian Informal. a millionaire whose wealth is derived from the petroleum industry.
08:35
Morning @JoeWatkins
pats head gently
oh god, it hurt
morning
08:56
Solr Extension build fail in last commit 9c0e23 – #77527
On Boxes of Sand: https://blog.krakjoe.ninja/2019/01/boxes-of-sand.html #php #php7 #testing #sandbox
@JoeWatkins s/effect/affect
I thought, this is short, doesn't need a proof ...
ta
yw
also "The code executed in the sandbox may do anything up to be excluding making PHP segfault" wut
but excluding
are you at the end yet ? any more ?
09:09
just about done, one sec
I really should have asked for proof, won't make that mistake again ... I read it like ten times, but you read what you meant to write, not what you said ...
done.. that's all that jumped out at me
@JoeWatkins waiting a day or two between writing and reading helps me with that.. though I've gotta be doing/thinking about something else entirely in the interval
you want to read some more for me ?
unpublished, don't know if I'm going to publish ... but more (your) eyes are good :)
09:17
sure.. un momento
you talk about xdebug's coverage as if it's flawless.. it isn't (or at least hasn't been)
partly, I'm trying to appease certain people, and partly, that's the standard everyone expects, and they expect the mistakes it makes ... I've had to reproduce behaviour I think is wrong in order for it to have a chance of having the driver merged into php-code-coverage because what sebastian is looking for is something that produces the same results as xdebug ..
I asked derick to read it yesterday and he didn't reply to me .. so don't know if I can or will publish it in current form anyway :s
function foo() : Bar {
    return new stdClass;
}
all implementations will show the return as covered, it ruddy well is not covered and no value was returned to the caller ... but that is what people expect, even nikita ...
09:42
haha
maybe I'll make a nice visualizer instead... pcrov/pcov/pov
something that I've kinda wanted for a while is a change in how we interact with code and unit tests on the whole.. something more like Excel, where you've got sample data and results front and center, immediately updated
I probably should have done it in spare time, but it seems like a no-brainer that it should be merged ... I wouldn't feel so panicked, but it would have been slower to get done, I didn't just work a week, but most of every day and night for 5 days actually ... to do the same in spare time might have taken months ...
that sounds nice, no idea how it would work ... I'd like to be working on criteria superior to just lines, but can't really spend a bunch more time on it now ...
yeah no, what's in my head is a much bigger thing than all this.. very much a large ide plugin or standalone app, tapping into lang servers and whatnot for partial updates.. it's nothing in scope of anyone's time right now
just a tangent
I had started thinking along those lines, like outside of phpunit it's pretty useless right now, but enabled in production/staging could provide you with valuable information about what is really happening outside test env ...
I hope in 50 years everything we're doing now will look primitive... it feels primitive
09:56
I smoked 60 cigarettes yesterday, I won't be here in 50 years :D
I'm finally cutting down the nicotine in my vape juice.. went from 18 mg/ml to 12, and am now down to 6.. I'm going through it faster, but it's a step
9 messages moved to Trash
(don't want to argue, might be found easily, so moved)
gotcha.. feel free to dump mine too if the trail worries you
@Paul I'm all over the place, trying to cut down pot, but I just end up smoking so much, I feel terrible, and then smash the pot too hard ...
5 messages moved to Trash
nice thing about the vaporizer is it doesn't make me feel like shit... my lungs are in much better shape now, I can smell, I don't smell like an ashtray.. only cutting nic to hopefully drop dependence completely at some point
pot hasn't been my thing for a long time... it's too strong nowadays
10:06
we grow our own, legally (allowed in spain), which gives me an almost inexhaustible supply ... it's not too strong, there's just ... too much of it probably ...
used to be able to chill and smoke a joint and that was fine.. now growing it is a science and everything out there kicks my ass
maybe I should try growing some dirt weed.. I think it's legal for me now, at least as far as the state is concerned
I shut down the grow for a month to slow me down ... it's helped ...
I don't actually ever get stoned, I'd love to get stoned ... after a break, I'll feel a bit high for a day, but then joints for breakfast the rest of the time just to feel normal ... a vicious cycle ...
that was when I turned to acid.. the most cost-effective way to turn things around for a bit
at least it was.. dunno what anything costs anymore
I don't do anything else but weed now, I have to be grown up ... with the exception of acid and mushrooms, there's nothing I haven't spent a few years addicted too at some point, some more than once, some with disastrous consequences ... the thought of putting anything like that into me makes me feel sick, as it should ...
just fyi @JoeWatkins I'm absolutely not against just dropping code coverage from PHP 7.4 or deprecating it, in favor of ... pcov, if it were a bundled ext
10:14
I dunno if I love the idea of bundling, we loose control of stuff in php-src, and if it's bundled in 7.5/8.0, we'll stop working on the ext, or have to work on two copies ...
what is there to gain by bundling ?
let's assume that it becomes as available as xdebug is, installed on travis/av/whatever, available in all distros repositories ... we gain nothing that seems valuable by abandoning it in php-src ...
our experiencing of donating code to php-src hasn't really gone that smoothly, has it ?
at some time in the future, when there's really nothing else we want to add, at that point it makes sense to donate it to php-src ... but right now, I'd rather be free to develop it how we would like, without friction and arguments ...
are you convinced by any of that ?
one thing you'd get is far easier buy-in from tools that might work with it, e.g. phpunit
I can see that, but it will feel like we are twisting sebastians arm, and we shouldn't really have to resort to bundling for that purpose ...
I don't want to make the same mistake we made with phpdbg, phpdbg was too young to be merged, that's an actual fact ... and after it was merged it became very hard to improve it, before it was merged, we rewrote big chunks of it every night ... after, almost nothing because it's too hard ...
it's not necessarily just his .. in general people are more comfortable relying on bundled exts even if they're crap (I still see a lot more spl use than ds, for example)
in this arena, the thing the majority of people are relying on is xdebug, and that's not bundled but still ubiquitous ...
only because it's been there long enough that people have learned they can rely on it
10:27
if we keep it as an ext, and make a push for it to be included on travis/av/whatever, and it's already available in remi repos, and I'll make contact with the debian guy ... that's the vast majority of people covered, with whatever version of php they are running today ... if we bundle it, they won't learn to rely on it for years ...
what is available to anyones install is not dictated by what is in ext, but how package maintainers ship php to their distro, and we can influence that and already are ...
I'm not talking about what's available, I'm talking about what people are comfortable making the switch to use
if being ten times (or more) faster than xdebug doesn't make you comfortable with switching, then nothing will, will it ?
exts die out in the wild all the time - that's the concern
and also, having made noise about FFI being merged before it had a user base, which is wrong, we can't very well do the same thing, it should have a reason to be merged into php-src, and there's not one right now ...
@bwoebi I'm not saying we should keep it out of php-src forever, at some point I'd like it to go in, but I don't think now is the time ... has anything I said convinced you otherwise ?
also, it would be nice if you could chime in on the PR ... everyone is really quiet and it looks like it's just me that wants this, and I don't think it is ... nobody can test it easily for their project, so outside of us internals dev, nobody has an opinion right now ...
@JoeWatkins I'm not saying it should be right now. I just say that IFF we deprecate it/drop it from phpdbg, there should be a replacement, i.e. an ext/pcov.
(and vice versa)
10:37
oh I totally agree, same time ...
remember when you were working on the pr for phpdbg, there was talk of setting up a phpunit fork so people could test, do you remember if anyone ever got that to work (because I can't, my composer fu is too weak) ?
@JoeWatkins It didn't
it just ended up merged somewhen
thought that might be the case ... that's shit because nobody can even +1, except people who can read it ...
(and none of those people have ... hint hint, nudge nudge)
 
2 hours later…
13:00
Hello..
Hi all
Can someone please tell me how should I display the error types that are part of E_ALL?
 
2 hours later…
15:27
@user2839497 it's a bit field, constructed thus:
Name                 Constant   Shifted
E_ALL                0x00007FFF
E_ERROR              0x00000001 2
E_WARNING            0x00000002 4
E_PARSE              0x00000004 8
E_NOTICE             0x00000008 16
E_CORE_ERROR         0x00000010 32
E_CORE_WARNING       0x00000020 64
E_COMPILE_ERROR      0x00000040 128
E_COMPILE_WARNING    0x00000080 256
E_USER_ERROR         0x00000100 512
E_USER_WARNING       0x00000200 1024
E_STRICT             0x00000800 4096
E_RECOVERABLE_ERROR  0x00001000 8192
E_DEPRECATED         0x00002000 16384
(see full text)
@JoeWatkins : Thanks for the help but how did you find it? I mean is there any built-in function or some pre-built mechanism exist in PHP?
source code ...
nothing built in that I know of ...
<?php
function explain(int $errors) {
	$levels = [];
	foreach (["E_ERROR",
		  "E_WARNING",
		  "E_PARSE",
		  "E_NOTICE",
		  "E_CORE_ERROR",
		  "E_CORE_WARNING",
		  "E_COMPILE_ERROR",
		  "E_COMPILE_WARNING",
		  "E_USER_ERROR",
		  "E_USER_WARNING",
		  "E_STRICT",
		  "E_RECOVERABLE_ERROR",
		  "E_DEPRECATED",
		  "E_USER_DEPRECATED"] as $level) {
		if ($errors & constant($level)) {
			$levels[] = $level;
		}
	}
	return implode(", ", $levels);
}

printf("E_ALL: %s\n", explain(E_ALL));
?>
I dislike new relic, very a lot ...
they should have their own bug category on bugsnet :)
15:46
@JoeWatkins well at least their service is cheap, right!
Issue tracker: Undefined status "Critical" – #77528
my highly evolved social skills detect sarcastic undertones ... tbh I never looked, I just see bug after bug being opened that we can do nothing about because nr is a special snowflake and keep their code closed ... they're not the only people that do this, but I don't hear about the others ...
I don't have an opinion on new relic, but adam at least is a good speaker
he seems very comfortable doing it
to be fair, their costs may have come down a bit.....it used to be extortionate.
16:39
Hey all, is there somewhere to find reliable automation contract work anywhere online? I'm not looking for anything fancy or super-high-income
....what is 'automation work'?
@Dana Basically I just want money and have a CS degree. I know basic python string processing. Not much web stuff, unfortunately
@JoeWatkins you might include a link to mimus
@JoeWatkins you should probably repeat the link, and repeat the reason on why people should check out mimus near the end. My English teach might question the commas before the 'and' in the opening.
16:51
there is one but can't see in preview mode, will link every instance of the word though ...
%G modifier is possibly incorrect – #77529
^ that came up before iirc
better ?
well the reason, is kinda everything I just said ... so not sure how to change ending ?
suggestions welcome, third blog post in 24 hours, running out of human words now ...
17:00
ah right, that was it
why open a 2nd doc bug though
On Faking It: https://blog.krakjoe.ninja/2019/01/faking-it.html #php #mocking #testing #mimus (this one is short, and no code, nice Sunday read, probably ...)
I'm escaping computerland for an hour ... lata all ...
 
3 hours later…
19:52
have any of you guys developed an xml product importer for an ecommerce cms? Whats the best way to update stock and whatnot? IF the product does not exist - delete it? or truncate the product table and import the new products? whats the best way of approaching this?
 
1 hour later…
20:53
If anyone is interested - I've ported the SO Dark Chat + extension to Firefox
that's great
is it in anyway related to Google going into end-game for Chrome and killing adbloks?
21:09
@tereško Maaaaaaaybe
I figured I'd give Firefox an honest attempt in preparation.
It was the only thing I wanted that I couldn't have there, so I made the port. It was surprisingly easy too
(it's somewhat unstable these days (unless you use Developer Edition, which is pretty good too for the job)
then again, I am currently using Vivaldi
I am not sure how it will be affected by these changes
I know that they bypassed the "google account integration" in Chrome 69 update
but there has been no blog post regarding the latest genius idea from big brother G
@tereško Yeah
I'm on Chromium
I was pretty disturbed when I saw that.
of course , this has absolutely nothing to do wit the recent news, that Edge is now witching to Chrome engine
21:14
Apparently, Chrome and Chromium track you through you google account, if you don't sign in, but do sign in to Gmail or other google products, they would ninja-sign-in in the browser as well, to be able to track you through it.
It's been increasingly disturbing and harder to ignore for me over the last few months, I'll admit.
I think we will be seeing a Vivaldi/Opera fork of Chromium in next 3 months (those two browsers have the same roots and the both depend on that engine)
There is a possibly.
if not .. well ... shit
we can only hope that new browser wars are coming
otherwise we all are fucked
21:33
I really should stop using r/politics: old.reddit.com/r/politics/comments/akf6uq/…
21:51
PHP crashes when parsing (2)::class#77530
22:22
@tereško I thought Developer Edition was like a "stabilized daily" kind of release?
How is it more stable than main?
22:46
so anyone have any good advice about product xml imports? :D
@MadaraUchiha no, it's not more stable than main
thing is, it is being made as a dedicated tool
which means that some random crashes are not something you will care about
unlike with a main browser, where crash can mean loosing all of you opened tabs
MySQLi example code promotes security bad practice – #77531
@Jeeves oh lawd.
@Danack That's amazing XD
indeed
23:34
Dependency Injection - how and why.
Dependency injection, the right way.
Dependency Injection - omg, use Auryn already.
Can anyone think of a catchy talk title about dependency injection....
I like the third one, but I like silly titles
if you will dive into the how and why indeed, first would be very self explanatory
there may be fuddy-duddies who won't
@Ekin that is my preferred one.....it's just not catchy in the slightest....
well, maybe you could make up for it in the slides?
23:37
Yes.....if it gets accepted....which is the first hurdle.
ah. I see
Something like "Dependency injection - a performance enhancing technique."
but not as shite.
I can only come up with 'boosting performance with DI', or if it's broader 'DI with benefits' :-P
...I think there's still some parts of the code of conduct the title hasn't violated yet.
if it'd be including IRL examples 'Real world dependency injection' might catch interest
regardless, hard to pick one, sorry to be useless
I myself like the titles that actually sound like a solid lecture instead of a marketing material
hence the first one was my choice
23:54
Just call the talk "AntiVaxxers and Dependencies"
I'll leave it as that then, and hope it also appeals to their straight-forward germanic roots.
best of luck
Just buy a real cake
but oreo cream is yummy

« first day (3025 days earlier)      last day (2148 days later) »