« first day (2353 days earlier)      last day (2598 days later) » 
00:00 - 15:0015:00 - 00:00

3:13 PM
@dipper You echo consistently for all 3 of them
And you make them look differently with CSS
 
user6845426
If I'm just looping through them foreach how do I specify a different class name for the divs? I'll show you what i've got
 
user6845426
gist: d2ad9a41a5de645fa568f68573737057, 2017-03-26 15:14:41Z
$grabProj = "SELECT * FROM projects ORDER BY id DESC LIMIT 3";
            $result = $conn->query($grabProj);

            if ($result->num_rows > 0) {
                while ($row = $result->fetch_assoc()) {
                    for ($i = 0; $i < count($row); $i++) {
                        if ($i = 0) {
                            echo
                                '<div class="col-md-12" style="overflow:hidden; padding:0;">
                            <img id="zoomer1" src="assets/one.jpg" />
                            <h3 class="image-overlay">' . $row['projectname'] . '</h3>
                        </div>';
                        }
                    }
                }
            }
 
user6845426
I think its failing on the if ($i = 0) though
 
user6845426
Because the first result gets wrapped in div col-md-12 and the 2nd/3rd get wrapped in div col-md-6
 
user6845426
3:18 PM
oh i should be using ==
 
user6845426
that kinda works, now i'm just getting 3 times as many. Im guessing its because of the while loop
 
user6845426
If I remove the while loop and just have $row = $result->fetch_assoc(); when I set the names in <h3> tag how can I get a proper reference to the correct row. I've tried $row[0]['projectname'] but that didn't work
 
anyone good with apache mod_rewrite
 
@dipper You know that bootstrap is a framework
Not a theme, right?
As in, you still need to write your own CSS, on top
 
user6845426
Yeah, i'm only using col-md-x for grid system
 
3:25 PM
does anyone have any experience with using ajax to get info from a php file every few seconds or so? i dont know much about it but im stuck if anyone could help me
 
user6845426
Why don't you make a timer function which calls your ajax request? @RachelDockter
 
well i have this so far, is this on a timer?

					<script>
						 function ajaxcall(){
							 $.ajax({"functions/displayUserPostsDynamic.php", function(data) {
									console.log(data);
								}
							});
						}
					</script>
 
user6845426
window.setInterval(function(){
  /// call your function here
}, 5000);
 
forgive the indentation
 
user6845426
that sets an interval of 5 seconds
 
3:27 PM
can i add the ,5000 to the code ive already got?
 
javascript room is that way ---> chat.stackoverflow.com/rooms/17/javascript
 
user6845426
5000 is just specifying milliseconds
 
i asked in the js room but its really busy and mine links to php aswell, the ajax call is just the start
 
user6845426
Have you tried that code?
 
i tried the code i put, im not sure if its on a timer but i got Uncaught SyntaxError: Unexpected token , on line 745
there isnt even 745 lines
 
3:29 PM
@RachelDockter that you happen to be using php on the server side is immaterial to your problem here being about javascript, take it to the right room please
 
If I have an input text box, how do I put the text value the user entered next to a radio button that the user selected when the submit button is pressed
 
I really need help with mod_rewrite
 
Isnt it a bit unnecessary or is this strictly php?
strictly php chat*
 
