« first day (2352 days earlier)      last day (2600 days later) » 

12:03 AM
@RokoC.Buljan @dipper I also store huge files in the DB - simpler to backup (also incremental backups), and simpler to put authentication around it. Works well as long as you don't have high throughput needs on those files, or you can cache those access calls
@Wes happens: clear caches and restart
 
Wes
did that, didn't work. i might have removed php from the external libraries
accidentally... somehow
 
woah
didn't know it was possible
 
Wes
me neither, but apparently i did it :B
 
1:08 AM
@Wes check your settings
 
Are there security issues with letting any origin get a response form an Ajax call if it gives no sensitive information out?
 
Wes
1:35 AM
thanks solved it
 
2:16 AM
@tereško that'd probably be it :P
 
 
1 hour later…
3:22 AM
@bwoebi the thing is... when I open a tcp tunnel from my pc to an external server, I get a Bad Request page because, the hosts do not match... is there any workaround this ? ^^
in, aerys ofc
 
3:43 AM
good morning
 
4:24 AM
Morning
 
I'm getting password expired on my local server.
Anyone ever come up on this?
 
what do you mean password expired? on a web app you created?
 
Local server when it tries to connect to the database.
 
never seen that happen... usually a db password stays until you change it
what kind of db is it?
 
Well i cant log into phpmyadmin
mysql
 
4:31 AM
okay so mysql... if this is local you should be able to reset the password from the command line or a wamp variant through one of there gui tools
then just change your password in your code to match
 
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1862] Your password has expired.
Why did that happen?
 
Guess mysql does have the ability to set a password expiration policy ... never used it before
this might be of some help
So... Room 11 peeps.... what's the new hotness in PHP IDE's ... love PHPStorm but a little price prohibitive for my current situation.
 
@Orangepill VS Code is pretty nice / okay...
 
morning
 
cool...I'll try it out
@linus o/
 
4:44 AM
@Orangepill \o
 
5:04 AM
hi morning beautiful coders
i need help from you guys
can someone please answer my question in StckoverFlow this is the link stackoverflow.com/q/42991510/7760293Thnak you i will appreciate
 
@lemmynjaria It looks like a problem with your database do you have it set up correctly?
 
Actually i have setup the database correctly every scripts i have in my host server works correctly but any scripts that i do for Inserting any value in the database is not working.
 
You've tested other insert scripts on other pages or just that one?
 
i have tested other insert scripts but its not working
but the funny part when i test in a local server it works perfectly
 
5:21 AM
Can you upload DbConnect.php to pastebin.com?
 
okay let me do it right now
 
ok
 
posted on March 25, 2017

New Cyanide and Happiness Comic

 
DbConnect.php Script http://pastebin.com/WuBXxNRa
Constant.php Script http://pastebin.com/G9XNxAfR
 
Ah I'm not so familiar with mysqli but try where it says
            if ($stmt->execute()) {
                return 1;
            } else {
                return 2;
            }
To change it to
        if ($stmt->execute()) {
            return 1;
        } else {
            die(htmlspecialchars($this->con->error));
        }
Just temporarily, to try get a reason that the statement is failing
Sorry just changed it to $this->con->error
Make sure to make a backup so you can replace it
 
5:38 AM
Another place to check to is to make sure the file name cases match what the code is calling for... assuming you local is windows/linux and you are pushing to linux
 
@Alesana let me try that thank you
@Orangepill roger that :)
 
5:54 AM
@Orangepill Good call, wouldn't he get an error before that though just trying to require the file?
 
it's probably Constants.php that was misnamed ... would error but not be fatal because it is included not required
if errors are suppressed he would have missed that warning along with the one that undefined bare word constants would be interpreted as strings
 
Ah that makes sense
 
I wonder... is there a way to mount a windows/mac file system as case sensitive (like from a docker container)
doesn't appear so... but I imagine it can lead to even more confusing bugs if you could.
 
6:10 AM
Probably so :|
 
I know I've seen that exact same casing issue several times in both windows and mac environments and it happens infrequently enough that it takes a decent amount of head scratching to arrive at the cause of the problem.
 
