Chesso
Members-
Posts
27 -
Joined
-
Last visited
Never
Contact Methods
-
Website URL
http://www.chessoscorner.com
Profile Information
-
Gender
Not Telling
Chesso's Achievements
Member (2/5)
0
Reputation
-
Yeah, in alot of languages most properties or functions are accessed using ., rather than -> but it's the same thing. Like if you create a class, and a function within the class. Let's assume the class is called test_class and the function test_function. Also assuming the class is in the same document (for the purpose of simplcitiy) you could call the function like: test_class->test_function(); I came across this the other night, though I don't use classing myself, no need for it really, extra bloat when unnecessary but it has it's used.
-
Wouldn't this sort of thing be best suited to a windows (or cross platform) application that's a bit more native. Or is there a specific reason it needs to be online?
-
Oh, like the mail server address etc? What would a web host use? they must have something special setup for that. I just need anything I can use to make emails work to my main gmail account to make sure there aren't any holes or problems before I put it live.
-
So i'm looking for: date_default_timezone_set('Etc/GMT-10'); Is there anywhere special, like just before I use time/date or perhaps just call it the once at the top of pages that make use of time and date? Woah, I didn't realise you could use case statements in PHP lol dang, I could have been using these.......
-
Something I never found an answer for a long time ago. It's all fine locally but on web host they are in different location so it's all setup for them on the web server. How can I have the time() and date() functions etc return in my timezone? I'm in AU, Sydney (GMT+10)
-
Thanks, that's mostly what I have been doing (although rarely using `` at all, so key names like table/field names? not value settings). like `myfield`=somevalue or `myfield`='$somevar'. Is it the same case for when intergrating php variables and array values in echo's, like for form action url's etc.
-
I somewhat inconsistently use certain ways with php and mysql, like with queries I sometimes use quotes, sometimes don't, sometimes use ` and sometimes don't. Sometimes I can directly insert a variable (but fails without quotes around it.....), but when accessing an array like $r['myval'] it seems I need to get out of the string, .$r['myval']. back into string. What exactly is the right and minimal way? lol. 1. Do I need to use ``? if so, where is it appropriate or should I always use it. 2. Like "SELECT * FROM table WHERE id=4", fine no need for '' but, "SELECT * FROM table WHERE id='$id'", fails without ''s, why? 3. Like "SELECT * FROM table WHERE id=" .$r['myval']. ""; why go through all that, can't I use '' like with Q2? Things like this lol.
-
Yeah you'll be looking at using GetUrl and the XML file class (the name he uses is just a name for a class instance, not the actual class name).
-
Hi, is anyone familiar with WAMP5 or the like? for building and testing php/mysql applications locally. This is basically how I build my site, and it would save a lot of trouble if I could build and properly test emails locally and not need to upload to my web host just for it to work. I use the mail() function. If anyone knows how I can setup my WAMP5 locally to be able to test this, it would be greatly appreciated.
-
Don't forget that, if I remember correctly there is a limit to how much information you can pass along using the GET method, I think that's the only real practical difference.
-
Aha I see my problem now. It wasn't that DESC was wrong, but with that query build-up, the later DESC did not affect the pinned ordering, so it defaulted to ASC, so I just needed to put DESC to explicitely state it for it . Not sure if there is any possible problems with this, but it seems pretty darn good so far, thanks very much for the help everyone . I'll be sure to stop by here for help (and try and help of course lol).
-
With that addition to the query, the pinned topic is pushed to the very bottom. Is there a modification to reverse this? I'd assume using ASC rather than DESC would reverse that, but I would need ASC for pinned and DESC for the other. So far most of my queries have been considerably simple (which I try to keep it that way if I can), so I'm not too experience with building slightly more complex queries like this.
-
Or if you have a seperate results page, cross over variables back and forth so you can just easily re-populate the exact same search result again. Maybe not efficient, but it's not difficult to do. Or go with the temporary cache method.
-
Hello, I may need help with similar things like this in the future concerning PHP/mySQL as I have some doubt about certain ways I have done things in the past (I am trying to build things as small/dynamic and efficient as I can). Right now I have a little quarm about performing 2 queried loops of mysql, when I think with a bit of help/thought I may be able to pull it off somehow with just 1. Right now for my topic_display page (where I display forum topics for a category), I do something along these lines: $result = mysql_query("SELECT id, topic_id, title, creator, posts, last_post, last_post_by, locked, pinned FROM forum_threads ORDER BY thread_standing DESC LIMIT " .$i. ",$start_from"); while ($r = mysql_fetch_array($result)) { if ($r['topic_id'] == $forum_topic_id) { // If locked, then show locked image, if not then null value. if ($r['locked'] == "true") { $temp_locked = "<img src=\"" .image_url. "locked_image.gif\" border=\"0\" /> "; } else { $temp_locked = ""; } // here I echo out the actual thread data etc. } } This basically grabs all threads within a certain limit (for paging) and displays them (title, total posts, last post user/time/date), and if it's status is locked I insert a little locked image. I wish to do the same for pinned topics, however pinned topics should obviously show above everything else in a descending (most recent displayed first) fashion. I could do this easy right now by doing an extra looped query like this one first and tell it to ignore those specific entries on purpose. But is there perhaps a better way to go about this?
-
It's not the form that seems to be the problem, it is the sql. As I said works locally, but on the web host it randomly does not put the sql in, or when I do a news post edit, it makes it completely blank, so it in effect deletes the content but does not update it :S. I use $_REQUEST which handles both $_GET and $_POST. Iv'e heard using this isn't so great security wise, but functionality wise it hasn't caused a problem before. All I really did from the original that worked both for local and web host is use a new design, so not much if any of the php and sql was really touched at all besides some mysql_close(); statements and such being removed.