« first day (676 days earlier)      last day (4272 days later) » 

9:01 PM
Is there any difference between:
SELECT title, courseId, location
FROM training
WHERE title IN (
   SELECT DISTINCT title FROM training
);
And
SELECT DISTINCT title, courseId, location
FROM training;
 
@user1558223 blank page?
@LeviMorrison or even:
 
@LeviMorrison I'm guessing the second is more efficient, but the resultset should be the same
 
SELECT title, courseId, location
FROM training
GROUP BY title;
@LeviMorrison ^
 
I'm pretty sure DISTINCT works on an entire selection.
 
@LeviMorrison nooooo
it does not
Not that I know of...
but you can use DISTINCT anlong with GROUP BY
dunno why tho...
 
9:05 PM
@user1558223 I can get that...
From this...
 
Good afternoon
 
@user1558223 What's the point of this?
 
@Alec Hellooooo
 
Captchas were made so that you don't parse them programatically
I smell TOS breaking.
@Alec Good Night :)
 
@Truth I don't know what @user1558223 wants it for.
 
9:14 PM
What happens when they run out of books?
 
@ShaquinTrifonoff @user1558223 was on my ignore list, and I usually don't ignore people, so there had to be a good reason I can't remember.
 
@Alec Are you talking about reCAPTCHA?
 
@Alec Well, they'll probably run out of books on 21st Dec, 2012
 
@ShaquinTrifonoff Yes. @Truth Oh, I guess they can re-use the same stuff they've scanned then again.
 
@Alec They just distort it in a different way.
With the same books.
 
9:16 PM
Oh
Also I have a question I believe to be rather advanced having to do with PHP interacting & interpreting mysql stuff. Is there anyone who would mind sparing some of their time to help me out? I don't really feel like I can do this alone that well.
I've been trying to think of a few ways to do it, but they all sound so intensive on the server.
I'm not asking for you to code it or anything, I just need some help coming up with a good plan for this problem.
 
**PHP**

*Discussion for all things PHP - Don't ask whether someone is here or can help. Just tell us your problem. If anybody can and wants to help, they will.*
 
@Alec What are you trying to pull off?
 
Lots of things sound intense, but have you actually tried it to confirm that you even need to worry about it?
 
0
Q: Visitors Counter - Suggested Approach

TruthI was recently brought a challenge from a friend. Thought I'd share it here because I have no good solution. Say I need a visitors count for my website, the count would increase on every visit. The Problem It is considered bad practice to change the server state with GET requests. And since I'...

 
@ShaquinTrifonoff I understand this, and I chose to break the golden rule of the PHP chatroom.
 
9:20 PM
Anyone wants a penny?
 
Yikes, since I put a bounty level of 50 on one of my previous questions I can't leave comments anymore.
@Truth Could you start a chatroom between us? I don't have enough reputation to do so.
 
@Alec No need to, let's talk here.
Others may be able to help you too
 
Alright.
The person gave me a answer that will work, but I have to change the way my code works due to how it has to echo the data.
Right there you can see my database structure, stuff is being linked between all of the databases in reality.
He didn't really grasp my current situation perfectly, but I understand that and I can work with it.
 
110 rep yesterday, 224 today. Good progress.
 
So he gave me this as a example echo for a student's row in the client's table:
1;Luc;Test assignment 1;Secondary Test assignment 1;\n
It's echoed in the same order of everything is in the first part of the string so things line up.
That's one problem I don't really know how I'm going to solve, to ensure that everything is echoed in perfect order every time.
Another issue with that is for each assignment, each student has a grade row in the mysql database.
For example, 1 row in assignments, 30 rows in grading linking to that.
 
9:28 PM
@Alec Your database structure is IMO flawed
 
For his code to work that he gave me I need to make it so it echoes everything according to that class in the same row as everything else.
 
Teachers and Students should be separate entities
If you have gp and pp, you don't need percentage.
 
I don't really know how else to do this, I'm not offered any education like this at school so I do it on my free time at home. I just began 2-3 months ago.
And I thought having gp and pp would be much better than making the PHP calculate percentage every single time.
 
@Alec Don't worry about PHP's calculating the percentage
If you really want, you can SELECT gp/pp*100 as percentage
 