Hi All
I just tried one array code
$superAdminCond = ['sales' => ['table' => 'user','type' => 'INNER','conditions' => "Notifications.receipients = sales.entity_id AND sales.role =admin"]];
When i printed this array code, i am getting like below
[0] => Array
        (
            [sales] => Array
                (
                    [table] => user
                    [type] => INNER
                    [conditions] => Notifications.receipients = sales.entity_id AND sales.role =admin
                )

        )
i need to remove the [0] => Array from the printed array response. how to do that ?
 
echo array_pop($superAdminCond); but I don't think that is going to be as helpful as you think it is going to be
what exactly are you trying to do with the array? generate a json response?
 
 
1 hour later…
7:34 AM
why does this work for Firefox but not webkits
session_set_cookie_params(.., ..., '.example.com', ..., ...);

Meanwhile this work for webkits
session_set_cookie_params(.., ..., 'example.com', ..., ...);

is there any way around this?
 
8:17 AM
Hello
 
2017 @StackOverflow Developer Survey shows "#Python overtook #PHP for the first time in 5 years" What happened PHP? https://stackoverflow.com/insights/survey/2017/
 
Well, at least PHP is 0.3% more wanted than Assembly and only 0.3% more dreaded than C. stackoverflow.com/insights/survey/2017/…
 
2 days ago, by Paul Crovella
that survey gives javascript as the #1 language for sysadmins, devops, and data scientists... take it with a grain of salt
 
@PaulCrovella I don't actually find that surprising though. Given that pretty much all of our engineers (including data science engineers) have to touch JS at some point. If the only qualification is (do you use JS) then surely it's the most common dominator.
 
8:30 AM
!!rfcs
 
There are no RFCs in voting. Sorry, but we can't have nice things.
 
I do find the notion that people seem to find Redis as the #1 most loved database, though, to be quit alarming.
Who the hell is using Redis as a database? And what's wrong with them that they thought this was a good idea?
 
oh, y didn't put it in voting on the main rfc page... figures
 
 
1 hour later…
9:38 AM
@Jeeves o/ hola
 
@Linus Hola.
 
10:19 AM
Mornings
 
o/
 
!!rfcs
 
Seems like pinning is completely broken?
 
10:40 AM
looks like it
 
10:56 AM
Search engine php.net is inefficient – #74311
 
@kelunik i think it has to do with it not unpinning last time
 
@Jeeves Well, php.net/@ works, but the search doesn't work.
 
@kelunik So What do you think of a iPhone as a phone?
 
!!rfcs
 
11:05 AM
Nope...
Cc @DaveRandom
Also
!!dave
 
@DaveRandom should work on DNS lib.
 
what are the chances of deprecating and eventually removing mb_detect_encoding?
 
Hello everybody, recently I heard that "PHP is dying" and since you guys are experienced I would like to ask your take on that.
 
@Jeeves ...
 
@NikiC Is That because you can not act like a commercial of something that did not create you?
 
user6845426
11:29 AM
If I have data which I'm trying to upload to my db. What can I implement to temp save the data if a connection cannot be made at that time to be uploaded? instead of having to kill the script?
 
@Jeeves jesus fuck, that's a novel.
 
@Danack What is your name?
 
@Jeeves my name is danack.
 
@Danack I like that name.
 
@Jeeves what's your name?
 
11:35 AM
@Linus I just told you, don't you remember?
 
@dipper how often does your database go away? That kind of sounds like an imaginary problem rather than a real one.
 
user6845426
@Danack I thought the same, someone asked me that question
 
if I have arrays for the names of inputs in a form for the days of a week, respectively called

$mondayTimes = $_POST['mondayTimes'];
$tuesdayTimes = $_POST['tuesdayTimes'];
$wednesdayTimes = $_POST['wednesdayTimes'];
$thursdayTimes = $_POST['thursdayTimes'];
$fridayTimes = $_POST['fridayTimes'];
why do I get undefined index errors for those lines?
<select name = "mondayTimes[]" multiple>, etc
really stumped. thanks!
 
