« first day (1462 days earlier)      last day (3712 days later) » 

09:00
in is a reserved keyword. :-)
in is database name
Surround it with ` then
sorry
And you have a database and tablename that are called 'in' ?
@SelvaR As Leri already mentioned, you have to use backticks
sorry, i had little mistake, my table name is "table" , i changed. but still i am struggling.
09:04
table is also a reserverd keyword
@SelvaR same thing
...
surround table with backticks, like table
@SelvaR Use the docs luke
`table`
sorry, can anyone edit my code with exactly
09:06
@SelvaR Try it yourself
if i put 'table' it shows unknown database name
can you show us your code?
she already did
@SelvaR Learn basics first
the new code
09:07
moin
moin @DaveRandom
I trust everyone is getting down?
why didn't you add the backticks around table?
@SelvaR Read basic tutorials!
09:08
<?php

/*** mysql hostname ***/
$hostname = 'localhost';

/*** mysql username ***/
$username = 'root';

/*** mysql password ***/
$password = '';

try {
    $dbh = new PDO("mysql:host=$hostname;dbname=in", $username, $password);
    /*** echo a message saying we have connected ***/
    echo 'Connected to database';

$count =$dbh->exec("INSERT INTO table(name) VALUES ('selva')");
echo $count;
$dbh = null;

    }
catch(PDOException $e)
    {
    echo $e->getMessage();
    }
?>
Also, why would you call a table "table"?
@SelvaR IN and TABLE are reserved words ...
I didn't call my son "Person"
I call mine "boy" ...
but you do call him "son"
09:09
@SelvaR where are the backticks?
@PaulCrovella I went with "Child". It may affect him in later life.
o.k.. i understood ,, what did u say @DaveRandom. but it shows no error
No, because you didn't enable error handling in PDO.
@FlorianMargaine: backticks?
Google "ATTR_ERRMODE"
09:10
@SelvaR use google
(watch until the end...)
i got it.. thanks to all
Is the "but OSX is easier to use then Windows" some sort of chant ?
ThW
ThW
Morning
Today at work I got the feeling, that all the Apple users somehow expect to to be the "end of conversation", especially when they are reasoning whether someone it will actually be the right OS for someone who has to deal with various documents and possibly an unknown number of job-specific niche applications.
Apple products are better because.. they are better! - most popular argument, imo
That's the impression I got
There's a seriously mean line up for @PHPRoundtable on Sunday; @ircmaxell @SaraMG @ramsey @auroraeosrose and @krakjoe. Shame its 3am GMT
I'm so bad at timezones ...
I wonder, what will happen, when it will turn out that the "end user" for whom the computer is going to be bought will need to run some windows-only accounting software
Especially since the guy who is making the decision fall in the "haxor wannabe" category
an octogenarian can choose an apple product because it's easier and that's legitimate ... for a developer, not legitimate ....
09:23
the guy installed ubuntu on his work laptop and is running everything as root
I've taken to recommending apple products to my family. Now when they have problems I reply with "no idea, I don't use apple."
@JoeWatkins the "end user" is somewhere in the 40-50 gap, with sub-par english skills
@JoeWatkins +1000
@tereško It doesn't matter what OS, no accountant ever in the history of time is capable of using a computer, and this is compounded by the fact that all accounting software ever in the history of time is terrible, especially in terms of UX and underlying technology
well the difference is whether it can have the necessary applications
Well a square peg can always be forced into a round hole using all sorts of horrifying hacks
More than once I've seen people running an office full of macs, using a citrix cluster running windows
The first time I was speechless, the second time I just pointed and laughed
@DaveRandom because mac's look so pretty if everyone is using them in a office
;)
Yes, I know. Nothing like a bit of expensive hardware that cannot be maintained in-house to keep business running costs low :-/
@DaveRandom I have said it before and I will say it again. macs are other crap, HOWEVER imac screens are totally fucking awesomesauce
Apart from the panel, why?
09:39
Because pretty, but that is it :)
Function and price over form, every time
But then I also own barely any clothes and all my shoes are full of holes so... I would say that
@DaveRandom It is function. Because I don't know exactly what they are using, but those screens always work better than screens from company x.
A buddy of mine uses a really stupid resolution, but on his mac retina screen thingy it just looks fine
That is an actually legitimate argument, although not one I can comment on
I'm not saying Apple hardware is bad, btw
09:43
I am saying Apple software is bad, and I'm also saying that they should feel bad
@DaveRandom No argument there
@FlorianMargaine The thing in the readme just melted my CPU, not even sure what it is?
(my computer sucks, btw)
@DaveRandom this gif?
Presumably
I do have like 500 tabs open, though
nah, I did notice a slowdown too
09:45
I should do some pruning, but #friday
and I don't think you have 500 open tabs
LIAR!~
~146 (I counted manually, may have lost count at some point)
are you serious?
how much ram do you have?
hi @FlorianMargaine
I have a dream to create my own framework. But until now I don't know how to start and what I need to start. Any suggest?
09:58
Hi everyone
low expectations, high dreams
you seem to have high expectations and low dreams
Are we allowed to ask a question here? a brief one?
@LukeSmith is it allowed by the rules guidelines? :-) room-11.github.io
09:59
sorry, @LukeSmith. you're only allowed 2 and you just used them.
/s/rules/guidelines/
you are not allowed to ask if you can ask a question
6
hi everybody
my first time here
10:00
@JoeWatkins fixed
@FlorianMargaine aww ... I thought I had done it ... I was just about to take over the world ... turns out this message box isn't in control of the whole internetz ....
i see now thanks guys
@PeeHaa all seems to be fine. Just a lot of intro stuff
dream killer
10:01
i was just having issues with xampp
cheers guys i will be back :)
@LukeSmith what kind of issue with xampp ?
ok
my msql databse wont start
how to fetch all the data from database.. i am using try {
$dbh = new PDO("mysql:host=$hostname;dbname=sample", $username, $password);
/*** echo a message saying we have connected ***/
echo 'Connected to database <br />';

$sql = "SELECT * FROM sampletable";

$stmt = $dbh->query($sql);
$result = $stmt->fetch(PDO::FETCH_ASSOC);

foreach($result as $key =>$val){

echo $key. '-' .$val.'<br />';

}
$dbh = null;

}
catch(PDOException $e)
{
echo $e->getMessage();
}
now it display first data only..
you shouldn't use xampp, like you shouldn't wash clothes in ovens ...
can anyone guide me
10:02
@LukeSmith some error?
@SelvaR guide what ?
apache works but when i started up mysql , it does not work
@SelvaR do us a favour and put code like that on pastebin or something rather than right on the screen ;)
@JoeWatkins What's wrong with it besides windows?
im not a terminal guy lol so , just says stopped
10:03
@LukeSmith "does not work" is not an error message
why should i not use xampp Joe?
Unless you work for Microsoft
may i know what is pastbin?
@Leri that's enough ... also, nobody is going to deploy with xampp, it doesn't make much sense to develop in one environment and deploy to a totally different one ...
@SelvaR change $result = $stmt->fetch(PDO::FETCH_ASSOC); to $result = $stmt->fetchAll(PDO::FETCH_ASSOC);
so what do you guys recommend? besides xampp?
what are you deploying too ? use that ... use a vm of that if necessary ...
trust me its not wamp
this is the error i get #2002 - No such file or directory
The server is not responding (or the local server's socket is not correctly configured).
May I suggest looking at the manual of the functions you are using @SelvaR
10:06
@Leri Things that are wrong with XAMPP: 1) doesn't fucking work 2) hides how the individual applications work from the user 3) doesn't fucking work 4) buggers around with config files in such a way that they are unrecognisable so if you do know what you are doing, it's impossible to actually configure anything 5) doesn't fucking work 6) doesn't fit anything more than the very simplest use case (see 4) 7) doesn't fucking work
Oh, also, IT DOESN'T FUCKING WORK
@DaveRandom do you think i should switch to Mamp?
@DaveRandom i get this error #2002 - No such file or directory
The server is not responding (or the local server's socket is not correctly configured). what exactly could be wrong
@DaveRandom You forgot that everything is placed where you don't expect them to be. However, if you're stuck windows...
it's has like 3 different php.inis
10:07
No, I think you should learn how Apache, PHP and MySQL work, which you can easily do with Google and the respective manuals, and install them separately
It's really not that hard
Honest
@LukeSmith i would suggest this environment digitalocean.com/community/tutorials/…
@iroegbu I actually do have two separate php.ini files on my VPS, I specifically compiled PHP to work like that, but yeh that makes no sense in xampp
@iroegbu: from your comments, i mean if i put fetchAll it shows like this 0-Array
1-Array
@DaveRandom @obiNullPoiиteяkenobi will defnitly look into it thanks . But i need to access this database just to download the sql file i have there and i cant now damn.
@obiNullPoiиteяkenobi I personally would avoid centos 7 atm, but I guess if you are a new user it might be an idea to start with systemd since that is supposedly how everything will work soon
I still prefer sysv though, and I simply cannot comprehend the systemd decision to make it really fucking hard to boot into what I would call runlevel 3
10:12
the only way i can fix this is to just uninstall xampp? or there is no fix
It's a question of what you are used to though, so new users are probably better to learn the new ways
@LukeSmith Errors are always accompanied by log file entries...
But I really really really very very highly recommend uninstalling xampp and installing the components separately
I would also recommend a *nix VM, but that's a lot of learning curves to embark on all at once
@DaveRandom i never heard about those i will check them out
@obiNullPoiиteяkenobi Seems to be reasonable: openlogic.com/wazi/bid/351296/…
I was hoping I might be able to add a bcmath backend to bigints to avoid licensing issues by providing a non-LGPL alternative...
guess what license libbcmath is under!
water?
10:20
:-P
Time for a ground-up rewrite!
I cannot speak for the quality, of course
hi guys , how would i start and stop mysql via the terminal? on mac?
@DaveRandom Ooh, looks nice. I'll have a proper look later. Thanks.
@LukeSmith If it won't start, I suggest you just invoke the binary directly and then you can see the console output
@DaveRandom lol dude im new to programming in general so i do not understand
No. There is no love for PHP. Ever. — Fake Name 2 days ago
10:38
hi guys :)
quick question: elegant way to wrap something into an array if it is not yet an array
@fusillicode define "something".
in my case "something" is a string
if(!is_array($something)){
   $something = array($something);
} // I guess
so...the only way is to check...
If you have php 5.4+: $something = [$something];
10:44
@HamZa wtf ... php makes me happy :D
@obiNullPoiиteяkenobi nullptr, is that you :O
@HamZa yes yes ...
@HamZa but with this $something = [$something]; I get an array wrapped into another if I have an array in the first place
If it's always a scalar or an array (i.e. never an object or NULL) then $var = (array)$var will always either return the original array or an array with the value at the first index
@fusillicode With the if statement ofc. It's just to show you there's another syntax for arrays
10:47
@HamZa k my bad I didn't understand it :)
btw what @DaveRandom suggested seems to be close to what I was searching for
and now I remember using it somewhere before
be warned: doesn't work with objects
Crucially (for you) this means that __toString() will not be invoked
Also, ((array)NULL) === []
got it @DaveRandom ;)
btw ty a lot for the help @DaveRandom @HamZa :D
(array)(string)$var will be safe if input is always scalar, but will break if $var is already an array
@DaveRandom hey dave i got it working !! stoked
user924016
morning!
10:52
@LukeSmith What was the problem?
i had to change the host to 127.0.0.1
@DaveRandom in config.inc.php
That's not actually mysql no starting then, it's phpmyadmin (?)
New post goes live in 7 minutes
user924016
yay
user924016
/me tunes in and refreshes
10:54
yes it was that :)
@ircmaxell Is that the fig letter follow up?
@ircmaxell Did you see phil's blogpost about the league? :)
No
Eih
And 4 hours till plane flight...
posted on October 17, 2014 by Anthony Ferrara

A few days ago, I wrote An Open Letter to PHP-FIG. Largely the feedback on it was positive, but not all. So I feel like I do have a few more things to say. What follows is a collection of followups to specific points of contention raised about my post. I'm going to ignore the politics and any non-technical discussion here. Read more »

11:12
There is some slightly shitty attitude to the league in here actually, namely accusations of elitism that themselves come off as a bit elitist: chat.stackoverflow.com/transcript/message/11266172#11266172 (starting there, not that specific message)
11:23
Friday!
@ircmaxell You really are totally right. I've never really known what the fundamental problem with recent PSR proposals was; I just knew they're bad. Thanks for putting it into words.
(Well, not bad per se, but as you say, not suited for a simple implementation)
hello, anyone using the HWIOAuthBundle ?
Also, IMO Logger PSR is too overloaded. Really.
11:46
also, IMHO, just pretending that the only way to log behavior is by injecting a logger, is (at best) naive
11:59
@ircmaxell Sorry had to stuff my face philsturgeon.uk/blog/2014/10/…
Also at all others in here, because we are mentioned ^
:D
> A lot of people, who I know and respect, were being utterly obnoxious about it all on StackOverflow Chat.
hit my 85% data usage warning on the train to the airport...
I will reply to Phil online about that. Because I get where he is coming from, and we likely did cross a line, but still...
@ircmaxell Yeah I kinda / somewhat agree but still indeed
@ircmaxell Can you not get "all you can eat" data in the US?
I'd rather pay a little bit more for that peace of mind tbh
lol
I can never even get close to my 400MB allowance
maybe because I try to avoid using youtube from 4G
hello friends
how to check the string only contains numbers, + and space in php?
I am looking to insert phone numbers
user924016
12:11
@Gunaseelan what have you tried so far?
it's just incredible how much time people seem have for fussing about $things on the interwebs
preg_match(^[0-9 +]$, $tel)
@RonniSkansing preg_match(^[0-9 +]$, $tel)
crl
crl
Can I connect to a mysql local file with PDO?
5
^ word salad
crl
crl
seriously, or what is the way to do it?, a user_log.sql: I want to query it with PHP
12:15
+, Numbers and space are allowed in phone number
others not allowed
@RonniSkansing Do you any idea dude?
@tereško just browse Anthonys images and you quickly have downloaded a few many bytes...
12:29
hi guys
someone familiar with laravel ?
crl
crl
ahhh damnit I can't import files larger than 2000 kb in phpmyadmin
user924016
@Gunaseelan maybe something like /^[0-9\s\+]+$/
Thanks @RonniSkansing I will check and let you know the result
12:59
@DaveRandom Upon further inspection, this is awesome. Thank you!
user924016
@StefGeelen you can ask your question. Consider pasting a minimal example in pastebin/pasite.
user924016
*pastie
@AndreaFaulds I just Googled "gmp alternative" and it turned up stackoverflow.com/questions/6307458/… (fyi)
Maybe upvote that answer :-)
Aha :)
See, this does all the things.
It lacks all the problems with GMP.
1) Liberally licensed (unlike GMP), 2) Returns error codes rather than bailing out on memory exhaustion (unlike GMP), 3) Nothing else uses it so we're free to use our custom allocators (unlike GMP)
and Tcl apparently uses it, so it's battle-tested.
13:14
Yeah :D
OOH
It's packaged in Homebrew and Ubuntu, so I don't need to figure out how to integrate it with the build system :)
aaaand this means I don't need to rewrite ext/gmp
This is so awesome! Thank you @DaveRandom!
np, although you should really be thanking Google, I'm just a badly trained monkey :-P
There's also github.com/libtom/tomsfastmath but that looks kinda scary
Although that would actually be a big problem for a core dep of PHP
13:22
@DaveRandom Would it?
Couldn't you build libtommath with MingW?
You could, but there are weirdnesses that you can run into if you don't use the same underlying CRT for lib and consumer
They may not apply here
it seems libtommath can be used, and libtom if possible on linux
 * This project is meant to fill in where LibTomMath
 * falls short.  That is speed ;-)
It's to do with sharing system-defined types (e.g. FILE is one that I know is problematic, you can't pass handles across DLL boundaries unless they use the same CRT)
13:24
That's TomsFastMath, not libtom.
This is the reason that ::dump() methods currently don't work in the Windows jitfu builds
Anyway, I'll use LibTomMath. TomsFastMath is all inline asm, ew, and I'm not sure if it's battle-tested.
@DaveRandom D:
Yes I'm not a huge fan of the API design of libjit in that respect
There's no way to dump to a char*
crl
crl
I've a question, I need to query a count of a column per hour, is it necessary to do 24 prepared queries or there is a trick?
@crl Might be possible with subqueries?
(I'm no SQL expert btw)
crl
crl
13:26
Thanks I'll look
You should be able to do something funky with GROUP BY
Or that.
crl
crl
@DaveRandom oh right, thanks
Might involve turning it into strings though
which would suck a bit
not sure, you might be able to GROUP BY HOUR(col) or something like that
@crl just do select HOUR(time) as hourValue, column1, column2 from table group by hourValue ?
You wouldn't get a column per hour, but you could arrange the results how you want in PHP.
13:29
Yeh transposing is never a good idea on the DB side anyway
at least, assuming MySQL
Or you could do something absolutely horrendous with 24 case statements.....but don't do that.
crl
crl
I try not to
@DaveRandom how would you do that?
Bandwidth is important when it comes to websites. And single quotes are half as wide as double quotes, which saves lots of bandwidth over time. Because the internet is a series of tubes, not like a truck, and you gotta cram all those double quotes into those tubes they can get clogged up. Single ones slip down easier. — Will Jul 27 '10 at 18:47
@SecondRikudo still in the game development bussiness? :P
@crl Hang on, let my try it out
crl
crl
13:38
oh cool, I'm stuck
I need 24 columns
I have this weird problem. Sorry if it's a noob experience. But I am still baffled about it.

I have htdocs in my root folder, as well as its subfolder. I deleted the one inside subfolder, it also deleted the one in my root folder. Why is that?
good weekend to everyone
@SergeyTelshevsky :)
@Carnal The only thing that sounds likely is that they one was a symlink to the other file?
@crl just write some code to re-arrange the data...
crl
crl
group by is working, I just forgot to do a while to get all results
13:43
Anyone know if uwsgi is a python only thing or is it used for other stuff?
Also is it any good or just a load of...not good stuff.
@Danack WSGI is a Python thing.
Yeah I was just wondering if it's Python only, or if it's so good that non-python applications have started using it.
@Carnal Without code, we'll be guessing for it..
13:46
@Danack How the hell would that work? It's a Python API.
@crl 24 columns isn't a good idea, you should manipulate it in PHP to do that, but sqlfiddle.com/#!2/c9a87/1
@AndreaFaulds Bandwith is important, but you are willing to work with subqueries? :D
I was having issues with wordpress, which was inside a sub directory, i deleted the .htaccess file to reset it. Turns out it also deleted the one in the root folder
that's why I'm wondering
@AndreaFaulds "Thanks to its pluggable architecture it can be extended to support more platforms and languages. Currently, you can write plugins in C, C++ and Objective-C."
Ah, uwsgi isn't to do with WSGI at all
13:49
@Carnal ah wordpress.. I'm out :D
He said it, we're all thinking it
/me feels like a typist
But wordpress gives out cash. D:

Clients demands for it. D:
user924016
@Carnal unless it was a shortcut, I do not think it happend.
user924016
Try just recreating the files and try again
13:50
The last time I did that messed up my websites. lol
I had to contact my service provider in order for them to fix it as I do not understand it clearly enough.
user924016
Well wp has alot hardcoded urls, so you have to not only fix the .htaccess but only search and replace with some tool in the db
@Leri What, so, like, you arbitrarily don't like strings or something?
god damn floats, coming over, stealing our digits
It also affected my other websites that has htaccess (separated in subdirectories).
They took our jobs digits!
non-wordpress sites
13:52
i wrote 0 php code this -week- month :(
For the past week and a half, I've been a C# nob.
@DaveRandom You were right, interacting with Win32 API is a ballache.
isn't it a well designed one?
@DaveRandom Nope, I hate typing bunch of code just to satisfy microsoft's needs. :-)
.net is less bad, but it's still bad, and it's a pretty leaky abstraction, you usually end up having to hit raw DLL functions
@Prasanth lol
@DaveRandom For web (I mean http) .net is awful platform, imho
13:55
The win32 API somehow manages to be worse than a lot of posix equivalents, I'm really not sure how that managed it
@Leri I like to pretend ASP.net doesn't exist
crl
crl
@DaveRandom thanks
The only reason you would ever write Windows native code is for Windows native apps
@DaveRandom Well, same goes about mvc 5. However, C# is great for mobile/desktop app or service development.

« first day (1462 days earlier)      last day (3712 days later) »