« first day (1816 days earlier)      last day (3358 days later) » 

00:06
okay i've just updated php and apache as they were behind a few minor versions and my bug has gone
:l
00:45
hey, this is a php/mySQL question. Currently I'm using a int type for a column named "created" to keep track of when an entry was made. The int value represents time since epoch in seconds.

Do you see any advantage to changing this to a datetime or some other type of column type? and why?
01:17
datetime, because int will cease to be useful in 2038
23 years is a long time, but not too long
01:28
@NikiC @Andrea about the void RFC. We certainly won't have 'void' as type declarations or (void) for casting so why not function() : {} to denote void? It avoids a reserved word. PS: just a half baked thought.
ew, no
@ScottArciszewski why will it cease to be useful in 2038? Can't I use big int?
I know it's ugly...
why can't you use null?
I don't know, maybe everyone will switch to 64-bit UNIX timestamps between now and then
I think most programming languages support integers larger than 32bits now, I'm not sure that's going to be an issue. Thank you for your answers though.
I might switch over if it's just considered best practice to use a datetime type.
Hi I'm planning on building a website and I was wondering if anybody could help me?

I was looking for a CMS, what would support customer accounts, billing, a store and a website (blog, guides, etc.). Is their a free platform like this or would i have to code it my self? PHP
Also i would be charging for services that my business provides - order and pay online and then our office will send someone out
@Andrea any help? scot2scot lol
user5020521
01:58
can anybody tell me what am I doing wrong?
user5020521
<?php
//call the connection file
require 'connessione.php';
//errors enabled
error_reporting(-1);
ini_set('display_errors', 'On');
try {
        $result = array();
		$dbh = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
		// set the PDO error mode to exception
		$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
		$sth = $dbh->prepare("SELECT * FROM tagesroma ORDER BY RAND()");
		$sth->execute();

		/*fetch the data*/
		$result = $sth->fetchAll();

		$json = json_encode($result);
I don't see where you are setting any values for $servername, $dbname, $username, and $password.
user5020521
I have php require enabled
try printing the error for $sth. it should be something like $sth->error
user5020521
console.log says
user5020521
02:02
SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 4136 of the JSON data
console.log as in from javascript?
user5020521
what I am going to do is to convert php data using JSONparse
your vardump is screwing that up.
user5020521
yes that comes from javascript since this php file is the url parameter inside my ajax request
user5020521
should I remove var_dump?
02:04
you're echoing it out in json correctly, and then in javascript it should be able to parse that.. but in your php you have it also echoing out the vardump.
yes.
user5020521
thank you, I will try however may I ask you why should I remove it?
also, you should echo out the error in JSON if you don't want that same error to happen when there is a database error.
user5020521
could you suggest me how?
because JSONparse is only going to be able to parse JSON formatted text. Before you parse the JSON, in the javascript, type "console.log(result)"
where result is the variable that holds the JSON text before it is decoded with JSONparse.
user5020521
as far as the var_dump I just dit what I read on php.net I believed it was useful to attempt to handle the error before the parse
02:06
yes, but your javascript doesn't know the difference between the JSON being echoed and the var_dump also being echoed.
you need to echo everything in the JSON format at the same time.
I assume you're doing this with an AJAX call?
user5020521
that's right
user5020521
I want to validate the php data before the ajax request
user5020521
furthermore I use a callback function inside the ajax request in order to separate each function
user5020521
am I doing good?
I'm not sure as I can't see your javascript, but I'm sure that can work.
user5020521
02:09
here is my javascript my friend
Your problem is that your php isn't outputting ONLY JSON formatted text.
you have the var_dump at the end.
and even the chance of it echoing out an unformatted error.
user5020521
function caricaDati(idDiv, url) {
    if (idDiv=="") {
        idDiv.innerHTML="";
        return;
    }
    if (window.XMLHttpRequest) {
        //code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else { //code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }

    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            costruisciRighe(xmlhttp, idDiv);
        }
    }
    xmlhttp.open("POST", url, true);
user5020521
that this make sense to you?
Okay 1) use jquery for that.
user5020521
this is an exercise I am attempting to handle it via pure js
02:10
2) wrap the JSON.parse in a try catch block if you don't want to make sure your PHP is always formatting its output as JSON encoded text.
user5020521
just wait maybe you need the whole wall of code
user5020521
do I show you everything? so it'll be clearer to you what I am doing
try this please
?php
//call the connection file
require 'connessione.php';
//errors enabled
error_reporting(-1);
ini_set('display_errors', 'On');
try {
$result = array();
$dbh = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sth = $dbh->prepare("SELECT * FROM tagesroma ORDER BY RAND()");
$sth->execute();

/*fetch the data*/
$result = $sth->fetchAll();

$json = json_encode($result);
echo $json;
i left out the first < on accident.
user5020521
ok I will try it now however check it out please jsfiddle.net/jt9wz39p
user5020521
this is the whole javascript code which is supposed to create a runtime table and fetch data via ajax using an onload event attached to the body tag in the html page
user5020521
02:15
in the meantime I will try this
user5020521
hey my friend is there a way to keep json_last_error()?
user5020521
this is pure curiosity
user5020521
hey now I have 500 internal server error returned
well a 500 internal error is usually a problem with the server, I'm not sure how to help.
user5020521
this error fires after the edit
user5020521
02:20
so I really believe it is related to the php array
perhaps I missed a semicolon, but it also sounds like you don't have php errors turned on.
user5020521
I do have php error turned on
user5020521
didn't you look at the beginning?
well it usually gives you a syntax error if there was a problem with the code.
do you have it turned on in the servers config file?
user5020521
did you look at the fiddle too?
user5020521
02:22
console.log(result);
var phpObject = JSON.parse(xmlhttp.responseText);
user5020521
are these lines correct?
user5020521
is $error defined?
user5020521
maybe it was in my previous code....
user5020521
I just don't know
Hey All,

I am new to regular expressions. I just want to make a regular expression for a non-negative number. This is what I have tried so far: $number = '/^\d*(\.\d+)?$/'. This is giving correct results for all cases except that it also considers "" as a valid number.
Could someone help?
02:32
very odd, your jsfiddle doesn't seem to work because it can't find the init function.
but clearly it's there..
i even ran a test using foo() and it wouldn't work.
You mean my regular expression is correct?
sorry that was directed at riccardo
Riccardo, there is something wrong with your jsfiddle. I think it's an error on their end. Start a new jsfiddle.
user5020521
wait it works now
user5020521
@Porlune i did this way <?php
    //call the connection file
    require 'connessione.php';
    //errors enabled
    error_reporting(-1);
    ini_set('display_errors', 'On');
    try {
        $result = array();
        $dbh = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
        // set the PDO error mode to exception
        $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        $sth = $dbh->prepare("SELECT * FROM tagesroma ORDER BY RAND()");
        $sth->execute();
user5020521
the ajax is made but I have some problem with the cascading sheet style
02:44
css is annoying.
why don't you want to use jquery?
user5020521
user5020521
I don't want to use jquery because I am quite a beginner and want to handle the ajax via javascript correctly
well, correctly would be to use jquery.
user5020521
jquery is a lib and if you can't handle the ajax correctly you will fail miserably whenever you try to use it
jquery is easier than css
user5020521
02:46
as far as I am concerned, matter of fact it is just my opinion
I use jquery a lot. It's fantastic, and it will make this much easier for you.
anyway, as for your css
user5020521
did you look at the page?
user5020521
*link
you're going to want to use display: table, table-row, table-cell to build your grid.
yes
2
A: How to use PHP generators without foreach?

Paul CrovellaThe first yielded value wasn't swallowed, you just never looked at it. $g = powGenerator(); echo $g->current(); //a You're then twice sending in values and resuming execution, $g->valid() is true after this because you haven't resumed after the third yield - the generator isn't complete and th...

^anything I should change or add to this?
user5020521
02:49
this is the update fiddle
user5020521
(I don't use generators quite as often or freaky as some of y'all here.)
03:03
I have no idea what a php generator is
user5020521
however the css works correctly now
Yah, that jsFiddle doesn't run for me. The console says your inizializza function isn't defined.. but clearly it is.. somethings wrong with that jsFiddle.
There is HTML at the end of the JS section in the jsFiddle you supplied @Riccardo990
user5020521
03:28
Corrected look at this jsfiddle.net/jt9wz39p/8
03:47
Morning
Morning
morning
04:52
\o
morning
05:55
@JoshWatzman Hi Josh :)
I saw an answer you gave to someone that linked to this document: github.com/hhvm/user-documentation/blob/master/guides/hack/…
the document is confusing and poorly written, and I was wondering if you would accept a PR if I rewrote it ... more effort should be made to separate the pattern of parallel concurrency and asynchronous concurrency, asynchronous concurrency is not "the next best thing to multi-threading", it's nothing to do with it, it has it's own use cases, own pattern etc ...
your answer opened by acknowledging that hhvm users are confused, and I think documents like that are partly to blame ...
morning all
@JoeWatkins morning
morning
can anyone help me with this question ?
don't understand how to use the where clause here that we do in sql to check.
I honestly don't see the need for async/await in #php when we already have yield/yield from. Am I crazy?
@rdlowrey didn't you say the other day that php needed an event loop ?
you know the two are not so far apart ...
06:14
morning
I don't see what his lack of sanity has to do with it.
Yea I mean, one question per tweet please.
o/ Someone knows what logo this is? king-foo.com/portfolio hover the first project, what is that 'M' logo which technique?
Thanks!
Never used memcached. :P
06:29
memcache is nice
@JoeWatkins Joel Marcey is the one to chat about it with. I opened github.com/hhvm/user-documentation/issues/11 -- I'd suggest adding your notes about the points of confusion there. Generally agree with the gist of what you're getting at. That doc is going to become part of the new official documentation for HHVM/Hack, so def want to get it right
@Duikboot nice design
The King-foo one?
posted on October 06, 2015 by aliceljdc

/* by The coding love */

@JoeWatkins But in general, yes PRs to that repo are welcome! Just poke the task first, or Joel in IRC or something, to make sure no one wastes effort, if two people rewrite something at the same time.
06:42
@NullPoiиteя What is your daily job? :) ( me just curious )
@Duikboot i am full stack web developer, i give damn in php as well as in js and html,css :D
Nice! Damn weird, it was just reading the same word, when I switched to this chat again. But as: LAMP stack developer.
When can you define yourself as full lamp stack dev?
@Duikboot when you become python developer and dont give damn :P
06:56
:D Ok
Never had to use python :P
:D hahaha
python includes import antigravity as an easter-egg that opens that comic too
i wish i had chosen python instead of php :(
@JoshWatzman okay cool, will holla in the issue thread ...
07:03
when i declare where in a mysql query
thanks for getting back to quickly too @JoshWatzman ;)
how can i make it to select all, im making a search for product type using where
something like SELECT * FROM produk2 WHERE $construct" and i would like to set a menu to show all, what value should i put in $contruct?
lolx, just need to need to leave it blank -_-
morn
R.P
R.P
07:19
Anyone using Drupal here?
@NullPoiиteя But you can also just do echo / print "Hello world";
in php
@PeeHaa morbrewing o/
@Epodax sure, but Parse error: syntax error, unexpected 'antigravity' (T_STRING) is a bummer
@PaulCrovella That's only because of physics.
morning
07:24
Morning
hi everyone
if i am loading url via file_get_contents() then how can i find specific div with id?
@RajeshPatel you need to parse it
@RajeshPatel Use html parser
@NullPoiиteя how can i parse it?
07:27
1225
Q: How do you parse and process HTML/XML in PHP?