user6845426
Have you checked the values?
 
11:50 AM
the values of the inputs?
 
user6845426
Yeh to make sure they're being passed?
 
user6845426
27
A: Undefined index error PHP

AdamTry: <?php if (isset($_POST['name'])) { $name = $_POST['name']; } if (isset($_POST['price'])) { $price = $_POST['price']; } if (isset($_POST['description'])) { $description = $_POST['description']; } ?>

 
Ty guys, reading it
I think I was only getting that error because I hadn't selected any values in the form page lol
err notices
 
12:05 PM
hello...i am trying to get all posts by all users with all comments for each post.
 
don't
 
i have done left join which returns duplicates...the same post is repeated for every comment on that post...is there a way around this?..like keeping all comments for a post in an array
 
@NikiC I understand your frustration on the token_get_all thread, but instead of bailing out on the idea entirely I think your meta-commentary could've been enough to steer the conversation back toward simplicity.
 
if my php code in my text editor is the same color highlight as my html, does that mean it isn't reading the code as php
or does it know if there's a dollar sign in the string to read it as php
 
user6845426
is your file .php?
 
user6845426
What editor are u using
 
yeah php
and sublime text 3
 
user6845426
12:50 PM
I think variables a syntax coloured white in sublime
 
user6845426
i might be wrong though
 
yeah they are
I think I figured it out now! haha
 
user6845426
I used to use sublime but I downloaded phpstorm the other day and im really liking it
 
oh do you have to buy it
 
user6845426
Nope
 
12:51 PM
oh ill check it out sometime
 
user6845426
Check it out ;)
 
user6845426
I'm confused. I have a 2 php files (script.php, FileUploader.php). FileUploader has 2 functions and inside script I call the functions 1 after the other. Does php automatically wait until the first function has returned before calling the second?
 
that's an interesting question haha
ive been working on making a calendar take the values from input in another form
issue is: populating the same day of the week for the entire month
i'm like 85% there
 
user6845426
Keep at it :)
 
it feels good to make progress haha
I know what i need to do but i'm too noob with the syntax of php to know how to implement it lol
 