Oh. This project seems really advanced for my skill level because all of the things going on, but I really think I could learn a lot by doing this school record management system.
 
9:32 PM
@Alec How can you tell which student is assigned which assignment?
 
@Truth There is type. 0 is a student, 1 is a staff member. This is stored in the db.
 
So I just select everyone where their ID is equal to 0. SID stands for student id, as in their ID in the members database.
 
@Alec No, they should be separate entities, and separate tables.
 
user895378
@LeviMorrison I think I'm finished adding to the Client API. I've added the following methods today (not pushed) for working with connections in potentially long-running scripts. Because connections remain open up to the number specified by the max concurrency limit (Client::setHostConcurrencyLimit -- default 5) you might open a bunch of connections in a flurry then do nothing for minutes at a time.
 
user895378
9:34 PM
It's irresponsible not to close these connections and can be harmful to the remote host by hogging its limited number of available connections. Additionally, all open connections are closed automatically on Client object destruction (or when the php process terminates).
 
user895378
function closeAllConnections();
function closeConnectionsByHost($host);
function closeConnectionsByAuthority($authority); // (host:port)
function closeInactiveConnections($minInactivitySeconds);
 
Also, your tid column in the assignments table is of the wrong type
(text)
 
@Truth Oh, I think I intended to set that to int.
 
You probably did
 
user895378
@LeviMorrison Or, maybe I should just implement the IrresponsibleUserException :)
 
9:36 PM
Also, value length has no meaning in INT, so INT(255) doesn't really do anything
(You may want to use SMALLINT or TINYINT for smaller integers)
 
@rdlowrey That's two use-cases. That's more than a lot of exceptions that exist . . .
 
@Truth Oh, I didn't really know that kinda' stuff mattered.
 
user895378
hehe
 
@Alec Who is handled an assignment? Students or Teachers?
 
@Truth Could you please re-phrase that sentence? It didn't really make sense.
 
9:40 PM
@Truth don't forget zerofill! It's not no meaning (although darn close)
 
@Alec Well, does the assignment "belong" to a teacher? or to a student?
@orourkek It's more useless than no meaning.
 
@Truth Assignment belongs to a teacher, that's how the columns are gathered. Grading rows belong to a assignment.
 
Heck, it's more useless than Sakura!
@Alec So where do the students come in?
After all, it's the students which get graded
 
well it enforces length on zerofill values, so it does something.. But if you can find an actual use for that i'd be very surprised
 
user895378
I love it when I magically get back rep points previously lost on answer downvotes because someone deleted a garbage post/answer :)
 
9:41 PM
^ write better answers :p
 
@Truth I decided I would query and select all from assignments where sid = student's id. Have the PHP interpret those values on the page.
Why is it sending duplicate messages?
 
@Alec It's not, I'm only seeing it once.
 
Weird.
 
@Alec There're no assigned students in assigment
Only teachers
 
@ShaquinTrifonoff OMG THERE????
 
9:46 PM
So what could you possibly select from assignments which relates you to the students?
 
rep points, it doesn't really mean much after 10K...
 
@Truth sid.
 
except maybe that you spend too much time on SO :P
 
@netcoder Wait till 20 :)
@Alec There's no SID column in assignments table
 
@Truth Oh I thought you were talking about grading for some reason. Assignments table doesn't matter for that. It's just so that application can get the assignment names for the columns.
 
9:48 PM
Okay
So where's the problem exactly?
 
@Truth Second.
String receivedFromPHP = "Student ID;Student Name;Test Assignment;Secondary Test Assignment;\n"
        + "1;Luc;Test assignment 1;Secondary Test assignment 1;\n"
        + "2;Vador;Test assignment 2;Secondary Test assignment 2;";
That's the Java code, that would be processed as this; example of what needs to be echoed:
 
@Alec So you want to transfer the rows to columns
You're looking for a pivot table.
 
Student ID;Student Name;Test Assignment;Secondary Test Assignment;\n1;Luc;Test assignment 1;Secondary Test assignment 1;\n;Vador;Test assignment 2;Secondary Test assignment 2;
The stuff behind the first \n are the column names, after that it's the student rows separated by the same method. Each entry in the student row separated by ;
 