@user7594714 Well, you didn't tell us what kind of help you need, or what your problem is.
You just told us that you really need help, so... help given.
Until more details are provided.
(As a general rule, in chatrooms, don't ask if you can ask, just post your question)
 
3:43 PM
Nvm, found it. My bad.
 
\o
 
user6845426
\o/
 
does it matter where my php code goes if the code just deals with a submit button being pressed
 
@Hello "where it goes"?
 
3:58 PM
nvermind! figured it out
 
user6845426
@MadaraUchiha you still didn't explain what you meant by me using bootstrap as a theme
 
@kelunik We can add the v1 of filter backā€¦ but clearly it hasn't been missed. Same could be said for removing map, I doubt it would be missed.
At the same time it costs us almost nothing to offer them, so is there a point in removing them?
 
@Trowski It's API to test and learn and document.
 
4:14 PM
@kelunik It's tested already, fairly easy to document. I definitely see your point though. With coroutines I really don't see much point in map and filter.
 
Hello All
is phpmyadmin client mysql ?
 
@kelunik @bwoebi I'm fine with dropping lift and map (and not adding filter again) if you don't see the need.
 
I'm fine with this.
 
Same here.
 
4:30 PM
@bwoebi @kelunik some and any seem unusual. Could some take an argument of how many promises must resolve?
 
can someone tell me if i made this array wrong, when i print it, the array seems to have all the info added twice

		$currentPost[] = ['post_id' => $row["post_id"],'user_id' => $row["user_id"], 'post' => $row["post"], 'date' => $row["date"],'votes_down' => $row["votes_down"],
		'votes_up' => $row["votes_up"]];
 
@Trowski Yes, I'm fine with that. Also saw that React has an takes an argument for some.
That way we can remove any completely, because it will just be some with 0.
 
@kelunik Exactly.
 
evenin r11
 
@RachelDockter So how do you print it ?
 
4:35 PM
@Sayros print_r(array) i think ive fixed it now
 
@kelunik And all, because it's just some with count($args) ā€¦ duh.
I think some($promises, 0) is less intuitive than any($promises)
 
We can keep any and just make it call some($promises, 0).
Same for all.
 
all has quite a different return value.
 
ah right
all() has no failures
 
some in other implementations only returns the array of successes.
Have you ever used the array of failure reasons?
 
4:41 PM
stackoverflow.com/questions/43031504/… can class instance can be swapped?
 
@Trowski For some or for any?
 
@kelunik Either.
 
@Linus an instance of a class is called an "object", what that guy is doing is just changing strings
 
ah thanks :) that heading make me confused ..
 
4:51 PM
he's taking inspiration from laravel's "facades", so expect anything he says or does to be wrong
 
:P lol
 
Wes
@PeeHaa happee birthdaay
 
When I press submit on my page, it gives me Warning: Invalid argument supplied for foreach()
why are they related?
 
5:07 PM
@PaulCrovella oh joy
 
5:25 PM
@PaulCrovella whats wrong with "facades"?
 
@Kamran facades are great, but what laravel calls a "facade" aren't them - instead they're just static access to a service locator. laravel uses "facade" as a marketing term because the author decided to dress up globals and sell them as something clever.
 
@PaulCrovella i never heard about facades outside of laravel. where can i read more on facades?
 
@Kamran amazon.com/… .. en.wikipedia.org/wiki/Facade_pattern .. most google search results for "facade pattern"
 
@PaulCrovella thanks!
 
5:43 PM
@Kamran the morale of the lesson is: never learn about patterns from a framework
5
 
Wes
6:34 PM
ping room
@bwoebi @Trowski around? can you join the design room please?
 
7:23 PM
What do you think of the idea of having a type checker in if natively like this?:

$foo = 'bar';
if($foo): string {
   echo '$foo is string';
}
else{
   echo '$foo is not string';
}
 
@Slowaways something wrong with php.net/is_string?
 
Wes
i think he's referring to variable type declarations, e.g.
String $foo = "foo";
types are great, but tbh i would never use that if we had it
type checks around a function scope is already more than enough
@PaulCrovella i.imgur.com/6ixmoP3.png click me
 
@Wes the color reinforces the squid look
 
@PaulCrovella Yes. The code does not get clean.
 
Wes
i.imgur.com/mjImpje.png click this then :B
 
7:29 PM
@Slowaways explain what you mean by that
 
My eyes accuse something.
Hahaha
 
@Wes can't unsee the squid at the moment.. but other than that I like it
 
This is so clean =P:
if($foo): string {}
 
lol
 
7:32 PM
@Slowaways that looks like you're trying to specify a return type on an if statement
@Wes that room is full of squids!
 
Wes
don't say that or @kelunik will ask me to do another logo :D
 
I, for one, welcome our new squidephant overlords.
5
 
user6845426
o/
 
user6845426
\o/
 
