« first day (802 days earlier)      last day (4146 days later) » 

user1125394
12:02 AM
hmm how do you join 3 tables
 
user1125394
o just adding another JOIN
 
@cyril Why don't you join five tables? The more the merrier ;)
 
user1125394
I have this structure pastie.org/5578183
 
user1125394
and do select DISTINCT id, cell_id from points JOIN pointscells USING(id) JOIN pointstags USING(id) WHERE cell_id="9f" AND tag_id="home"
 
@NikiC luckily not all of them are active. but yeah, thy are definitely too many. I was happy to find some other people working on async PHP libs in here. I really need to find other people to help maintain them.
 
user1125394
12:12 AM
normally such joins are not bad in performance since it's on primary keys?
 
Anonymous
12:29 AM
Can't believe I beat hakre to an upvote. stackoverflow.com/questions/14027243/… Seems, like I should be respected around here.
 
Anonymous
 
@TheCOMPLETEPHPNewbie on a question that was closed as not being a real question. :)
 
@TheCOMPLETEPHPNewbie It takes more than a single upvote to get respected around here :)
 
Anonymous
My ego is a little bit satisfied however.
 
@TheCOMPLETEPHPNewbie That's your problem ;) Too much ego
 
Anonymous
12:37 AM
:) guilty !
 
devs with too much ego? impossible!
 
@igorw And some especially so... article.gmane.org/gmane.linux.kernel/1414106
I kinda thought that PHP's mailing list was rather unfriendly, but after reading that it seems that we are really nice after all :)
 
It is honest though :D
 
Exactly
 
Anonymous
hmm....
 
12:49 AM
Honesty is a very bad thing, everybody knows that
 
I would kill for someone as passionate as that about doing the right thing in PHP. But no, instead we languished under an autocracy for years.
At least progress has been made on that front since 5.3. PHP is no longer governed by people that want to keep the language stupid.
 
Speaking of which @NikiC is lester banned yet? :P
 
@PeeHaa nah
 
Why the hell not?
 
@Charles This isn't about being passionate, this is about being an asshole ;)
 
12:53 AM
@NikiC Sometimes it's hard to tell the difference. Maybe I've just become immune to Linus' rants over the years.
 
I would have no problem with having some kind of BDFL for PHP, but as long as he is a Guido, not a Linus ;)
 
user1125394
1:06 AM
is Mauro fired, or did he suicide?
 
user1125394
Dear Linus is probably not the best manager around
 
Anonymous
Would this script cause parse error @NikiC

`<?php if (!defined('SMF')) die; if (1356416187 < time()) $expired = true;`
 
@TheCOMPLETEPHPNewbie Why don't you try?
 
user1125394
use reborn rather
 
Anonymous
<?php if (!defined('SMF')) die; if (1356416187 < time()) $expired = true; else {$expired = false; $value = 'a:263:{s:10:"smfVersion";
 
Anonymous
1:17 AM
Above code gives error, but I can't figure it out.
 
Anonymous
It echos " Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE "
 
Anonymous
@NikiC
 
yes...
obviously
maybe because the code makes absolutely no sense?
 
Anonymous
It was taken out of a another code, but the error appears in that line only
 
e.g. you didn't close the string at the end? and the code block that it belongs to?
 
Anonymous
1:20 AM
The closing that is on another line, the error appears on this line.
 
<?php if (!defined('SMF')) die; if (1356416187 < time()) $expired = true; else {$expired = false; $value = 'a:263:{s:10:"smfVersion"'; //... }
Like that? :P
 
@TheCOMPLETEPHPNewbie so you still have an unclosed string
or is that also on the next line?
 
Anonymous
Yea, I know. @ShaquinTrifonoff spotted the margin of error.
 
Anonymous
Time to get an upvote..
 
-2
Q: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE SMF-modSettings.php on line 1

user1928867I'm new to php and getting this error in my forum: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE in /home/trocascs/public_html/cache/data_8d2c6893fb22d358f0d465ddbb4f3621-SMF-modSettings.php on line 1 Any help will be much appreciated. This is line 1: <?php if (!defined('...

 
Anonymous
1:26 AM
@PeeHaa It is done.
 
Aaaaaand it's wrong :)
 
Anonymous
say it ain't so
 
It is :)
 
Anonymous
Yea... I guess. :)
 
@TheCOMPLETEPHPNewbie It is some serialized stuff. And whatever comes after where you told OP to close the statement is still part of the serialized string
 
Anonymous
1:32 AM
Yep. It is hopeless. I am pretty sure this is the OP's site: trocascs.com
 
