« first day (428 days earlier)      last day (4523 days later) » 

8:13 PM
$results = mysql_query("select * from names");
while ($row = mysql_fetch_array($result))
{
    echo "<tr>";
    echo "<td>" . $row['name'] . "</td>";
    echo "<tr>";
}
Please tell me this is bad code and not "That's just how you do PHP"
 
That's bad code on so many levels...
Not only you do a wildcard select and use an outdated MySQL API, you also directly output in your code and forget to properly escape your output.
@Raynos Is that what you wanted to hear?
Oh and I forgot to mention that you are using tables in a context where they are not apropriate
So summarizingly that code contains at least five faults ;)
 
I wish the top-SEO PHP tutorials didn't teach such bad practice.
 
8:30 PM
Crap, I forgot to also mention that it uses unconventional formatting (=bad) and most importantly: It does not work ($results vs $result)
So we are up to seven fault for seven lines.
Oh, crap, it also uses <tr> instead of </tr>
Hm, just got two badges on
10
A: Why does PHP's foreach advance the pointer of its array (only) once?

NikiCRight before the first iteration the $array is "soft copied" for use in foreach. This means that no actual copy is done, but only the refcount of the zval of $array is increased to 2. On the first iteration: The value is fetched into $x. The internal array pointer is moved to the next element,...

 
@NikiC grats!
 
8:54 PM
@NikiC I just wanted to double check that it's not "just how you do PHP"
 
9:07 PM
@NikiC: cool answer
 
@zerkms thx
 
 
2 hours later…
10:58 PM
hello
any javascript lover here ?
 
Hello
Hater here.
Would that be of any help? :/
 
nice to see you how you going today
Ozbekov: do you had chance to code thru backbone.js ?
 
@Mian_Khurram_Ijaz Sorry, no. :) I try to stay away from Javascript as much as possible.
 
Jon
sup guys :)
Can you please take a look at this:
0
Q: How to indicate an argument is passed by reference to the function

Michael RaderTo indicate an argument is passed by reference to the function, what character should I use before the argument in the parenthesis?? I'm reading in one book: When you use a function that passes an argument by reference, do not prefix the argument with an ampersand. The ampersand is used only...

What should I do in this situation (read comment)?
 
Jon
11:07 PM
obviously a link to the docs isn't a real answer
and the OP has answered their question
so what now? CV? as what?
OTOH, I so hate it when people just go ahead and answer anyway after something like that.
 
@Jon I think the guy is just honestly confused. He may not really understand what they mean by "function definition"
At least that's what I took from it
 
Jon
@CharlesSprayberry: agree on that... my question is, how should we handle such cases?
I really did not want to add an answer to that, it feels like repwhoring
 
@Jon In my opinion, easy. Answer the question.
@Jon I can understand that, I guess when you're that high up in rep you just wait and see if the peons come along and give the same or similar answer.
 
Jon
is there any guidance on how questions that can be answered with "here's a link to the relevant docs" should be handled?
 
@Jon Or just answer the question. I think thats the bigger goal, but it can be a challenging issues I guess.
 
Jon
11:15 PM
because the docs in this case IMO leave no room for error
 
@Jon When I see stuff like that, and he has obviously read the documentation, its just a basic lack of understanding something very fundamental about the material.
 
Jon
or maybe I should just work on my point of view? because when newbies come in later and basically add the same content as their answer I do get annoyed
I 'm not so sure if he has actually read it in this case
 
@Jon I can understand that. It is why I tried to add more than just a rehash of what you said :)
 
Jon
I wasn't referring to you :)
you were like the third or something? at that point I had decided to answer myself
 
@Jon Well, its an interesting issue either way
 
Jon
11:17 PM
FFS there's an example #2 in the docs which is basically the exact same thing as my answer
and that's exactly my issue: "answer" that basically says "read this: <link>"
anyhow that's old news by now :P
 
:p
I really dislike the use of the `\` as a namespace separator
 
Jon
unlearn all other C-style languages you know and it will come easier :P
 

« first day (428 days earlier)      last day (4523 days later) »