1 min ago, by Truth
You're looking for a pivot table.
 
I need to get it so it echoes every single assignment for that student properly without having to SELECT * FROM table WHERE name=name
I know you wanted to input, I just wanted to input the entire situation so everything is understood.
Are pivot tables difficult to use?
 
user895378
9:54 PM
@orourkek No, not because my answers were deleted -- because I downvoted someone else's garbage answer and they deleted it -- I don't write crap answers :)
 
They're difficult to get your head around, but once you do, it's a breeze
I'm looking for a good tutorial I had
 
@Truth Oh, cause I just looked at the Wikipedia page for it and it looks rather advanced.
 
@rdlowrey ah, I read it as the questions that contained downvoted answers got deleted, my mistake :]
 
user895378
and additional if you feel it's appropriate for failure to read the FAQ:
 
user895378
9:56 PM
@rdlowrey - ...and, if I had a dollar for every post in every support site (not just here) that said "jeez this question has been answered sooooo many times..." now we're talkin'! :-) My apologies for the subject-repeat. — user1349089 2 mins ago
 
Does this involve sign, as in sin on the calculator?
I haven't done anything with that in math class.
 
@user1349089: That's no excuse for not searching, and if you have many dollars from that, maybe the problem's with you, and not with us. The fact is, the question has been asked a multitude of times in the past, so many in fact, that it has its own catch-all question (Which your question is about to be closed as a duplicate of). If you had bothered merely searching the exact wording of your error, you would have found what you needed. Don't automatically go to "support sites" and don't expect people to yell at you if you fail to follow basic searching. — Truth 5 secs ago
One of the longest comments I've ever posted.
@Alec No, sign as in + or -
 
if I had a dollar for every time a newcomer calls SO a "support site" (incorrectly), I'd be crying dollars
9
 
I'd like to change the title of the catch-all question to something more appropriate, but it's taken
No one here with 10K+?
@netcoder
@Neal
 
user895378
10:04 PM
Sorry :) rep-whoring my way up to 10k slowly
 
I'm not 10k either, @Truth. :(
 
@LeviMorrison That's why I deleted my post :P
 
Rep-whoring it slower than @rdlowrey. Was ahead of him when I met him.
 
user895378
@LeviMorrison When you have a brogrammer gravatar people just assume you know what you're talking about and mindlessly upvote en masse.
 
@Truth hi
 
10:06 PM
Lured him into chat with an argument of something I can't remember and was probably inconsequential, and, in reality, we were probably both incorrect.
 
@Neal Hey,
3 mins ago, by Truth
http://stackoverflow.com/questions/9147679/headers-already-sent-error-in-php
 
user895378
Probably -- I forget what it was about
 
@rdlowrey Works for me... Truth knows everything.
 
@Truth done
 
@Neal ty
 
10:08 PM
@rdlowrey Do you think you could find the transcript?
It'd be your first messages in chat.
 
user895378
I'll check
 
anyone have opinion(s) or best practice advice on data transfer object implementations? I can't find much of any info that seems reliable... examples/thoughts
 
ROFL
It was basically an HTTP question.
How horribly ironic!
 
user895378
hehe nice -- I'll be the first one to admit that I knew very little about the HTTP protocol prior to the last two or three months
 
user895378
10:11 PM
There's a lot to be said for choosing a topic and learning everything you can about it.
 
Definitely.
 
Feb 13 at 3:17, by Levi Morrison
Wordpress is the perfect example of PHP software.
better hope that one always stays in context :P
 
Wording on that one is important.
I did NOT say:
 
@orourkek lol
 
user895378
That is really funny out of context :)
 
10:13 PM
> Wordpress is the example of perfect PHP software.
lol
 
user895378
@LeviMorrison and WordPress love each other. They're getting married and plan to have lots of babies together.
 
@LeviMorrison got a point there
 
but it could easily be interpreted that way if you assume the context around it is about how great PHP is
 
it's still a very true statement: Wordpress is a perfect example of PHP software
it's not good, but it's still PHP software
 
user895378
I'd say it's certainly a representative example.
 
10:15 PM
Feb 13 at 3:18, by Levi Morrison
Wordpress is no doubt the best blogging platform at the moment. However, it is an intangible mess, much like PHP itself. Incredibly useful but a terrible language.
^ still somewhat true, sadly
 
