Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. Take a look at this post here: http://www.phpfreaks.com/forums/index.php/topic,95426.0.html Should be what you're looking for.
  2. Are we on XP here? If so, your favourites will be stored in: C:\Documents and Settings\Your user here\Favorites (assuming its on the C drive anyway) As for removing - Start>Control Panel>Add or Remove Programs - you should find IE 7 listed there.
  3. I mostly do, though sometimes i will shorten words so that the message is only one text message long, so i dont have to waste credit on two texts. However, i can understand why people do send texts in short hand, and as long as you do so reasonably i think they are generally readable. But i fail to understand why people transfer that way of writing to a forum.
  4. Oh definitely, grammar tends to be appalling. It's not just an online thing or, indeed, a young person thing. I think people have simply forgotten how to write properly. Of course, it is worse on forums. Im sure some people forget that they're not actually sending a text message!
  5. Im not entirely sure how you want to 'group those members by location again' If you were to run a query such as: SELECT *,SUBSTRING(`userid`,-1) AS location FROM `users` WHERE SUBSTRING(`userid`,1,3)='egc' ORDER BY location You'd then have all the users with a particular group (egc in this case), ordered by their location. When you outputted the results, you could then group the users together by location by ending each 'group' when the location changes.
  6. Im pretty sure youtube didn't have a problem being listed 1st on google searches. Im also pretty sure google don't buy things just so they can put them first on searches.
  7. Ok, assuming the following table structure: Table: categories id| name |pid -------------------------- 1|First Category | 0 2|Second Category | 0 3|First Sub Category | 1 4|Second Sub Category| 1 Table: items id|name|cid ------------- 0|item 1|1 1|item 2|3 2|item 3|2 3|item 4|4 The following query should get all of the item where their cid is 1, OR where there cid is a sub category of category 1: SELECT `id`,`item`,`cid` FROM `items` WHERE `cid`= 1 OR `cid` IN (SELECT `id` FROM `categories` WHERE `pid`=1)
  8. I have to disagree there (perhaps just because im in an argumentative mood this morning, but i dont think so!) - any percentage based rating system would have to be flawed. I dont believe it is possible to learn everything about any given subject. Therefore, no-one could be rated as 100%, so all percentages would be irrelevant - if the rating of 100% does make logical sense, then it follows that no other percentage makes sense either. Aside from that, any given list of sub-categories within a subject would be wildly subjective.
  9. I have to contest. I'd switch step 2 and 3
  10. The joys of The Sun - originally written for the average 10 year old i believe(and im not even joking - it actually WAS aimed so those with a reading ability of a child could read it!) - though im sure that age has been slowly decreasing! And yeah, i tend to go with the bbc too.
  11. Even if you dont make restore points yourself, windows makes them periodically, especially with the install of new software. It obviously knows it will probably mess up at some point anyway!
  12. It'll be to do with differences in the php settings between your local and live servers. The first thing i'd try is using full opening tags (<?php) rather than short ones(<?), since this is an option in php. I also suggest you add these two lines at the top: <?php ini_set('display_errors','On'); error_reporting(E_ALL); ?> This will mean that any errors will get displayed, even if your live server isn't set up to display them.
  13. It all rather depends on your exising set up as to how you would approach this. Personally, i'd aim to have an array of previously saved businesses (perhaps storing a unique id for each of them) taken from the database. Then, i would have a loop to output all of the businesses' info, with the option to save. Inside this loop i would check to see if the current business id is in the array of previously saved businesses. If it is, you display "already saved" if its not, you display the checkbox.
  14. Yeah, the only issue with cronjobs is that its not really realistic to be running a script every few seconds to make sure the latest possible value of gold is there. If you were willing to compromise on how often the gold got updated, it might make more sense to use cronjobs than my suggestion.
  15. Well, if you always wanted the very latest amount of gold, the only way you could do it would be to store a last active time in the database. On each page, you would then check that with the current time and increase gold levels as necessary. You also update the database with the current time as the last active time. This provides the illusion of real time information - all the while the user is offline, the level of gold in the database remains the same but as soon as they log in, it gets updated to the correct value based on when they were last active. The only drawback with this is that it does require a couple of queries on each and every page.
  16. I think you'd want to check the first letter of each name inside the loop, and if it's different to the first letter of the previous name, then echo that letter. Something like: <?php $names = array('Tom','Dick','Harry','Jim','Bob','Adam','Alan','Barbara','Benice'); sort($names); $curr_letter = ''; foreach($names as $v){ if($v[0] != $curr_letter){ $curr_letter = $v[0]; echo '<br />'.$v[0].'<br /><hr />'; } echo $v.'<br />'; } ?> I just used an array to test, so you'll have to change that a bit to work with your database query.
  17. Haha, no worries. Always the simple little bits that catch you out
  18. Yeah, you could use an if statment, or you can use the ternary operator. Replace this line: $savings = $order['vendorlistprice']-$order['sale_price']; With: $savings = ($order['sale_price']==0)? 0 :$order['vendorlistprice']-$order['sale_price']; Edit: Perhaps i ought to explain how it works. The ternary operator takes the following form: condition ? value if true : value if false Therefore, in the baove example, we first test to see if the sale price is 0. If it is, we assign 0 to $savings. If its not, we perform the normal calculation and assign this value to $savings.
  19. Im not sure i understand what the problem is. As far as i can see, the functions work. If i use: <?php $gt = gametime(3600,3540); echo $gt[1].' '.$gt[0]; ?> After having defined your functions, then i get the output 1 mins ago, which i presume is the correct output. Do you think you could explain a bit more?
  20. Well, im not entirely sure of the point, but something like this should do: <?php $array1= array(1,2,3,4,5); $array2 = array(4,1,3,5,2); foreach($array1 as $v){ foreach($array2 as $v2){ if ($v==$v2) echo "TRUE $v = $v2 <br />"; else echo "FALSE $v does not equal $v2 <br />"; } } ?>
  21. As far as the question is concered, i have to wonder why you have 1000 files. I assume this is some sort of game. Surely most of these files are very similar? Surely you could cut down no the number of files vastly with some variables?
  22. What if someone disables javasript? They could then view the source quite happily.
  23. No. Whilst multiple queries ARE supported by mysql, you cannot make multiple queries in that fashion from PHP. Depending on your queries, it could be possible that you could turn those into fewer queries however. Other than that, you will indeed need to loop through them all.
  24. You'll be wanting mysql full text searching. Here's a tutorial: http://www.phpfreaks.com/tutorials/129/0.php
  25. If i've understood correctly, then i would imagine it is actually after quotes that you get issues. You'll need to use the htmlentities() function. And you were right. Your title was very vague!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.