RobertPittHow can one parse HTML/XML and extract information from it? This is a General Reference question for the php tag

07:41
@marcio no way
Morning
morning
08:01
anyone suggest a good laptop for a developer plus designer (photoshop and stuff) ?
excluding mac
go with not a mac then.
08:16
@saaggy18 you'll want a mac, sahrry
I dunno if there are any good laptops ... it depends what you mean by good ...
/me is angry
hi guyd
$userId = isset($data->id) ? $data->id : 0;
what does it means this instruction?
08:29
Basic True / False Declaration
$is_admin = ($user['permissions'] == 'admin' ? true : false);
;) @nani
boolean?
It just sets the $userId if it is-set else it sets the userId to 0.
posted on October 06, 2015 by aliceljdc

/* by Ede */

@JoeWatkins I thought you once did a blog post about that...
@iroegbu I have, a couple of times ...
08:37
blog.krakjoe.ninja/2015/07/the-universe-is-not-aware.html Yes, I was thinking of where I've seen those images before... Thanks.
can I set two domain to one host ?
Anonymous
yes
@saaggy18 - Whatever laptop you get, make sure it has an SSD
Anonymous
@iroegbu if you are interested in creating a small blog app you can join us anytime cc @Abe
@samayo tnx
08:46
Thanks, I'll have a look at it later.
@Andrea hahahahah
> VW makes failing test cases succeed in continuous integration tools.
what is "fork" in the github? a big number of fork is a good thing ?
3
I think it is hard to tell
usually yes, it means people are forking it to make contributions, and pull request back to origin
@EquinoxMatt ah thanks, @Sjon thanks
@iroegbu great question
@EquinoxMatt ok tnx
08:55
on this particular repo, rtablada has forked the repo and made a commit
@Sajad - and then made a pull request: github.com/thephpleague/fractal/pull/237
which basically (if approved) pulls his changes back to the original repo
men
anyone use joomla?
ah I see
It makes it easier for people to contribute without needing commit access to the original repository :)
if you really want to learn git, pcottle.github.io/learnGitBranching will make it easier to pick up
09:01
i need to make a plugin but i don't find material
@nani you are making one?
yes I need to make a plugin for learning how joomla works
the plugin has to add Fiscal Code in the registration form of joomla
@NullPoiиteя
09:15
i have no idea how to do that in joomla ... i hate cms
-4
Q: Website is Not working in chrome browser with Vodafone Network