@rdlowrey Did we really meet in Feb of this year?
Crazy.
 
user895378
Yeah, I feel like my php chat intro was longer ago than that.
 
No kidding.
Feels longer than that for me, too.
 
How do I see the earliest messages I've made?
 
user895378
You need a little context ... you can only search the content so you've got to have an idea of what you were talking about
 
10:18 PM
@rdlowrey What did you search for to find yours?
 
user895378
I tried a few things before I hit on the right word: compsci
 
didn't find what I was looking for, but I did find this: i.imgur.com/WYv6w.png
 
user895378
lol
 
I actually remember that :D
 
That guy who copy/pasted the manual example removed his answer.
Thanks guys for peer pressuring him into deletion.
Summer of Love, right?
:)
 
user895378
10:27 PM
@LeviMorrison lol! victory!
 
that will be probably quoted on some meta post within an hour
 
Well, in all honesty he was doing something that is frowned on.
Furthermore I never asked for upvotes or downvotes.
I simply expressed my astonishment about losing to a copy/paste from the manual.
 
I'm as clean as can be.
 
10:29 PM
0 questions with that tag, interesting...
 
@LeviMorrison link?
 
user895378
Yeah, I think I abuse the [tag:] feature a bit
 
@Truth To his answer? Can't: it is deleted.
 
@LeviMorrison To the question
I'll find the answer myself
 
10:32 PM
1
Q: Finding maximum value from an array which contains positive integers and/or recursively nested arrays of positive integers

Mohammad Faisal IslamIf an array initialized as: $arr = array(array(141,151,161),2,3,array(101,102,array(303,404,606,555,789,array(1000,22,9999,array(9057,100000),522)))); Then the result should be: 100000 I have written a function to solve this problem but I need less bytes and less memory of codes. My Func...

 
@LeviMorrison IMHO should throw an exception if no ints are found.
 
@Truth I didn't want to force exceptions on the poor guy. PHP's max emits an error (or maybe it's a notice?) and didn't want to do that either.
NULL sounded good.
 
I'd argue that you shouldn't have downvoted his answer though
 
I didn't.
 
ok, well, I don't understand why someone would downvote this anyway
 
10:36 PM
The question wasn't down-voted.
 
(I'm talking about the answer)
 
Some guy copy and pasted from the manual and that was his whole answer.
 
still not worth a downvote
it's not worth an upvote either if you ask me though
 
That's not generally acceptable behavior, but it is at least better than linking the manual.
 
the point of SO is helping, and that answer was still helpful to the OP, wasn't it?
clearly your answer is better, but that's not my point
 
user895378
10:39 PM
Downvoting is a personal decision ... a bit like religion. People will never agree on all the moral questions, and what serves as a downvote-able answer for me might not for everyone else.
 
@netcoder There's still the integrity and overall quality of the site to consider, and copying the manual without any further info/explanation is a terrible way to "answer" a question
 
user895378
Not to mention, if you don't know yourself, you might be propagating blatantly false information first created by someone else.
 
user895378
IMHO if you aren't very, very sure, don't answer: comment.
 
user895378
Also, I'd argue that if the point is to help someone, a comment with a link to what you're "stealing" is more appropriate than an answer.
 
An answer that will never be accepted:
0
A: mysqli not found when running on server

Levi MorrisonAccording to a blogger in 2011, heroku does not support the mysqli class. It does support postgres, but I am not sure if the PHP installation includes support for postgres. This blogger indicates that it does. Someone more familiar with heroku could possibly give you a better answer.

I didn't notice that the user had only 1 rep.
Fell victim to wasted time in my own selfish rep-whoring.
 
10:42 PM
To quote from the FAQ: The upvote privilege comes first because that's what you should focus on: pushing great content to the top. Downvoting should be reserved for extreme cases. It's not meant as a substitute for communication and editing.
the worst is that nobody told the poor guy he shouldn't do something like that
so he'll probably do it again
maybe I take the FAQ too seriously, but that's me
 
user895378
extreme cases is not black and white. It's up to interpretation, which is why you can't enforce a downvoting or upvoting morality on people. All you can do is give guidelines.
 
user895378
And the determination of what's good and what isn't is made by a preponderance of what people think.
 
downvotes should come with comments, always
it's a way of learning for the answerer too, about the language AND the site in general
 
user895378
Used to agree. Don't anymore. There's tons of discussion about this on meta, and it's not at all required to comment along with your downvote.
 
true, but you're not helping as much as you could if you don't comment
like I said, this guy will probably do the same again because he just doesn't have a clue
 
user895378
10:47 PM
Sometimes I comment, sometimes I don't. I'm not perfect :)
 
anyway, like you said, it's a personal decision, I don't downvote much unless it's harmful
spend a little time in and you'll cast a ton of downvotes ;-)
 
user895378
<-- time for this guy to go do some squat-thrusts and water-polo to level up in brogrammer score.
 
there are plenty low-quality and/or duplicate questions in too
 
user895378
+500 collar-popping ability.
3
 
have i missed anything ?
@Jocelyn , it's not like we ain't trying to mitigate that
 
10:51 PM
@Jocelyn: yes, there is but well for questions it's different (that's why they removed the rep change when you downvote a question), but in and a lot of answers are plainly harmful
 