user6845426
7:40 PM
I have a query which when executed, loops through the results and creates a load of divs... How would I go about making these clickable and then takes me to a new page and allows me to create a new query with that unique information? I'm just looking for some literature :)
 
user6845426
SHOW ME THE LIGHT
 
user6845426
My thought is for each div created, give an id of whatever the data's id is
 
@PaulCrovella lol
@wes why does that half moon have a tusk?
 
7:58 PM
from eyes i can see he is scared...
 
@Wes tnx :p
 
Wes
@PeeHaa i hate you. and @kelunik should hate you too. seriously, no jokes, we are too sensible to critiques right now :B
 
@Linus you are looking at it wrong it's happy moon
@Wes i already told you guys to just pick something :p
Also I think I like the green halfmoontusksquidephant
 
Wes
why even doing stuff if it's not done properly
 
:{
 
8:01 PM
yes, pick something so we can properly settle into a line of jokes about it.
 
:-D
 
Wes
this is how it looks at 1:1 device pixel ratio, logo sized
type face is totally random
 
s/random/bad
 
Wes
yes, that's another fitting word
it's an acronym, can't use lowercase, i think. and all uppercase is hard
works for me. depending on the site i would go with something red/magenta, orange
 
it's a logo, you can use whatever case you want
 
Wes
8:05 PM
 
!!poop
 
šŸ’©
 
Wes
@PaulCrovella there aren't many fonts that look good all uppercase... or at least, i don't have them :B
that was the first i've found that didn't look too bad
 
so don't use all uppercase
 
Wes
are we ok with that? @kelunik @bwoebi ?
 
8:10 PM
if they have a problem with it then what you do is find a font that works well in any case, then make your own font swapping the needed lowercase glyphs in place of their uppercase counterparts - tada, all uppercase logo
 
@Wes Could you link the older variant of it? There's something that was better in the older version.
 
@PaulCrovella that's just deep man
Your job sucks @Wes :)
 
Wes
@kelunik the wrinkles, probably
will add them, probably :B
 
I think the eye shouldn't have the blue around it and the tusk was better when it was round.
Not sure whether it needs the wrinkles.
@Wes When it's small it looks better, so I think some details need minor changes. And the font needs to be changed. Otherwise +1.
 
the wrinkles detract from its squid nature
 
Wes
8:16 PM
@PaulCrovella moar spirals!
moral of the story is, i hate spirals :B
but yeah, will try to add them
 
o/
 
user6845426
o/
 
Wes
ahahahahahahahah
 
8:27 PM
@Ekin we can't properly assess that until we get the photo of you in the sombrero
 
@PaulCrovella agreed cc @Ekin :p
 
I have printed ones... Not sure if I can be arsed to take a picture of a picture :P
 
Wes
just get him a lasso, and it'll be perfect
:D
 
lol, indeed :D
 
@Wes :D
It could have been better even. I could have been riding an elephant now, but the guide fot confused :D
 
8:38 PM
:D
 
Ohai guide :p
 
Wes
AHAH yippeehaa ki yay
 
user7442629
Which would be easier to learn, PHP or JavaScript, with knowledge of Python, C#, C++, and Java?
 
@Aleksbgbg Probably PHP, because its object orientation model is more conventional than JavaScript
If you know Java then PHP will look very familiar
 
user7442629
Sounds good, guess I'll be doing PHP before JavaScript
 
8:53 PM
would anyone know how to convert age to date of birth? i could only find 1 link on google which was $dob = date('Y-m-d', strtotime($age)); which didnt work for me :/
 
@RachelDockter Give me an example of what is in $age there?
 
@Sara 23
 
So, integer number of years?
 
I swear to god, 23 is the number I have been trying now eval.in/761555
 
exacly yeh
lmao magic
 
9:01 PM
eerie feeling
 