Rajat StellWebsite is not working for the vodafone 2G , 3G network only in chrome , as it is working fine in the other Networks like airtel , Idea, Reliance, Tata etc. Website is also working in light browsers. Website built in the PHP Codeigniter.

@JoeWatkins E_TOO_LATE
using ../ is not optimized? because it should search in the all directory and find correct file. in other word which one is better ?
http://localhost/myweb/contact
../myweb/contact
if you use http://localhost/myweb/contact you will have to edit every occurence if you change domain
yes, I know, but it is faster, right?
who told you it's faster?
10:08
no one, I just guessed
morning
@iroegbu tnx, how you search?! why I can not find my question ...
and also, stop bothering about speed, bother about getting things working (the right way the first time, if possible)
@Sajad just type what you are looking for in google and click one of the results...
tnx
10:30
@kelunik Morning
@kelunik morning… Do we really have nicer stack traces with async/await?
async/await are Generators internally… and have just about the same drawbacks
I don't know, maybe they could be made nicer with native async support. Currently, they're totally useless.
the only advantage of async is actually short form for function autowrapping into Promise.
@kelunik we'd have to store the whole stacktrace we had when the generator was created...
I could add it to ReflectionGenerator (and Exceptions) already today, but it'd be just too much overhead for little gain
"little gain" ...
@kelunik yes. overhead compared to gain…
10:39
It makes debugging a lot easier, it's not just a little gain...
don't know… maybe some ini setting could do…
@kelunik yes, it makes dev easier and prod much slower ;-)
I'm usually no pro-inis … but I guess it'd make that an important difference here…
The only information we currently have is the error message with its line, but even that only in PHP 7 with ReflectionGenerator
11:14
@NikiC What are your thoughts on making the instanceof and insteadof operators flags of AST_BINARY_OP for php-ast?
Also, did you deliberately want to not make the children of AST_PARAM and AST_PROP_ELEM nodes of AST_VAR?
mrning
@PeeHaa seems everyone is getting in arguments with idiots on SO lately :P @Epodax
11:30
I swear I seem to attract them.
meowning
Greetings from NASA ... APOLLO images are being uploaded on their flick account .... flickr.com/photos/projectapolloarchive
The Question is .. are they REAL?
I've been wondering how they took such high-res photos in the '70s... but, what do I know?
It's entirely possible though
@tpunt PROP_ELEM at least doesn't contain a varialbe
It's written like one, but it isn't one
for AST_PARAM -- could do it, not sure
I think that it's more ergonomic as-is, but I can see how AST_VAR would work there as well
@tpunt Insteadof definitely not, that's not a binary operator. Could be done for instanceof, again not sure. The RHS does not quite look like an ordinary binop
11:49
@Naruto :P
@MarkBaker did you go to phpnw this year?
lol
Anonymous
@PeeHaa stop linking to deleted questions :D
Learn to repwhore bruv
12:08
@iroegbu for Russians this is totally fool..
@Naruto - I was there Fri/Sat/Sun, ran a workshop on building PHP extensions using Zephir on tutorial day
@MarkBaker euh.. What? :P
@MarkBaker Wrong ping ;)
Anonymous
Follow me on twitter for no reason.
Anonymous
@_samayo
1 tweets, 1 followers, following 1 users
12:11
I would if I had a twitter
@MarkBaker what's going on Mark?
@MarkBaker Did you meet up with the room 11 people?
However I hate birds with a passion.
Sorry @Naruto, wrong person
@Andrea hahaha, thank you for that. You just made my day
12:12
Looking forward to finally meeting @NikiC at PHPBarcelona as well
Anonymous
@Epodax How about chicks :D
See you there!
@samayo Depends what kind of chicks we are talking about
@MarkBaker No problem, tought something like that :P
Likewise meeting you again @ircmaxell, sorry you weren't at phpnw
12:13
@samayo If it's the ones coming from Hens, then heck no, if we are talking about chickas then heck yea
@PeeHaa Yep, I got a blue elephpant off him ;p
Cool
@ircmaxell - you were missed..... but your math evaluator runs pretty well as an extension
Anonymous
@Epodax ( ͡ᵔ ͜ʖ ͡ᵔ )
/me grumbles
12:18
@MarkBaker I hope to make next year. Needed to take a break from just doing the same conferences every year.
Thanks tho :-)
@NikiC When would the 0th child of AST_PROP_ELEM not be a variable? Fair enough with AST_PARAM - I was just looking at it from a consistency perspective :)
@NikiC Eh, true. instanceof would be the only binop that takes a class name as an operand.
> Another important change in PHP 7 is with catchable fatal errors. Previously, these would have been caught and handled using set_error_handler(). However, with PHP 7, they are now \Error exceptions, which, because an uncaught exception is now a real fatal error, will no-longer be catchable in set_error_handler().
That's just plain wrong, right?
12:35
Hello. I have an array like this : $r=
Array ( [0] => Adresse [1] => fe [2] => fe [3] => few [4] => fs [5] => few [6] => f [7] => f [8] => f [9] => f [10] => f [11] => f )