. . . lol look at the comments on:
0
Q: Warning: implode() [function.implode]: Invalid arguments passed in Form Check box

SteffBeen struggling with this some time now and is probably something simple... I keep getting the following error whilst trying to submit a contact form Warning: implode() [function.implode]: Invalid arguments passed in .... on line 240. HTML CODE <input type="checkbox" name="socialmedia[...

They all effectively said the same thing a minute apart.
How many SO users does it take to comment that you need to give us more to work with?
 
@tereško: I know, and I flag duplicates everytime I happen to find one
Does anyone know why there are so many low quality posts to review? Not enough reviewers? or another reason?
 
@Jocelyn: wasn't that feature added a few weeks ago? that would explain why
 
OK, it is understandable then
 
the old reviews list (at the bottom) contained a lot of false positives
 
11:01 PM
I reached 2000 reputation points just a few days ago, I don't know how it was before
 
126
Q: New Feature: Community Review Tasks - Now in Beta

Geoff DalgasLocking this for historical relevance - Please post new bug reports / feature requests / discussions as individual questions, tagged review. And thanks for all the great feedback so far! We are currently soliciting feedback for an improved version of /review to help with the very important t...

 
Thanks for the link. I visit meta too rarely
 
@Jocelyn I only have 1.7k, not quite enough to look at Low Quality Posts and Suggested Edits.
 
When you reach 2000 you will see all the mess it is ;-)
 
isn't all this in mod tools at 10K though?
it's been a while, I don't remember how it was before 10K ;-)
 
11:05 PM
@Jocelyn Dunno but I'll take a run through a few.
Do my part.
 
that's the spirit
 
Found this while in the mod tool.
Needs a cv for sure.
 
It is a bit discouraging to read that 18.4k low quality posts are in the queue to be reviewed. But it is decreasing fast, as it was over 21k 2 or 3 days ago
 
@Jocelyn: I'm not worried, StackExchange has the best moderator community of all
 
And besides, we have the !
 
11:13 PM
1
Q: mysql/php insert/update on duplicate key

EnkayI have a product info table with more than 130 columns/fields. I want to write a php script that adds a new product to the table OR updates the existing product if it already exist. The first field is the product key. The product information is stored in a numbered php array : $product_info[0] ...

 
i have a quick question. I am trying to use George Edison's Stack PHP system, and the object returned has [data:private], then an array inside of that. How do I access that?
 
The OP has a table with 130 columns...
 
. . . wow.
 
@Jocelyn I have one with 96
 
it is quite a lot of fields!
 
11:15 PM
@Jocelyn Yah. Believe me, I know!
 
I have one table with 42 fields and I keep adding more once in a while
 
@daviesgeek: Does the object implement ArrayAccess? If so, access it as an array.
@daviesgeek: otherwise I don't know what George Edison's Stack PHP is, a link would be relevant
 
20
Q: Stack.PHP - Powerful and Extensive Library for Accessing the Stack Exchange API - Including Full Support for v2.0.