How do you expect to turn that into a date of birth (ignoring PHP, just like... in general, that's not nearly enough information)
 
i thought strtitime was some sort of function that does that
 
Someone who is 23 might have been born exactly 23 years ago, or 23 years, 11 months, and 30 days
How? Magic?
 
im just going by what some guy on a forum said lol thats all he had
 
Forget the forum, forget you're dealing with computers at all.
If I tell you, "I'm 23 years old", do you know what my birthdate is?
 
9:03 PM
only the year i guess lol
 
Exactly
And technically, not even that.
 
how to you determine that year? Which other information do you need to get the the year of birth?
 
I might have been born in 1994. Or maybe 1993 and my bday hasn't come yet
If you, as a human can't work out the answer from the information provided, then there is no possibility a computer can.
 
i was just thinking if ur 23, rewind exacly 23 years ago from now and ur either born or your not
so i could do the year but thats it
no wait
 
> exacly 23 years ago from now
 
9:05 PM
i think ill just make the input a date instead of integer lol
would make things eaiser
 
date('Y-m-d', strtotime("$age years ago")) is probably the answer to the question you're asking, but you're asking the wrong question in all liklihood
 
yeh i get what u mean, i should of saw that before i started
 
wait how does that work
it just guesses by using todays date?
 
9:08 PM
It works because strtotime() is actually quite clever
Not a guess. It's telling you the date precisely 23 years ago. It's not saying "This is their birthday", it's saying, "This is the date 23 years ago, today"
 
ahh so if for example u wanted people between the age of 10 - 23, that would work wouldnt it?
no wait it wouldnt
 
You'd need some fuzz
 
what do u mean fuzz lol
 
You need to push the lower bound of your age range an extra 364 days (maybe 365 for leap years)
And you'd have to extend the upper end as well, come to think of it
Or maybe just upper end.
Not sure what you're trying to do exactly
 
well i have a database of users with their date of birth and a table in php where you can filter uses by their age with a minimum and maximum
 
9:12 PM
!!xyproblem
 
1049
Q: What is the XY problem?

GnomeWhat is the XY problem? When asking questions, how do I recognize when I'm falling into it? How do I avoid it? Return to FAQ index

 
:-)
 
@RachelDockter What SQL backend?
 
yes i use mySql
 
WHERE (DATEDIFF(NOW(), user.dob) > ($minage * 31557600) AND DATEDIFF(NOW(), user.dob) < ($maxage * 31557600))
Let the database do the work for you
31557600 being the number of seconds in a year (on average, given leap years)
 
9:17 PM
oh this looks promising thankyou ill try this
 
something something INTERVAL 23 YEARS
 
Results will be plus or minus a day due to dob most likely not having time of birth and jittle due to leap year, but it should do the job
Yeah, there may be a better answer hre
 
yeh its only for a school project so that should be fine
 
But that was the quickest thing
Oh, yeah, indeed...

WHERE (DATEDIFF(NOW(), user.dog) > INTERNAL $minage YEARS) AND DATEDIFF(NOW(), user.dob) < INTERVAL $maxage YEARS))
Which will be much more readable when you look at this years from now :)
 
thats perfect thankyou, much appriciated
 
9:25 PM
@Sara There appears to be a typo at "user.dog".
 
Wes
9:36 PM
like? :B
 
I love how it also looks like a wasp with an oversize subportion
 
"I'll swallow your soul!" - Pinky the squidephant
 
welcome all elephpasp
@Wes pretty cool indeed!
 
Wes
 
@Wes very nice shadows.
 
Wes
yeah starts to look actually good :D
 
@Wes It's staring into my soul.
 
Wes
i thought you were a devil or something, also probably ginger @MadaraUchiha
 
10:09 PM
@Wes Both.
 
Wes
lol
 
Wes
10:25 PM
and with that i'm done :B
 
Hello, what is the best way to increment the values inside of array +1?
 
Wes
you want to add 1 to all entries in an array?
foreach($a as $k => $v) $a[$k] += 1;
 
yes, that
 
Anonymous
@PeeHaa happy birthday. go and get wasted
 
11:18 PM
@samayo thanks and ^
 
Anonymous
11:58 PM
@PeeHaa nice pic.
 
Anonymous
where is that btw?
 
Anonymous
My birthday is in 2 months, and I am thinking about going to Amsterdam for 3 days.
 
00:00 - 15:0015:00 - 00:00

« first day (2353 days earlier)      last day (2598 days later) »