Anonymous
God. So tired of working my ass off for ridiculous reps, they should make SE like farm ville, and let us buy badges and reps :))
 
Merry Christmas all!
 
Anonymous
Merry Christmas
 
do people still use forums?
 
Anonymous
I used to, before coming to SE
 
Anonymous
1:38 AM
digitalpoint, daniweb, phpfreaks
 
Is anyone here available to help with a small problem I have? Please ignore the outdated MySQL calls in the code below, I do plan to update them soon.
I have the following line of code

`$result = mysql_query($query,$link) or die('Errant query: '.$query);`
 
@igorw sure
 
How do I set an array with a value of found or not found depending on whether my MySQL query finds a valid database row or not?
 
@Pee Wow, that is staring me in the face! I actually have that part of the code already but I thought that the "Errant Query:".query); would also count as a row being returned. Food-induced brain spasms there! Thank you.
 
Anonymous
1:44 AM
@PeeHaa what is up with your site
 
I'm reinstalling my server
 
3:08 AM
Me and my girl
2
A: PHP remove div if word doesn't exist

PeeHaaUsing DOMDocument and DOMXPath you can easily do this: <?php $html = "<div class='box'>i like the world</div><div class='box'>i like my computer</div>"; $doc = new DOMDOcument(); $doc->loadHTML($html); $xPath = new DOMXPath($doc); $nodes = $xPath->query("//div[...

 
0
Q: How to validate or constrain direct SQL input from user?

shiplu.mokadd.imI am going to provide SQL console like data.stackexchange.com for developers on one of the site I have. The problem is I can not let them execute all type of SQL. So there will be some constrains. Here are some example constrains no query can contain count() function every query must contain LI...

Any input ?
 
@shiplu.mokadd.im Sounds scary :)
 
I wouldn't trust myself closing it down properly.
 
At least someone can tell how it's done on data.SE?
 
3:11 AM
Are you whitelisting or blacklisting?
 
@James +1 for Errant Query, the best darned ... or die message I've seen in years.
 
@peehaa currently I am doing both.
This chat is not iPad friendly.
 
chat on anything mobile is a pain imho
 
3:29 AM
Merry Christmas
 
4:13 AM
This is what you get when letting me drink:
5
A: Can I have a php function and javascript function with the same name?

PeeHaaOf course you can. You can even give your pony the same name as any of the functions.

4
 
I want a pony. Thanks. — Charles 13 mins ago
lol
morning ...
 
Morning / evening ;) @NullPointer
 
@PeeHaa you have pony too ... in your answer
:P
 
It's a ponyful world out there :)
 
lol...
 
4:27 AM
@PeeHaa Easy way to get 120 rep and a badge lol
 
@ShaquinTrifonoff hiya
 
@NullPointer hi
 
repwhoring like a motherfucking boss :D
2
 
@ShaquinTrifonoff and a hat too ...
 
I have hats disabled :)
 
4:30 AM
lol
 
Yep. I dared to click it :P
 
please love hat .. otherwise troll police will arrest you ...lol..:P
 
Oh holy crap on a stick.
Ladies and gents, if we have not already reached peak stupid, we now have a new candidate.
 
And the sad part is, this doesn't get any love :P stackoverflow.com/a/14035986/508666
@Charles Wut?! WTF loooooools
 
4:40 AM
@Charles lol.. troll police should arrest him ... looooolls
 
