« first day (754 days earlier)      last day (4419 days later) » 

15:00
I'm not sure I understand the problems this guy is mentioning. I'm basically messing around with stuff from $_SERVER, so it should be quite safe. Except $_POST, I'm doing curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST); ... but it should work, no?
Because of the various clients I'm testing, I get different errors as well:
- git .10 - no errors (everything works)
- git .12 - chunky parser error, "problem 2"
- jgit/phpstorm - silently fails
- jgit/netbeans - error reading info/refs
@Christian install nginx. configure it -> done :)
@PeeHaa How's that supposed to help? :D
I mean, Apache is working.
You needed a proxy
15:07
hi
@hakre I think I'm plain doing it wrong with the echo $body; part.
Hey
I am having a mysqli issue that I cant figure out...
$updateQuery = sprintf("
    UPDATE %s
    SET allocatedTime = IF(allocatedTime + TIME(?) > TIME('00:00:00'), allocatedTime + TIME(?), TIME('00:00:00'))
    WHERE `taskId` = ?;
", $this->getModelTable());
$statement = $this->dbHandle->prepare($updateQuery);
$success = true;
if($statement)  {
    $statement->bind_param('ssi', $time, $time, $taskId);
    if(!$statement->execute()){
        $return = "Task statement update error: {$statement->error}";
        $success = $return;
    }
    else    {
it errors at bind param:
Warning: mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement in C:\inetpub\PPM\model\Task.php on line 1320
I cannot seem to figure out what the issue is...
$time = '00:15:00', and $taskId = 2518
would anyone be able to help? :-\
that means your statement doenst match to the variables you use in bind_param, because youre using a IF Statement
try removing the IF, and use $statement->bind_param('ssi', $time, $taskId); to check whether its working or not
@crothhass I need the IF statement.
then, try implementing the IF, and
15:15
I do not want allocated time going below 0
try $statement->bind_param('ssi', $time, $taskId); with the IF statement included
maybe the param is used in the whole IF statement
Can some people try to reproduce the issue of OP:
I can ask some other people to have a look at it... — PeeHaa 27 secs ago
idk bout that...
user1125394
hmm How do you center an elemnt with position: fixed;
@Neal give it a try
15:17
@cyril you dont.
user1125394
c'mon
@crothhass huh? this is completely wrong...
@cyril javascript magic. ask there ^_^
@Neal he says youre using more Variables than variables in your statement. Thats why i guess he takes the "?" of the IF Statement as ONE variable..
@crothhass who is he?
user1125394
@Neal no CSS
user1125394
15:20
width: 99%; margin: auto;
@cyril Not that I know of. unless you do top: 25% and left: 25%
@Neal he is the debug message : Warning: mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement in C:\inetpub\PPM\model\Task.php on line 132

sorry for that
@Neal cant u see what Im trying to say? I guess that IF(allocatedTime + TIME(?) > TIME('00:00:00'), allocatedTime + TIME(?), which appears to have 2 variables, needs 1 variable in "bind_param" because its one IF statement
@cyril does my solution above work?
user1125394
no sorry @Neal width: 99%; text-align: center; is workig fyi
@crothhass Message seems pretty obvious....you need to satisfy all expected parameters used in query..
15:23
@Christian but i believe that i did...
@Neal You do? :D
@Christia @Neal I know..thats why I said he should try $statement->bind_param('ssi', $time, $taskId);
instead of $time, $time
...
@crothhass THAT IS WRONG. you need to match the 3 parameters.
:-\
0
Q: Mysqli bind_param failing

NealI am having a mysqli issue that I cannot figure out... $updateQuery = sprintf(" UPDATE %s SET allocatedTime = IF(allocatedTime + TIME(?) > TIME('00:00:00'), allocatedTime + TIME(?), TIME('00:00:00')) WHERE `taskId` = ?; ", $this->getModelTable()); $statement = $this->dbHan...

To SO i go...
@Neal apparently the function doenst need 3 Parameters
thats why an error occurs
maybe because the two ? in the if statement
are handled as one variable
oy...
15:26
why dont u even try?
@crothhass bc it wont work. thats why.
alright good luck anyways
@crothhass if I do that I get this error:
Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables in C:\inetpub\PPM\model\Task.php on line 1318
try replacing the %s with a ?
WHAT?
why would i do that?
do you even know what sprintf does? lol
15:29
The next attempt would be b, followed by c.. after a while with that we'll start with aa and continue from there until we brute-force the correct query
2
sorry havent seen there was a sprintf included
@MikeB LOL
can u just add/remove some dummy parameters to "bind_param" until it is working? maybe u can figure out what to do afterwards
@crothhass @MikeB ^ LOL
@Neal Doing any weird looping where the first query might work but the second wouldn't?
15:36
@MikeB wadya mean?
This is the whole fn:
function addAllocatedTime($time, $taskId) {
    $updateQuery = sprintf("
        UPDATE %s
        SET allocatedTime = IF(allocatedTime + TIME(?) > TIME('00:00:00'), allocatedTime + TIME(?), TIME('00:00:00'))
        WHERE `taskId` = ?;
    ", $this->getModelTable());
    $statement = $this->dbHandle->prepare($updateQuery);
    $success = true;
    if($statement)  {
        $statement->bind_param('ssi', $time, $time, $taskId);
        if(!$statement->execute()){
            $return = "Task statement update error: {$statement->error}";
var_dump($time);die; would make it look like everything is fine but if the query/function gets called more than once in the same request your debug wouldn't show that
@MikeB nope. it is just one function call
see above
Was just about to ask for the rendered statement :D
UPDATE `ppm`.`tasks`
SET allocatedTime = IF(allocatedTime + TIME(?) > TIME('00:00:00'), allocatedTime + TIME(?), TIME('00:00:00'))
WHERE `taskId` = ?;
@MikeB ^
Yeah, saw the update to your question.. Everything looks right at first glance. Let me try some things
15:39
@MikeB kk...
btw allocatedTime is of the TIME type in the database (if that helps) @MikeB
:-(
@hakre It's now 500-ing
wth:
-1
A: Mysqli bind_param failing

hd1Emm... your bind_param has 4 calls, but your prepared_statement only has 3...

@Christian The names of the post fields might have been altered. Monitor the HTTP requests to actually see what is going on. Might help to spot not so obvious things.
@Neal It doesn't break for me :( - codepad.org/mMx2uptN i.imgur.com/BaLrI.png
@MikeB why the fruit?...
o fk
im querying the wrong db.... MOTHER FKER
15:51
:D
@Christian I'll leave now for eating, was not able to read it so far.
No reason to leave that question there. it was waaaay too localized...
@hakre No problem, thanks.
lol - happens to everyone
15:57
!!/convert help
@MikeB do you think i should have just left the question as it was and closed as localised?
@rlemon Could not process input. Error: Cannot read property '1' of null
!!/convert list
@rlemon C, F, K, m, f, km, mm, i, d, r, g, lb
!!/help convert
@rlemon convert: Converts several units, case sensitive. /convert <num><unit> Pass in list for supported units /convert list
shit wrong room
2
PHP room, Y U JUMP INTO OTHER ROOM POSITION AS I CLICK?!
@MikeB lol yea. I added the column to my prod db instead of my dev db... stupid me... so it worked in my query browser bc i was querying the correct db lol
@rlemon was wondering what you were doing here. LOL
!!/urban robert
Server error (status 500) occured
BOOO (it was good) - and i'm gone!
@rdlowrey FYI, now using artax in a commercial app
16:03
@Lusitanian /me uses artax in tool to achieve world domination.
guys
I'm using this to check whether a user exists
if( $stmt = mysqli->prepare ("SELECT COUNT(*) FROM `users` WHERE usrname=?")) {
$stmt->bind_param("ss", $_POST[usrname]);
$stmt->execute();
$stmt->bind_result($count);
$stmt->close();
But I get this error
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/a5882943/public_html/login.php on line 9
line 9 is if( $stmt = mysqli->prepare ("SELECT COUNT(*) FROM users WHERE usrname=?")) {
What's that backtick - after FROM users`
its all gone now
mysqli->prepare isn't valid
probably need a $ in front of mysqli
this gave me the code
2
A: PHP mysqli query to check if a row exist

KijoteTry with this: if ($stmt = mysqli->prepare("SELECT COUNT(*) FROM TABLE WHERE columnA=? && columnB=?")) { $stmt->bind_param("ss", $a, $b); $stmt->execute(); $stmt->bind_result($count); $stmt->close(); } return ($count > 0 ? true : false);

16:12
Maybe I'm out of my mind but there's no way mysqli by itself is an object that has a prepare method
it'd have to resolve as a string constant
@MikeB Now it works
Now I get
@Sidath You should suggest edits to that question/answers if the code didn't work for you
Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]: Number of elements in type definition string doesn't match number of bind variables in /home/a5882943/public_html/login.php on line 9
@Sidath See @Neal
@MikeB I already did that
it says its awaiting peer reviews
16:17
This also looks wrong: $stmt->bind_param("ss", $_POST['username']);
what's wrong wit dat
:(
You had $_POST[usrname]. The array key needs to have quotes around it. You should be seeing a warning or notice or something about assuming usrname as 'usrname'
If you're getting that error it most-likely means $_POST['usrname'] is empty
well, the query is run only if $_POST['usrname'] is set
(isset($_POST['usrname'])) {
Apologies, I misread the error. You probably only need one 's' in bind_param() since you're only binding one value
@MikeB LOL
16:21
okay
user895378
@Lusitanian Good to hear. I'm currently working on a complete rewrite of the underlying parsing situation. As it exists now the client class skates by using regex pattern matching. I'm nearing completion of a legit Tokenizer based on the HTTP spec's ABNF grammar and an accompanying recursive descent parser. It's much faster than the existing implementation, provides finer-grained control of the parsing process (allowing strict/relaxed parse standards) and provides a much better unit testing base.
user895378
It's likely that the parser won't make it into official v1.0.0, but v.1.1 won't be too far behind, and that will offer the parser as well as lots of other tangible improvements.
thanks. So how can I output results depending on the results?
I have this
return ($count > 0 ? true : false);
Trololol
0
A: Write a program that uses all printable non-alphanumeric ASCII symbols

LeighPHP, 32 chars Probably a bit of a troll, this PHP program is also a QUINE, and uses all symbols in the exact order they are listed. !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ Executed from the command line, the output will simply be the contents of the file, as there is no <?php to invoke ...

sorry if I'm being stupid. But I have to rewrite a whole cms using mysqli
16:26
@rdlowrey Nice :) I'm just using it to consume a mapping API
speed is good though
I'll wait until 1.1 to upgrade because I'm sure the API will change 3-4 times until then :P
user895378
@Lusitanian Only slightly, but that's a smart decision :)
@Sidath have you got pdo as an option ?
nope
way too hard for me
since API is almost identical, I fail to see how it would be "harder"
16:30
@NullPointer So you're a PDOphile?
I have a question how do I use use single.php file? I created one and it has the single post content but It's not working right?
wave to the FBI agents
@Leigh no just found pdo more useful and simple for me
do I have to add anything to <?php get_template_part('content', get_post_format()); ?>
@NullPointer ehhh i like mysqli
16:33
for first link ....rather user said
@benlevywebdesign get goo gone. it might help
@Neal That won't help but good try lol
hmm .. only ~50 flags till gold badge
@tereško Let the hate flow >:D
16:41
yeah , aiming for that one
nice, I just sat on this page for a few weeks stackoverflow.com/tools/flagged?subtype=notananswer. Easiest type to fly through
2
I don't know if I am doing my single.php post right
@Leigh Yeah I think I like "collection" better, although it doesn't really describe the ordered nature of it IMHO - I guess this sort of thing is quite subjective anyway.
@DaveRandom ObjectOrganisation? :D a collection with order
ObjectSet? Doesn't really imply order either, ObjectAggregation? .. nah, ObjectCaboodle has a nice ring to it.
Ohh ObjectEnsemble. That has the implications of order, amirite?
My single.php isn't seeing the style sheet, help
16:50
@Leigh CarefullyArrangedMoundOfObjects ? Like a heap but more organised
@DaveRandom StrategicallyPositionedObjectRepository
@Neal do you know any wp?
@Leigh I'll just go with ObjectStackThatAllowsYouToRemoveObjectsFromTheMiddleIfYouWantButYouCouldAlsoJus‌​tUseItAsAStack
That's a snappy name
@benlevywebdesign nope
nada
Ohhh, the classic OSTAYTROFTMIYWBYCAJUIAAS strategy
16:54
@Leigh That's it, that's the name right there
Better to keep the class name short, people will know what it does.
Oh, well, I it is then
user895378
@DaveRandom You've probably already written the relevant code, but let me suggest @LeviMorrison's PHP-Datastructures library for future structures of this sort. There are a number of highly useful object structures for this sort of thing right there begging to be used.
user895378
Wow, I said "structure" like 10 42 times in that message.
16:58
@rdlowrey Thanks, looks useful, will check it out :-D
can anyone help me solve my issue
lol
I am having a strange problem. This is my query.

$select = "SELECT name,email FROM tokens";
$run = mysqli_query($dbconn,$select);
while ($row = mysqli_fetch_row($run)){

this was working perfectly fine few mins back, now it throws "mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given"

I checked the query in phpmyadmin, it returns the required fields. What could be wrong?
@DaveRandom StackOverflow linters to the rescue!
17:14
can someone find whats wrong in my code?
It was working fine, and all of a sudden it throws out the error
@Kishor undo what you just did and take a look at just that code
user1125394
how do you remove an item of an array by its value
When using mysqli, not using prepared statements negates the safety of the function is that right?
user895378
if (false !== ($key = array_search($value, $array))) {
    unset($array[$key]);
}
user1125394
17:21
yes thx that's was going to do, a little heavy!
@cyril Because it is - that's why it's a good idea to have a way to derive the key from the value.. so you don't have to scan the entire array (assuming an assoc array)
user1125394
it's a simple array, with strings
Are they unique?
user1125394
yep
Single Post display and need help with it
17:25
Personally I'd store the value as the key
basically becomes a hash table
user1125394
ok
Everything becomes o(1)
user895378
@cyril @MikeB is correct.
user895378
And isset is a language construct, so isset($arr['someValue']) will always be much faster than a call to array_search for the additional reason that there's no function call involved
user895378
If your data lends itself to a map datastructure, use a map datastructure.
17:32
@kishor the problem is with code is
@AbhishekGahlot - is?
@kishor wait please. its a problem that happens generally. i am just checking
@AbhishekGahlot - Oh, ok. I am all ears
@Kishor There's an error with your query. And yes, it does happen generally stackoverflow.com/… 5,000+ times
user1125394
@rdlowrey did you see github.com/fabpot/Pimple?
user895378
17:36
@cyril Haven't ever looked at it on principle as the name is disgusting.
@ki
@kishor yes true your query is wrong
@kishor either you might have spelled any table wrong or missed anything. check again a capital word can make your query wrong. like Name instead of name
user1125394
github.com/krasimir/php-dependency-injection/blob/master/… this one is quite small, seems to be a DIC but he has called it DI
user1125394
you will probably dislike the static functions..
user895378
@cyril I use my own DIC, Auryn for what it's worth.
@AbhishekGahlot - Posting that query in phpmyadmin is giving me results. So I should say, the query is just right. Inst it?
17:43
ehh .. @rdlowrey , do you have any guidelines for writing doc (for a github project) ?
user895378
@tereško I have only one and it's one I've just recently adopted ...
user1125394
rdlowrey I know, just teasing you with others impls :)
@kishor If you are justing posting it exactly as same, than it is. of course ,, can you share a bigger part of code, what it does.
Evening
@cyril thats niiice
dunno if id ever use it though
17:45
does anyone know about single post display
too confusing
i prefer manual DI
user895378
My guideline is that prose documentation SHOULD NOT overlap with code documentation. It should be used to cover things that aren't readily apparent just by looking at the code.
user895378
Otherwise you end up with something like the PHPUnit docs
17:46
@AbhishekGahlot - Takes name and email, and mails everyone. The first mail goes through just fine. In the second iteration of the loop, it gives me the error.
since my whole codebase has two code comments . it might not be a risk
user1125394
@Neal nah this one is
ok .. different question
does anyone here know a framework with good documentation/manuals ?
user895378
not in particular. My stuff certainly isn't perfect.
I need to run two different codes for these
if( $stmt = $mysqli->prepare ("SELECT COUNT(*) FROM users WHERE usrname=?")) {
$stmt->bind_param("s", $_POST[usrname]);
$stmt->execute();
$stmt->bind_result($count);
$stmt->close();
}

return ($count > 0 ? true : false);
user895378
17:48
I have learned at least that duplicating work is not fun, especially for documentation :)
where should i put my
true codes
and
false codes
@cyril ehh
@tereško ehhhh The Game of Life?
@kishor so you have a database of name and mails, it queries and sends the mail to everyone .. isn't it. Ok let me share my code, thats different try that one.It should work.
@AbhishekGahlot - Just the part of the loop, which isnt working for me. I am not looking for codes/ or full codes at all lol.
Doesnt want helping people burden much. :)
Are QuizGenerator and QuizProducer to equal to be used on two different classes? QuizGenerator is an interface for random quiz, mega quiz etc and QuizProducer is the class that among other things uses the QuizGenerator...not native english so could anyone help me?
user895378
17:51
What really sucks is having your prose documentation constantly invalidated by code changes. I've found that it's important to avoid large-scale documentation of how to use a library until the API is fairly stable, at least.
hm, is there still no way to write $callback = $this->callback; $callback(); in one statement?
user895378
(I've made lots of documentation mistakes)
user1125394
@rdlowrey someone told me before 1 line of code = 4 lines of comments
Greetings
user1125394
but that's kind of impossible
17:52
@kishor, of course, it is, but, wait, me checking code on my part, and tell you finally whats problem , still i suggest the problem is with either query or at loop,,,
user895378
@cyril IMHO the best thing you can do regarding documentation is have self-documenting code that doesn't require comments.
user1125394
except with a huge license text :)
user1125394
yep that's where variable name and classes matter
user895378
The ultimate in documentation foibles is having to update the same info in two places -- docblocks AND prose documentation. This is awful because it's extremely time-consuming. Also, the more documentation you have, the more likely that documentation is lying at any given time.
user895378
So it's important to work out a system that automates the process as much as possible.
user895378
17:55
(And I don't mean standard docblock generators)
user895378
But I haven't perfected one yet.
user1125394
normally when you change code, you must update docs & tests , if you have no tests and no docs it's faster :)
lol .. i do not even care about maintainability of docs at this point
it is quite possible that this repo will get deleted just like others
Are QuizGenerator and QuizProducer to equal to be used on two different classes? QuizGenerator is an interface for random quiz, mega quiz etc and QuizProducer is the class that among other things uses the QuizGenerator...not native english so could anyone help me?
user895378
I have an on-again/off-again relationship with a Jekyll-style PHP project I've written to generate HTML from plain-text files with markdown (or other formatting). I need to polish it up so I can have auto-generated and version-controlled docs that match up with tagged release versions.
17:58
@Dude what?
user1125394
teresko just make it private if needed, imagine you have a fire at home you lose it..

« first day (754 days earlier)      last day (4419 days later) »