
allworknoplay
Members-
Posts
385 -
Joined
-
Last visited
Never
Everything posted by allworknoplay
-
I think it should be: $str = "SELECT * FROM actionlog WHERE itemid = $match[2] AND action = $v[3]"; Secondly, if you are allowing duplicates in your database, then your tables aren't structured properly. Use the "UNIQUE" keyword to avoid duplicates at the DB level...
-
new project - need advice on best method to achieve objective
allworknoplay replied to jimmyo's topic in PHP Coding Help
I understand, if you ever go to NFL.com and watch a live game, they will have a popup after about 30 minutes asking you to hit OK to continue. If you don't do anything you get logged off... At the end of the day, you just have to prompt the user after 5 minutes because: 1) It's not fair if someone is waiting to play with the camera, how long do they have to wait then? it should be 5 minutes, and a pop up to either continue or discontinue. 2) if you make the session too long, you'll get one guy hogging up the camera forever... 600 is in seconds. $_SESSION['expires_by'] = time() + 600; -
Done, it works perfectly. Thank's for your help. Guess I'll just have to wave goodbye to my subdomain. Wow I was actually right? LOL....
-
new project - need advice on best method to achieve objective
allworknoplay replied to jimmyo's topic in PHP Coding Help
This sounds like a very COOL project. It really is the same thing as a message board forum. You should have a DB that tracks EVERY click the user makes as if they were scouring a web forum. Until the user stops doing anything for 5 minutes, he then gets disconnected(goes offline) and someone else can then take control.... I assume you're only letting "registered" users play with your camera? -
Well you can test this out easily. Run the same program/website and instead of using your subdomain, just make it a regular path on your server like: www.mywebsite.com/admin www.mywebsite.com/somethingelse If your code works that way, then we can probably say it's a subdomain thing... Again, I could be way off though...
-
Ok well I'm about to sound really wrong on this, but I don't think your sessions can cross domains. For example: www.mydomain.website.com and www.website.com They are both 2 different domains.....
-
yeah that seems the jist of it......
-
Although I've never done this, I can only offer a generalization. When users just close their browsers, the server/website will still think the user is online. There is no way to log off the user when they close the browser. So the only thing you can fall back on is sessions. Since sessions live on the server for 20 minutes (I think that's the default) You'd have to check if there has been any activity for that user during that time period. And if they have not made any post or logged onto any forum, you can then probably set their account as offline.. As for the sessions, you can change that too if you don't like the default...
-
Class Design- objects/classes inside classes- Critique my idea
allworknoplay replied to JoeBuntu's topic in PHP Coding Help
Hey dude, I'd be more than happy to "hang" with you on this project, I think you are a bit more ahead of me in OOP but I am looking to design in OOP myself. Feel free to PM me, and I can check out your website as you work on it and perhaps we can learn this thing together, and bounce back ideas.... -
That would not work, due to the max being in the wrong place and that his table structure is most likely varchar for "td". The ` are used around table, db and column names to signify them as such. They are not required and do not hurt to be there. To correct your SQL (just to show you the proper way) here it is: SELECT * FROM `war` ORDER BY MAX(`war`. `td`) DESC LIMIT 1 But I doubt that would work, cause MAX is for the select portion and needs/requires a group by. Group By Aggregate Functions For a tutorial on MAX go here. You are a guru aren't you!!!!
-
what is your column structure like? try this? SELECT * FROM `war` ORDER BY `war`. `MAX(td)` DESC LIMIT 1 I'm unfamiliary with putting the tildes there, why do you do that?
-
Class Design- objects/classes inside classes- Critique my idea
allworknoplay replied to JoeBuntu's topic in PHP Coding Help
Nightslyr, I sent you a PM...could you please check it? Thanks. -
Class Design- objects/classes inside classes- Critique my idea
allworknoplay replied to JoeBuntu's topic in PHP Coding Help
Oh ok, yeah methods i was aware about, I didn't know it was only limited to that.... -
Class Design- objects/classes inside classes- Critique my idea
allworknoplay replied to JoeBuntu's topic in PHP Coding Help
But wait, PHP has some form of type hinting.... -
I like the VPS route. It's your own server, maybe slow(??) but won't cost as much as dedicated server.
-
Will do!!!
-
Thanks for clarifying the PHP versions...she should go without the short-tags anyways just to make herself ready for PHP6.... We have her code, she supplied it above, I checked it out and I don't see the POST variables anywhere unless I am being blind!!!!!!!!!!!!
-
mysql counting the number of members
allworknoplay replied to andrew_biggart's topic in PHP Coding Help
It does have it's uses. Let's say you want to create a mysql class where you want to use 1 function to fetch a query but have 2 functions that access that to say row or assoc (essentially this is most likely what mysql_fetch_assoc and mysql_fetch_row do). You could have each function call this 1 common function (without repetitious code) and that can use those to determine what to pull. IE: <?php function commonFetch($result, $type=MYSQL_ASSOC) { return mysql_fetch_array($result, $type); } function fetchAssoc($result) { return commonFetch($result); } function fetchRow($result) { return commonFetch($result, MYSQL_NUM); } function fetchBoth($result) { return commonFetch($result, MYSQL_BOTH); } ?> Something like that (it is a real basic example, but you get the point). As far as @ definitely is not good practice. Remove any and all, it is better to just set display_errors to 0 on production servers, on development servers you want to see you errors so you can fix them. Doing the display_errors method, you can easily turn off or on the errors vs having to remove all the @'s to see your errors. Thanks dude! Much appreciated. I am going to save your example for future use..... Didn't know about "display_errors" either so I will have to look at that. Sounds perfect since I am taking out the "@" so I definitley don't want any warnings to show up... -
After giving this more thought, it appears this is really a client side scripting issue. The PHP is only used to generate the list. But I would need some type of javascript code that would control both drop down menu's and not allow the second drop down to contain the selected item from the 1st drop down....
-
mysql counting the number of members
allworknoplay replied to andrew_biggart's topic in PHP Coding Help
Agreed. Why go out of your way to add extra parameters when assoc will just do the job. Glad I found this board because eventhough it's not PHP related, I still learned something for MYSQL. I've also ALWAYS been using "@" to suppress any possible warnings with all my mysql syntax and as I found out, the "@" makes the code very slow....so now I am in the process of removing the suppressions... I thought it was GOOD coding practice to do that...oh well.... -
mysql counting the number of members
allworknoplay replied to andrew_biggart's topic in PHP Coding Help
Very interesting, thanks for the explanation. So I suppose if most of the time I am calling my fields like so: $row['name'] It would make sense and probably even from a resource standpoint(although would I really notice) to use: mysql_fetch_assoc If I never use $row[0], then I should probably never use the mysql_fetch_array function.... (assuming that $row[0] is $row['name']) time to revise all my code!!! -
mysql counting the number of members
allworknoplay replied to andrew_biggart's topic in PHP Coding Help
Hey Wildteen, What is the difference between using: mysql_fetch_array($results) and mysql_fetch_assoc($results) -
Hey guys, I've always wanted to know how to do this. It's a mixture of PHP and either AJAX or javascript, I'm hoping someone could help me with this. Basically I have 2 drop down boxes. I don't believe this is a "parent/child" relationship. Both dropdown boxes select names from the same table say: PEOPLE If PEOPLE has: John, Jane, and David. If I select the FIRST drop down box and choose John. Then the second drop down box right below it, will only allow me to select Jane or David. So basically, whatever I choose from the first drop down, shouldn't be available in the second drop down... Could someone help me with this one?
-
Do you have ROOT access to your server or is it hosted and shared with other people?
-
For your recipe table, it's probably a good idea to have a timestamp of when it was submitted. this way you can show dates for when people submited or modified recipes. You can order by date, instead of just the last recipe and give you more control over how you want to show recipes....