« first day (4360 days earlier)      last day (591 days later) » 

JRL
4:07 AM
hmmm
anyone here know much about xdebug and phpstorm with their on-demand loading of xdebug.so?
i switched my config to on-demand so that my unit tests could run faster
but now it doesn't pick up the debug sessions any more, even though PHPstorm can verify that it can load xdebug
 
 
5 hours later…
JRL
8:52 AM
huh
well
my xdebug is broken, but only for one function
when i run a specific one of my unit tests, it refuses to connect to phpstorm
 
If you use @runInSeparateProcess for it, I doubt the on-demand setting works correctly.
 
JRL
i reverted the on-demand, and i also wasn't using run in separate process
now it's broken in the config that it worked before
 
hmm
If different results occur under the same conditions, it may be due to a curse.
You might try enabling xdebug.log and setting xdebug.log_level to 10 as well.
 
 
1 hour later…
10:26 AM
I guess over the last 15 years of PHP development, I've never once tried to use array_walk_recursive() on an array containing objects! My mind is currently blown that I have misunderstood what a "leafnode" is. I thought all this time that it needed to be scalar / non-iterable, but evidently objects of any depth are leafnodes regardless of what they contain. 3v4l.org/BeEIl
Is the PHP manual well-enough explained or should it be more expressive about its definition of what a leaf node is?
 
 
1 hour later…
11:29 AM
Happy Friday everyone.
 
12:00 PM
So HDMI cables can almost, but not quite work. That's quite a surprise.
 
@Danack What is the issue?
Is there a way to do this shorter?
 
Two issues. I was using a long cable, and the monitor would occasionally go blank. Switching to a shorter cable fixed that. But still with the shorter cable the signal seems to ......lose sync? Or something similar.
 
I am using one 2m/6ft between old (2013) MBP and TV, didn't face issues with that.
 
i.e. on a website with a plain white-ish background, the monitor will go from being plain white, to having visible vertical lines where apparently at the sub-pixel level. And then after a while the window of the browser will start flickering between brighter and darker.
 
Any chance to test with different computer?
 
12:11 PM
Yeah. I have a new shiny mac that is driving the external monitor at 3840 x 2160 now. It was working okay a 2015 mac...though I'm not sure that was using the external monitor at full res.
A new cable that 'officially' supports up to 8k is £7 so one of those is on it's way....
 
I calculate you can get max external monitor resolution. I am using it on old plasma TV with 1024x768 which is what I get on screen and also shown in settings window of laptop.
 
 
2 hours later…
2:26 PM
Morning All
 
3:02 PM
\o
 
Good afternoon everyone.
I would like to ask for your help. I found a code on the internet and I needed to make a simple modification, but I don't know how to do it.
I need to make the display of records equal to the value of the session Example:
WHERE key = {$_SESSION['key ']}
 
I don't see "SESSION" anywhere in that code... nor "key."
Is this just for sorting columns?
 
It doesn't really have, that's why I want to put.
 
1 min ago, by Statik Stasis
Is this just for sorting columns?
 
@StatikStasis It would be to limit the log view, showing only what is equal to the session value.
Exemple:
SELECT * FROM locacoes WHERE key = '".$_SESSION['key']."'
Whoever made the code just thought about the listing of the records. In my case, it can only display records that belong to the leased person.
When I login, a session is created with the name of key, then I need the records to be shown where the value of the KEY column is equal to the session.
Did I explain?
@StatikStasis Did I explain?
 
3:23 PM
For limiting pagination I usually have a rows per page variable set like...
// PAGINATION SECTION //
$rows_per_page = 100; // Set number of rows per page allowed
$total_pages = ceil($num_results / $rows_per_page); // Find out total number of pages there will be
 
has to be using WHERE key = {$_SESSION['key ']}
 
Then get the current page number like...
// get the current page or set a default
if (isset($_GET['CurrentPage']) && is_numeric($_GET['CurrentPage'])) {

// cast var as int
$CurrentPage = (int)$_GET['CurrentPage'];
}

else {
// default page num
$CurrentPage = 1;
}
 
It has to be included in one or more parts of the code.
 
// the offset of the list, based on current page
$offset = ($CurrentPage - 1) * $rows_per_page;
Yeah... I get it.
Fleshing out pagination never looks clean to me since it is spotted throughout the code.
I just limit it in my SQL query
 
The entire WHERE is mounted on the $sWhere variable.
 
3:28 PM
SELECT
*
FROM
some_table
WHERE
some_table.some_column = '3' // or whatever
ORDER BY
some_table.some_column ASC
LIMIT $offset, $rows_per_page";
 
Where to include the WHERE key = {$_SESSION['key ']}?
 
If you have the code you're set on, best to setup a test DB table with some data and slowly work through making modifications to the code until you get your desired result on screen.
 
I achieved. Just create a new IF
 
@StatikStasis Thanks
 
3:36 PM
I didn't do anything. =)
 
4:13 PM
Happy Friday o/
 
 
1 hour later…
5:27 PM
@Ekin HAPPY FRIDAY \o/
 
@StatikStasis \o/
 
2773
Q: How can I prevent SQL injection in PHP?

Andrew G. JohnsonIf user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')"); That's because the us...

 
 
4 hours later…
9:05 PM
Another week has concluded. Have a good weekend all.
 
you too
 
 
2 hours later…
JRL
10:46 PM
wow
my implementation of the exp() function in PHP is only 50% slower than the built in function, and mine can do arbitrary precision
for fairness, they both needed to return the same number of digits in my test and were both given the same input
ah, lol, there it is
98% slower when i give both a float for the exponent
 

« first day (4360 days earlier)      last day (591 days later) »