Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
[SOLVED] PHP Chat - Scroll down upon refresh
Daniel0 replied to twilitegxa's topic in PHP Coding Help
I don't know because I don't want to read all your code. Besides, it was not just plug and play. Yes, you are defining it there, but in the definition you're using it. That's like answering "I am me" to the question "Who are you?" -
Any chance you could provide a link then?
-
You likely have CSS elsewhere that is overriding it. Use Firebug to debug it. Using Firebug you can inspect an element to see which CSS selectors and which attributes that are applied to that element, and overstruck attributes mean they've been overridden.
-
[SOLVED] PHP Chat - Scroll down upon refresh
Daniel0 replied to twilitegxa's topic in PHP Coding Help
Either display the messages in reverse chronological order (i.e. newest first) or use Javascript to scroll to the bottom. Something like object.scrollTop = object.scrollHeight; You cannot use a variable before you have defined it. Kind of like you cannot eat food you have not yet made. The solution is trivial, define it before you first try to use it. -
Not working? What could that mean? That your monitor is broken and can no longer display the color red? Seriously, "not working" doesn't help us at all. Is the HTML output (check the source)?
-
How to set the page orientation to landscape for an excel file
Daniel0 replied to AaronLuke's topic in Miscellaneous
In Excel 2007 you would go to the Page Layout tab and then use the Orientation button. -
There are a lot of public domain stuff on Wikimedia Commons.
-
Well, in your code you have like: $data = array( 'page' => $page, 'total' => $total, // etc. ); $json = json_encode($data); Essentially, json_encode() turns an array into a JSON string.
-
Hell, even PHP Freaks has a multi MySQL server setup.
-
I've installed postfix instead of sendmail and we're now using a local SMTPd again. Dunno what broke sendmail.
-
I've switched from using our local SMTP server to Google's SMTP server. The hangups shouldn't occur anymore.
-
Okay, so it's mail() that's hanging. I'm trying to see if I can resolve the issue.
-
I wasn't aware it had been down. When was that? Maybe something got corrupted?
-
Hmm... I've experienced this a few times now when trying to send a PM and when trying to warn a user. The request seems to go through, but it times out. I haven't been able to figure out why it happens yet.
-
That is incorrect. The way the engine handles multiple arguments to echo() means concatenation is faster. See: http://pastie.org/523020 Also see: http://groups.google.com/group/make-the-web-faster/browse_thread/thread/ddfbe82dd80408cc These kinds of micro optimizations are mostly useless anyway. Don't optimize your code before you've profiled it to find out where the bottlenecks are. Otherwise you just risk ending up wasting time on premature optimization.
-
Check the manual for the string data type.
-
Newbie Sections added to ALL forums
Daniel0 replied to aussie's topic in PHPFreaks.com Website Feedback
I see. Without knowing which topics you are referring to, it is often expected that people do their own research first instead of just directly asking for help. If the question can be answered by consulting the manual or by the first search result for obvious keywords you might sometimes get what you regard as "rude" remarks. The thing is just that if you decide to become self-learned in a particular subject, most people will have certain expectations of what you will do yourself to achieve that. When/if people say "RTFM" they are often saying that because they're looking at it and seeing that it contains the answer. There are also some posts that are plain stupid, and it should be obvious to the poster that it is. Like posting 1000 lines of code and saying that it doesn't work. It would be like calling a mechanic asking "My car doesn't work, how do I fix it?" No mentioning of how it's supposed to work, and what it means it doesn't work. Then there are questions like "Does this work?" Again, something only the poster himself will know. The poster is the only one who knows how it's supposed to work, so the poster can just check for himself. These don't have anything to do with being new at PHP or programming. These are things that should be common knowledge, and if you fail at that I'm afraid you're bound to eventually get a less polite remark. The quality of the responses you get is directly proportional to the quality of your question. The more information you can provide (not more as in excess, but more as in sufficient and relevant) the higher the chances somebody wants to help you. If you show that you've tried yourself, and that you've done the necessary research then you are much more likely to get a helpful response. See, the problem isn't so much related to being a newbie and being experienced, but it's related to how much work you're willing to do yourself. Some people seem to forget that everybody that helps around here are volunteers and that they are not entitled to help. This means you should do what you can to entice people to help you (for the record, that doesn't mean topic titles like "help plz urgent"). If you have some arguments pro newbie specific boards, do present them. Everything (well, mostly everything) is up for debate. -
Something like this? SELECT main.class_id, COUNT(main.class_id) AS class_id, ( SELECT COUNT(*) FROM aion_accounts AS tz0 WHERE tz0.timezone = 0 AND tz0.class_id = main.class_id ) AS tz0, ( SELECT COUNT(*) FROM aion_accounts AS tz1 WHERE tz1.timezone = 1 AND tz1.class_id = main.class_id ) AS tz1 FROM aion_accounts AS main GROUP BY main.class_id;
-
[SOLVED] Update All Rows With SUM from Another Table
Daniel0 replied to josborne's topic in MySQL Help
I'm not sure I understand, but maybe something like this: UPDATE Player_tbl AS p SET p.New_Points = 100 - (SELECT SUM(u.Unit_For)+SUM(u.Unit_Against) FROM Unit_tbl AS u WHERE u.Player_ID = p.Player_ID); -
You shouldn't generate your JSON manually. See json_encode
-
What happened to the old phpfreaks tutorials?
Daniel0 replied to sKunKbad's topic in PHPFreaks.com Website Feedback
We still have them, but decided not to put them up because they were outdated. If you wish, I could probably find it and send it to you, but we're not going to release them generally. Hmm... someone else complained about that. We'll have to look into it. -
Newbie Sections added to ALL forums
Daniel0 replied to aussie's topic in PHPFreaks.com Website Feedback
I see your point, and we actually did use to have a newbie section (though it was before my time). There are a couple of problems with splitting it up like that. First of all, many people are delusional about their skills. It's really difficult to evaluate whether or not you're still a newbie. I might also have a different opinion about what constitutes a newbie question and what doesn't. There is also the problem that some people might get offended if we move a topic to a newbie forum when they genuinely think it's a more advanced topic. As the others said, if you state in the topic that you're just starting out with programming, I'm confident most people will cut you some extra slack. -
I believe it's around 32000 sub directories on ext3. What you can do is that for e.g. the user "daniel" you could do: /var/uploads/d/da/daniel You could of course have even more levels if you want to.
-
You would benefit from knowing what is standard SQL (i.e. what is part of the ANSI standard) and what is MySQL specific, but strictly speaking I suppose you don't need to.
-
SQL (Structured Query Language) is a language. MySQL is an RDBMS (relational database management system) that uses a dialect of SQL. PostreSQL, DB2, Oracle, SQLite and MS SQL Server are other examples that also use their own dialect of SQL. That means they each share common features, but also have unique proprietary features. It's the same way that you have English as a kind of general language, and then you have a lot of dialects and sociolects thereof.