George Edison Don't know where to start? Begin by checking out the Stack.PHP website. Then head over here for a quick tutorial on setting up and using Stack.PHP. About Why you should use Stack.PHP: Stack.PHP has been completely rewritten from scratch to facilitate a comprehensive restruct...

@netcoder Dunno...
 
@daviesgeek: and which object are we talking about here? var_dump?
 
@netcoder Nope. I'm using a custom function called dump for that...
 
11:22 PM
@daviesgeek: ok, but what type of object do you have issues with? there's plenty in that lib
 
PagedResponse Object
(
    [data:private] => Array
        (
            [items] => Array
                (
                    [0] => Array
                        (
                            [question_id] => 408792
                            [last_edit_date] => 1343647375
                            [creation_date] => 1333611976
                            [last_activity_date] => 1344009504
                            [score] => 16
                            [answer_count] => 3
                            [title] => What are ways to prevent files with the Right-to-Left Override Unicod
 
-1
Q: Php: Keeping selection after submission

user1618193How can I keep my selection after submission? I need the data to be kept, because after submission I do not want to make the selections again. <form name="theForm" method="POST" action="for.php"> <?php for($i=1;$i<$5;$i++) { ?> <select name="color<?=$i?>" > <opt...

-1
Q: PHP form, for loop

user1618193I need to create a form while looping through the same instruction, and I need to keep the form data after submitting. So far i have : <?php $l=7; ?> <form name="theForm" method="POST" action="for.php"> <? for($i=1;$i<$l;$i++) { ?> <select name="color<?=$i?>" &...

Same question asked twice
 
@Jocelyn I hate it when users do that....
 
@daviesgeek: as far as I can tell, data is not meant to be accessed directly, there is no accessor for it
@daviesgeek: anything you need in particular in there?
 
@netcoder the items array
 
11:25 PM
@daviesgeek: it seems this class is basically an iterator
use Fetch() for the next item, Page() for the next page
i.e.: while (($item = $object->Fetch()) !== false) { /* do something */ }
 
Just a sec...sorry, I'm doing some other work...
@netcoder Okay. Yes I am doing that...
<?
    while($item = $data['response']->Fetch())
    dump($data['response']);
?>
 
@daviesgeek: dump $item, not $data['response']
you should have each entry from $data['response']->items being printed out
 
@netcoder Oh right...that would be why....
Nice:
Fatal error: Uncaught Error 502: An API error has occurred. thrown in .../tools/stackphp/api.php on line 284
 
seems unrelated
 
I know. I think I'm being throttled...
I haven't put in my authentication key yet...
 
11:34 PM
502 is HTTP bad gateway
 
@netcoder Hm....
 
I'm getting a network error too, with an application I'm making with StacMan on VB.NET...
 
Very odd. The error is still there.
@netcoder Try going to sestats.offblockfilms.com
Does it give you the error?
 
@daviesgeek: What API are you querying?
 
@netcoder The SE API. Specifically, the SU site.
 
11:39 PM
url?
 
I don't have a URL, as it all goes through Stack PHP
 
@daviesgeek: I see, I wouldn't know anything about that
 
Yeah. Nor would I...
 
do you have a backtrace you can investigate?
 
Are you getting the same error?
 
11:41 PM
yes I am
 
Interesting question with not enough information to answer:
0
Q: Recursive list of items in PHP, unknown depth and nodes

Ihor - paspar2.comgurus! First of all, I've spent half a day googlin'n'stackoverflowing but couldn't find a solution. This is my first time working with recursions. Hope someone can help. I have a MySQL table, this is kind of referal system: Table 'users' ID SPONSORID --------- 1 2 2 1 ...

 
@netcoder I don't know. How do I find it?
 
daviesgeek: well you're getting this error from somewhere in your code, it all ends up being thrown in api.php
so the idea is to find where in your code you get this error from
a debugger, like Xdebug would help
otherwise you can use primitive debugging methods like putting die() statements all over the place and removing them to see where it fails
 
11:56 PM
twitter.com/a nice username
 
@netcoder Okay. I'll come back to this a little later. I have a project that requires attention right now
Thanks for your help. I'll let you know how it goes...
@webarto Nice!!
 

« first day (676 days earlier)      last day (4272 days later) »