And I want to unset all entries with "f".

I wrote this but this dont work:

foreach ($r as $key => $value) {
if (!(preg_match('/^t/', $value) or preg_match('/^f/', $value))){
$res.= implode(';',$r).'<br/>';
}
}
Anonymous
You don't need preg for that.
Anonymous
@salathe Very wrong.
An array_filter() is probably a better approach
thank you
$rWithoutFs = array_filter($r, function($value) { return $value !== 'f'; });
12:38
@salathe Where is that written? It doesn't just apply to catchable fatal errors, but AFAIK it's not wrong.
Anonymous
@MarkBaker he wants to unset them, so unset() should be there imo
3v4l.org/Z2hmd (using some random code from online)
@samayo - why do you need unset when you're filtering? The act of filtering does that for you
@JoeWatkins El Capitan screwed with quite a few things so I've rebuilt everything. Getting a segmentation fault simply by enabling the extension. Pretty sure it wasn't happening earlier today. Version is PHP 7.1.0-dev (cli) (built: Oct 7 2015 01:15:46) ( NTS DEBUG ). Any ideas?
I am using socket io with node.js for a full featured chat app
which php framwork should I use for backend server side handling
I am new to socket io and node.js
But already worked with apis based on slim and android
12:41
@RajnishMishra no framework ™
Anonymous
New Github features for your organization github.com/orgs/YOUR-ORGANIZATION/migration
2
@samayo 404 tnx osamayo
oh lol
Anonymous
not to be confused with "orgy"
it was it was
Anonymous
:D
12:46
@tpunt and it is wrong. The catchable fatal errors that are left in PHP 7 won't be caught with try/catch, and will invoke any registered error handler. The author is confusing our changing of a whole bunch of things that were previously catchable fatal errors, into Errors (which obviously should get the try/catch treatment).
Hi guys.
If you were me, would you do this course:esoft.lk/computer-studies/hnd-programmes/…
Its approximately $2000 to $2250 USD
@PeeHaa Thanks I got my answer in java script community
@HassanAlthaf No, I would not drop several $k on that

« first day (1816 days earlier)      last day (3358 days later) »