Where is @hakre with his comments now? :(
 
@PeeHaa you have got some love ..
 
I just ... maybe it's the booze speaking, but I can not comprehend the level of insanity or mental neglect that would cause that thought process.
 
yay love!
 
@PeeHaa, he's asleep AFAIK
@PeeHaa That question amazes me. I'm just so used to the whole "lol how do i share data btwn php and javascirpt" (COMPLETE WITH NEW TAG ARRRRGH) that the rest of the thought process just never occurred to me...
 
4:44 AM
I'm pretty damn drunk so I'm at the same level as OP. We understand eachother :D
 
You are ... you are the stupid whisperer?
5
 
lol
 
Wow, when gordon says "Merry Xmas!" people really feel it
 
Yeah. He's that kind of a guy
WTF. Either everybody is drunk or fucking stupid at this time of night
-1
A: Unexpected conversion of $_GET["var"] to integer

Arun Killuthis is enough ,no need to type cast if ($_GET["p"] == "all") { $list_all_pages = True; } else { $start_page = $_GET["p"]; if ($start_page < 1) $start_page = 0; }

WP sucks monkey balls!
Say it!
Scream it!
Yell it!
Hey I see you are trying to use a superglobal. Let me change the freaking value for you...
Go home WordPress you're drunk!
2
 
On one hand, dude, that codebase is so PHP4 it ain't funny.
On the other hand...
 
4:52 AM
str_replace('WordPress', 'PeeHaa', $message); // he he
 
@ShaquinTrifonoff lol
 
But but but I'm already home
 
Grr, that took longer than I thought.
now, where was I
Oh yes. On the other hand,
user image
3
 
lol
 
WHY WOULD YOU EVER MANGLE A SUPERGLOBAL LIKE THAT OH MY GODS WHAT
 
4:55 AM
I think I'm going to kill a kitten just for that
 
Also, on a completely unrelated note, did you know that you can replace the superglobals with an object, and that having them be ArrayObjects that have been extended to include validation is a particularly insane thing to do?
'cause that's what we totally do at work
and it's my fault and I'm so sorry
 
Christ. That's... just.... awful.... :( How do you sleep at night?
 
Got promoted.
IT Manager, baby!
 
hehe
noice
 
I leave the devs alone though, the guy in charge is a real nut.
Doesn't believe in automated testing, for example.
 
4:58 AM
Eeeeek
 
He's actually the reason I wanted out. I couldn't grow as a developer. Took me a year to regain the desire to work with PHP again...
ERP is just so utterly boring...
 
True that @Charles true that
 
Oh noes inventory and Orders and salespeople and that idiot in RMA, and and and oh my gods
IT has been very ... different. Spent the last week pulling a literal mile of cable...
 
@Charles lol...
 
> youtube api not getting data from mysql
NO CRAP SHERLOCK THE TWO DO NOT INTERACT WHAT IS WRONG WITH YOU
... you know, IRL, I'm a giggly drunk, why am I allcaps screaming here?
I think I think it's funny and I think I disagree with myself and oh my gods why am I even typing this.
Okay, myou know what? Go home, Charles, you are drunk.
 
5:02 AM
lol
This escalated quickly
Shit just got real
 
Really screwed, that's what.
 
yay kittens!
3
 
dogs too
user image
2
 
5:07 AM
ok guys. It was fun, but now I'm really going to sleep before I break anything
laters all
 
Night @PeeHaa
 
@PeeHaa night ,,,, :) (.)_(.)
 
'nite
/me off
 
dont try sql injection on sleeping ...warrior lol
 
6:10 AM
for($i = 0; $i < 10; $i++) {                                                                              ‌​                                    echo $i;                                                                            ‌​                             }Shaquin Trifonoff 26 mins ago
@ShaquinTrifonoff how to do this
whenever i hit enter message submitted .. instead of new line
 
@NullPointer First line, then lots of non-breaking spaces (~100), then a normal space, then the next line.
 