user6845426
1:00 PM
Glad your code is working :(
 
it's only partially working hahaa :D
 
user6845426
Whats your issue?
 
http://puu.sh/uXT2C/7d0adf2b6b.png
Basically, the user selects inputs for each day of the week (times for appointments)
and every monday, tues, wednesday, etc of that month need to have the same inputs sent as radio buttons with the same values selected.

So, I made an array for each week "<select name = "mondayTimes[]" multiple>" etc.

Then in php,
$mondayTimes = $_POST['mondayTimes'];
$tuesdayTimes = $_POST['tuesdayTimes'];

etc
 
user6845426
Oh php is single threaded. So to answer my question. Yes functions get exectuted 1 at a time
 
it's kind of tricky
oh i see
http://puu.sh/uXT87/a4ef3b6575.png

I know exactly what I need to do: use a single array in the foreach loop and the name of that array changes depending on the day of the week

but I have absolutely no idea how to do that lol
just stuck :(
 
user6845426
1:04 PM
Wait what. I don't understand
 
user6845426
Loop through an array and do what?
 
populate that calendar
as you can see, it has some issues lol
 
user6845426
So you want to loop through through an array of user inputs, and increment the relevent date on the calender?
 
user6845426
what are those radio buttons doing?
 
I have the incrementation down, I just don't know how to use a foreach loop to properly put the values selected by the user as radio buttons
oh, the idea is that it is supposed to work like an office hours sign up
so the user can select one of the dates, enter their name and email , and it will send them an email saying their appt was made
 
1:45 PM
@PaulCrovella If discussion takes significantly longer than implementation, it's time to cut your losses.
 
1:58 PM
Problem 1
    - This package requires php >=7.1 but your PHP version (7.0.15) does not satisfy that requirement.
> $ php -v
PHP 7.1.0 (cli) (built: Dec 17 2016 20:47:35) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies
oO
go home composer, you're drunk
 
user6845426
i h8 mysql
 
Kay
I'm not sure why I am getting this error that says "Unexpected Else" toward the very bottom? Any ideas pastebin.com/UCDDvJXq
Sorry. Nevermind that last question
 
2:16 PM
uhmm.... check it out ^ ^
 
 
1 hour later…
3:24 PM
Hey guys,
I got a kinda basic question.

I've been creating a project with MVC Pattern.
In my Database are some Mapping Tables to create relations.
How do i work with this mapping tables in my Models ?
Or do i just need to work with them in controllers ?
Do i create an own model foreach mapping table ?
I am not that sure how to do this ?
 
lolwut
what are "mapping tables"?
 
join tables.
for many-to-many joins.
 
@Danack exactly
@Danack can you help ?
 
this whitespace wtf. how does a person do that with no shame
 
3:43 PM
lol
 
@PaulCrovella ha
 
:P
 
mt_rand(0, 10) indentation
5
 
hahhaa
 
4:05 PM
@Trowski What's the use case for github.com/amphp/phpunit-util/blob/…?
 
4:25 PM
How many people access stack overflow through mobile ? Am I the only one?
 
Never have
 
user6845426
4:37 PM
Never
 
4:51 PM
@TilakMaddy am in mobile right now and chat still sucks
 
5:01 PM
Wew, first park run today, went well
 
@kelunik It's used here. Stephen Coakley wrote both the method in TestCase and the class being tested.
 
@Trowski I don't think it needs to be in the global phpunit-util, can be in amphp/parallel then.
 
@kelunik Yeah, I agree.
 
user6845426
I have a form with action="".... and then a php script in the same file with: if(isset($_POST['submit'])) { echo "test"' }
 
user6845426
The name of the submit button = submit but my echo isn't happening :(
 
5:07 PM
you should print out your $_POST array to see what data does exist in your post. You may not be passing the data as POST.
@dipper echo "<pre>"; print_r($_POST); exit; to start ...
 
user6845426
i hate programming
 
user6845426
nothing ever works
 
@dipper Oh sweet summer child.
 
With experience, it will work. There is a reason your result is not as expected.
 
"nothing works" is the good place to be in
"everything works... suspicious" is when you hit rock bottom.
 
user6845426
5:13 PM
I might take up ping pong instead
 
A good past time.. good to be diverse. Can't just do ONE thing then you wouldn't see outside of the box.
 
I might take up a less stressful job, like driving nitroglycerine across the mountainside roads in South America.
 
user6845426
having onsubmit=return false in my form shouldn't be the problem right
 
RE-POST:
why does this work for Firefox but not webkits
`session_set_cookie_params(.., .., '.example.com', .., ..);`

Meanwhile this work for webkits
`session_set_cookie_params(.., .., 'example.com', .., ..);`
 
user6845426
oops
 
5:17 PM
gas light
 
5:29 PM
@Trowski I finally found some more time to work on this failing test and I'm starting to think it's an issue with the way UV handles timers
One question I was wondering about, how do we expect ->defer to behave in relation to ->delay(0,?
@kelunik see my comment on the open github issue in amphp/amp
 
5:43 PM
\o Somebody MUST have run php7-fpm in docker container here.
hello
Any ideas why request takes ~2 seconds to respond? running dockerized nginx (http2 and ssl)+php7
 
@animaacija profile it and see
 
how?
ok
 
blackfire is an easy way to get started with profiling
you can also do it with straight xdebug
 
nvm, ill try ... i had a feeling this must be ngnix fault.
thou i havent applied any opcache stuff yet ... this may give such a huge impact ? no...
.. i think
 
no
2s is an insane amount of time for a php script
unless you're waiting that full 2s on IO or something, your code must be pretty slow
it's worth profiling to see what in there can be improved
 
5:55 PM
jeez blackfire.io looks so tasty, thanks!
 
yeah it's amazing, I recommend it everywhere I go
 
evening all
 
evening
 
Is there anybody who accesses a server?
 
@MartinAJ what do you mean?
 
6:08 PM
@animaacija I need to see the result of this code on a real server (not localhost)
echo $_SERVER['HTTP_REFERER'];
 
sign up and manage yr own server
 
is it free?
 
@KorvinSzanto Defer watchers are always executed before any other kind of watcher.
 
$5 a month, if server is up 30 days... if it is up for 1day, then 5$ / 30 = you pay 16 cents
 
whats the reasoning for not just having that be thrown at the end of the queue like js would?
 
6:12 PM
You mean executing defers at the end of the tick instead of the start?
 
@animaacija the problem is I cannot pay at all ... because I don't have any credit card or paypal
 
@kelunik I think that question clears up the misconception I was having
 
Which misconception?
 
in my mind I was thinking of this as a long queue where a set of operations happens on each tick, and I was imagining each of the actions we scheduled to be a /different/ tick
which I think is what I was struggling with
I now realize that all of this stuff is scheduled for the /same/ tick
So yeah this makes much more sense to me just by you asking that question :P
 
In your test it's all in the same tick, yes. In the current test it's four ticks I think.
 
6:16 PM
right with the longer delays
Oh and the nested defers?
 
there are free servers to tinker with.. gotta google a bit.
 
@animaacija digital ocean would end up costing you a quarter or something if you spin a server up to just test that and delete it
 
@MartinAJ neocities.org (maybe no php processing there =/)
 
so @kelunik with this test we care that nested defers are in a separate tick and that longer delays are in a separate tick. Beyond that we care that actions happen on the proper tick and deferred stuff gets processed first?
I think we can test all that with allowing the order of the rest of the actions to be flexible , this has been a great learning experience for me :D
 
@animaacija that's been a long time since I've seen that avatar
 
6:23 PM
@PeeHaa \o m8
how is the bot? Is he here ?
 
hellooo my big brothers
a question
i have an table like this
i want get average of q1 as question 1
q2 as question 2
i know its AVG(q1), AVG(q2)
But How it works???
(2+2+1+0+0+0+1)/7
right?
 
@MartinAJ try 000webhosting
 
i dont want that
i want it gets average of rows which its value is larger than zero
for example for q1 i want it gets (2+2+1+1)/4
how can i do it?
 
2 plus 2 plus 1 then divide by 3
 
may i need to use having
ex HAVING q1>0
 
6:34 PM
@kelunik ping, I think I found one more bug in amp_v1
1. simple async server start listening connections
2. someone connect to server
3. server write something to this socket
4. 100% CPU :(
 
Guys what is Wrong with this?
SELECT AVG(q1), AVG(q2) FROM feedbackresult INNER JOIN lessons ON feedbackresult.lessonid=lessons.id INNER JOIN department ON lessons.deptid=department.id WHERE department.name='computer' AND department.college='science' AND lessons.stage='1' HAVING q1>0 GROUP BY feedbackresult.lessonid
it shows this error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY feedbackresult.lessonid LIMIT 0, 25' at line 1
 
@kivlara Could you create an issue? Maybe also a test case?
@Trowski @KorvinSzanto That's what happens to 05 watchers currently. Colors mark in which tick they're executed. i.imgur.com/r60ZvZu.png
 
I do not get it ... fresh laravel application takes 1.5 seconds to show default welcome page
 
@kelunik and those 05's should all just be on the same tick, right?
 
@PeeHaa can you help?
 
6:45 PM
@KorvinSzanto Yes, the first number indicates the tick in which the thing should execute.
 
ah that makes more sense
this thing needs comments :P
 
Yes. Blame @bwoebi. :P
@KorvinSzanto @bwoebi @Trowski Found the bug.
 
I'm dying to know, type fast
 
@kelunik update:
1. server start listen
2. client connect to server
2.1 client write something to server
3. server write something to this socket
4. 100% CPU :(

https://github.com/umbri/Empower/blob/master/examples/ampv1/server1.php
 
@KorvinSzanto Pushed.
 
6:52 PM
previous example I was using nginx as proxy and was not sure, may be problem was in SSL
and now sure this is somewhere in server
@kelunik U can test this using https://github.com/umbri/Empower
1. start examples/ampv1/server1.php
2. start examples/ampv1/client1.php
 
oooooh I see
that's so obvious once you look at it
returning instead of continuing to the next item in the watcher list
 
@kivlara Executing both doesn't show 100% CPU here.
@KorvinSzanto yup :D
 
@kelunik, what's something else I can do to help out that's small? I have a lot of experience working with generators
 
@kelunik I try using php7.0.17 && php7.1.3 and "prefer-stable": false && "prefer-stable": true
 
@KorvinSzanto Currently mostly writing documentation (github.com/amphp/amp/issues) and reviewing the APIs of all of the other libraries.
@kivlara Why do I have to try all those combinations? What's the one you're using?
 
7:01 PM
@kelunik No no, I try all this and all give me 100% CPU
just in case this will help u
 
Which one gives the 100% CPU? The client or the server?
 
server
 
travis-ci.org/amphp/amp/jobs/215037300 now we have a different failing test, but it doesn't fail locally...
 
@kelunik I just pushed without SSL
 
Guys, i've done some research about user manager systems to use as a base to my project but I'm completely overwhelmed about their unnecessary complexity (imo) so I wanted to ask you guys what would you do if you wanted to create a big project like, for example, facebook.
 
7:14 PM
@kivlara Which driver do you use?
 
@kelunik ampv1
 
7:47 PM
@kivlara I know, but Native, UV, Libevent?
 
8:00 PM
@kivlara I still cannot reproduce it.
---- current RAM: 0.87MB, pick RAM: 0.94MB
Client onDisconnect -> 31
Client onConnect -> 33
Client onData -> 33: ping

---- current RAM: 0.88MB, pick RAM: 0.94MB
That's the output I get.
 
@kelunik i use uv
 
@kivlara I can reproduce it with uv.
 
@kelunik i get data as expected but after write i get 100% cpu
@kelunik is this an uv bug ?
 
Either uv or UvDriver.
 
As i write previous i get some strange 100 cpu somethimes, in one my production project, i hope you find where is this bug, thank you
 
8:12 PM
@kivlara have you tried running strace, to see if there is something weird happening with system calls?
 
@Danack no, i get it at the end of day :) may be on Monday ;)
 
@kivlara Could you please open an issue on amphp/amp?
 
Sorry, not now, may be on Monday
@kelunik can you open it for me ? May be will be solved till Monday ;)
In any case i will open it on Monday ;)
 
Hello
 
@Trowski Do we have any reason to keep github.com/amphp/amp/blob/…?
People could just use array_map(lift(...), ...).
 
8:50 PM
@kelunik I'm pretty sure I didn't introduce the bug :-P // also thanks for fixing - this shows my test was a good one as it was an actual bug...
 
@bwoebi Your test is still horrible.
 
I still cannot imagine anything under the name "lift" and have absolutely no idea what it will di by reading that name...
@kelunik haha :-P
 
Required a debug_backtrace to dump the watchers actually executed.
 
@bwoebi something something monads
 
@bwoebi Same here.
 
8:54 PM
@NikiC hmm?
 
9:06 PM
Filter BOMs out of PHP output – #74312
 
trying to fix the error of 'Array to string conversion'

Can anyone help me with the logic of my foreach loop? I am making a calendar, and the user fills out a form with times (7am-10pm in 30 min increments) they select for each day of the week, and those values are supposed to be sent to the calendar for mon-fri

I made variables that hold the array of values for each weekday (mondaytimes, tuesdaytimes, etc) but when I try to print the array it obviously won't iterate because I haven't put it in a loop, and I was wondering if i should put a foreach loop encapsulating all of my code, or what..
i guess my problem is, I dunno how to choose a different array based on the value of a variable while also keeping the same position across all the arrays
is a for loop, or a foreach loop more efficient?
 
Wes
evening phpeeps
 
9:24 PM
hi wes
 
user6019311
9:57 PM
:36308136
 
user6019311
@Hello You will need a variable to store the index of the day in. Where Sunday will be 0 and so on. When the day changes update the variable.
 

« first day (2352 days earlier)      last day (2600 days later) »