hi U+00A0 hello U+00A0 hiya
@ShaquinTrifonoff doesnot work .. :(
 
@NullPointer Copy it from the 'UTF-8 input field'
(and for chat, you can simply press + to insert a new line)
 
hi
hola
hiya
jo
yo
yeye working now
 
stackoverflow.com/q/14036586/168868 aka the question that now makes me think that an external system for setting user flags might not be a bad idea, because holy crapsticks this guy....
 
6:27 AM
i have two timestamps "01-11-2012 08:58:26.76" and "01-11-2012 08:58:26.216" i want to calculate time difference by 'strtotime(time1)-strtotime(time2)' but it gives result "0" is there any way to get time difference in "0.140"
 
@Nileshpatel Give strtotime a non-stupid date format.
strtotime -- go read the manual page, there's a link to the list of expected date formats.
Find one that isn't broken and it'll work fine.
Also, IIRC, vanilla strtotime only works on a second-based basis.
If you want milliseconds you're gonna need to break out a DateTime instead.
It has a diff method that returns a DateTimeInterval that has a format method that will return all the information you ever dreamed of... usually.
 
user50049
Support for using empty() on the result of function calls and other expressions .. umm, wat?
 
@TimPost Prior to 5.5 you couldn't say empty(function_that_might_return_an_empty_string())
or something.
Had to be a variable.
 
user50049
ah, ok. The wording was just confusing
 
Yeah.
Hard to represent that in a more concise way.
 
6:32 AM
@Charles ok but i can't broke it in datetime
 
You can't break it? Great!
... though that's probably not what you meant.
 
@TimPost you would only know it if you saw the error msg
 
@Charles u mean i have to break date-time in millisecond and after find difference?
 
@Nileshpatel break*
 
sorry for that my english is not well
 
user50049
6:37 AM
@andho Yeah, I've only tested for empty if I intend to use the results for something else.
 
@Nileshpatel If you use strtotime instead of a DateTime, yes, you're going to lose millisecond precision and if you care, then you need to either use a DateTime or you need to split it out and handle it differently.
 
@Charles thanks
 
@Nileshpatel no problem, just learn along the way
 
7:12 AM
lol
@TimPost hi
@TimPost i flaged to undelete post and replied flag helpful but post is yet deleted
 
user50049
That means a mod appreciated the flag, but declined to take action
 
@TimPost if you think that is worthy to un-delete .. please undelete ... if not still thankyou to replay
i have edited post with more information to make it more constructive
 
> plz give my reputation back because you don't have knowledge about it..
> i complainted to stackoverflow.............
 
hahah...lol
 
I really shouldn't laugh. Too much of a jerk tonight.
But still, that guy.
Pointed him towards meta because I'm an ultrajerk.
 
7:28 AM
you don't have knowledge of ckeditor then why you doing my raputaion down??? — pratik1311 48 mins ago
lol
 
is there anyone have knowledge in yii bootstrap?
anyone here?
 
PLB
yii is very well documented and has quite active comunity you can find almost everything on there site. BTW, I have been working with yii in the past, so maybe I can help you. What's your actual problem?
 
i cant use bootstrap-yii in my project
 
PLB
What do you mean in "i cant use bootstrap"?
 
i have downloaded and unzip at extentions/bootstrap/ and then i try to use bootstrap menu in my page. but i displays error
 
PLB
7:39 AM
What errors?
 
Alias "bootstrap.widgets.TbMenu" is invalid. Make sure it points to an existing PHP file and the file is readable.
 
PLB
 
PLB
I hope it will help you.
 
ok i will try
 
PLB
7:47 AM
I have very small project. What's the most lightweight MVC framework? I need that it had only basic mvc architecture.
 
@PLB what is very small ?
 
Morning
 
@Touki Morning
 
PLB
@NullPointer Web-service for communicates with another web-service and writes data in database..
*that
 
@PLB codeigniter
its simple .. and easy ...
also it have pretty decent documentation http://ellislab.com/codeigniter
 
7:52 AM
@PLB what's the output format, HTML?
codeigniter is best for learning a full stack MVC framework
IMO
 
But it doesn't teach you oop at all
 
PLB
@andho No xml is returned as a response.
 
you can use one of the simple micro frameworks that provides routing, and add other libraries as needed
Limonade and Slim framework is good
i like Slim for creating APIs
 
@PLB zend ?
 
PLB
@NullPointer I want to keep as simple as possible. Maybe I'll write few lines myself.
@andho I liked Slim at the first look, I think I'll give it a try.
Thanks
 
7:57 AM
You could look at Silex it looks like slim but it's on Symfony2 components
 
@Touki looks similar to Slim, should be good assuming anything from SensioLabs should be good
 
It's always a good start to learn something that can evolve
 
Silex\Application extend Pimple :O
 
PLB
Thanks for suggestions. Both Slim and Silex seems to be good choices.
 
8:50 AM
0
Q: Change display html table in view on Yii Framework

Giovanni Di ToroI have made a module for financial management using Yii php framework and installed the model, controller, CRUD , and views throught Gii. Now I want to display the contents created for each financial movement in a table , one movement per row, inside the view movements page - such as in the admin...

 
9:08 AM
How can I fetch number of table rows using PDO? rowCount(); won't work! :(
 
@BrendonMcBain What do you mean by "won't work" ?
What's the message ?
 
It doesn't return the rows, i read its common problem in mysql
Do you know a workaround ?
 
$count = count($stmt->fetchAll());
 
Returned 0 still
 
Can you pastebin your related code?
 
9:18 AM
$stm = $this->db->prepare("SELECT count(*) FROM `bots` WHERE `ip`='$ip'");
$stm->execute();

$row = $stm->fetchAll();
echo count($row);
 
And you want to get the COUNT(*) value ?
 
Thats an idea i seen on a google search
not working though
 
@BrendonMcBain give the column an alias
 
$stmt = $this->db->prepare('SELECT COUNT(*) AS numIp FROM bots WHERE ip = :pip');
$stmt->bindParam(':pip',$ip);
$stmt->execute();

$result = $stmt->fetch(PDO::FETCH_OBJ);
echo $result->numIp;
And please, don't PHP variable inside a prepare() method
 
was temporary
ty
 
9:26 AM
It's nearly useless to switch on PDO if that's meant to use same MySQL injection issues
 
returning 0 still! :(
 
Run it in your favorite PHPMyAdmin
 
And you're getting results with the same query ?
 
Its working
thanks
 
11:10 AM
gud evening
any one any idea regarding github
 
How can I make a test on a service linked to database results ?
Shall I create a mock DB mapper ?
 
github?????????????????///
any one know about it
 
What's your question @AnkurSaxena
 
@AnkurSaxena works for me , if that is your question
@Touki code ?
anyway , you both are making no damned sense
 
what ?
i have understand github functionality.please help me out
 
11:20 AM
@tereško I'm trying to find a "standard way" to create tests on actually built service
 
if by "testing you mean that you want to write unit tests , then i do not see why would you mock a DB mapper there
what you should mock a the instances that are injected in it
 
XY problem I guess. Yes, I just want to create unit tests
 
well .. the first issue that i see there is that you have a lot of computation in the __construct()
and you seem to be violating LoD
instead of passing in a $doctrine instance, you should be passing in the $doctrine->getEntityManager('starweb')
 
Yeah, I had this issue earlier, I couldn't find a way to set the default mapping from service.yml
 
the $doctrine on it's own is not even used anywhere
also , this line :
$typeprix = is_array($typeprix) ? $typeprix : array_map('trim', explode(',', $typeprix));
the $typeprix is undefined at this point . . you cannot use is_array() on it
 
11:27 AM
It's in the constructor
 
oh ... right
 
So, to prevent this service from breaking LoD, i'd have to send the EntityManager straight to the constructor
However, some Applications that uses this Service can have multiple databases based on different Entities
So I must say "I need the starweb EntityManager only"
And my mind blown up trying to figure out how to do that
 
Anonymous
@tereško Does PHP keep track of time simultaneously? I mean, at least in the way this guy is asking stackoverflow.com/questions/14039940/…
 
Anonymous
I was wandering
 
php usually "lives" only why you are executing it
 
11:35 AM
@TheCOMPLETEPHPNewbie By doing this you'll only have it if you request the page right at the second given
 
if it needs to know current time at any point, it will make a system-call
if you want to play video at some specific time, i would use a JS based timer for that
php can give you only when the page was called
 
hi..
i have one query
echo $row['title'];
$jsonArray[$i] = array(
"Title" => ($row['title']),
);
sendResponse(200, json_encode($jsonArray));
now the first echo outputs Installing Debian GNU/Linux
JSON output is [{"Title":"Installing Debian GNU\/Linux"}]
why the \/ ?
 
you should read about use of aliases in SQL
@Shubhank because it needs to escape the slash
 
Is anyone know how to generate multilingual pdf using TCPDF? I also try arialunicid0 font suggest by community.impresscms.org/modules/newbb/… . but it is forcing users to download lang-package
 
can you explain more
what part needs to escape slash ?
 
11:41 AM
In computing and telecommunication, an escape character is a character which invokes an alternative interpretation on subsequent characters in a character sequence. An escape character is a particular case of metacharacters. Generally, the judgement of whether something is an escape character or not depends on context. Definition Escape characters are part of the syntax for many programming languages, data formats and communication protocols. For a given alphabet an escape character's purpose is to start character sequences (so named escape sequences) which have to be interpreted diff...
also: json.org (the lighter bar on the right)
 
i know what escape characters are
but i want to know is it normal if the / is escaped with \ in json output
 
51 secs ago, by tereško
also: http://www.json.org/ (the lighter bar on the right)
 
i checked..
 
ugh php :(
 
it shows \/
 
11:43 AM
no , you didn't , because you keep asking the same question
 
but i didn't faced such issue in previous projects when someone else did the server part
i am new to working on php and am not sure if something is wrong from my side
 
There a problem?
 
Morning everyone
Guys it's a bit new to me. Why child class methods must be protected in order for them to be called from parent class methods? Since as soon as I mark them private they are unreachable.
But if child class inherits methods from parent class they become part of him and since they are part of him, why they can't access his private methods as well?
 
Bad design plan?
 
11:50 AM
thanks for help
 
this should explain
@JakobBowyer got bored with python ? Or do you just enjoy watching the pain and suffering of others ?
 
@Eugene as soon as you make any method private you can only use it inside that class and no where else. If it's protected or public you can access that method outside of the class.
 
@tereško Im here because I have a gun to the back of my head
@tereško how do you even know me?
 

« first day (802 days earlier)      last day (4146 days later) »