Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. Personally, i think two minutes is fine. I only really use the edit to fix typo's anyway.
  2. See: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
  3. Have you decided to change this setting now? There appears to be no time limit for editing?
  4. You need to switch the variables around, rather than the sign. <?php function mysort($a,$b){ return $b['time'] - $a['time']; } uasort($yourarray,'mysort'); ?>
  5. Haha, i might have to get myself one of those! In fact, i wonder if an application for the TI84 exists... Edit: Well, i found an app that will do symbolic differentation, so thats a start!
  6. As in: <?php $sql = mysql_query("SELECT SUM(value) FROM colors") or die(mysql_error()); $sum = mysql_result($sql,0); echo $sum; ?>
  7. Haha. Just remember, there's no point anyway - it'll be wrong and you'll have to put it back how it was before anyway.
  8. I think it must just be expensive in Denmark - i paid £55 for my TI84 plus, which is about $100 at the moment. The TI89 can do symbolic differentiation and integration?
  9. No idea. It rather depends on what sort of data you're talking about, and WHERE it's coming from. We need a more detailed explanation.
  10. Try: <?php function mysort($a,$b){ return $a['time'] - $b['time']; } uasort($yourarray,'mysort'); ?>
  11. Erm, i think you misunderstand me. I'm taking about the closing brace ( } ) of the while loop. If that is further down your page, then your form is inside a while loop.
  12. I'd probably switch to just using sessions. Since you're limited to keeping the information during the current session anyway (because you're tracking by session ID, and not a username), the database doesn't offer the advantage of keeping the information for the user. Also, all you really need to track is the IDs relating to the items(products?) that the user has previously selected, so we're not storing lots of information.
  13. If you're using the code you posted, then the form tag is inside the loop. In fact, there's no closing brace in the code you posted at all.
  14. It'll all just be string manipulation and regular expressions. Since you've still provided us no idea how to get from the initial data to the output, i can't help you much more than to point you to: www.php.net/preg_replace and http://www.phpfreaks.com/forums/index.php/board,43.0.html
  15. So when you said you were using sessions to track the user's selection, you really meant you were using a database? Anyway, your code seems pretty confusing. As far as i can see, you're creating a form inside a while loop, which seems rather bizarre.
  16. Where is the count coming from? Is all the data in one table? Or do we have a list of categories in one table, linked by an ID to another table? Showing us your data structure would be useful.
  17. As an example, i'd do it like this: <?php session_start(); if(!isset($_SESSION['selected'])){ $_SESSION['selected'] = array(); } if(isset($_POST['submit'])){ $_SESSION['selected'] = $_POST['numbers']; } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" METHOD="POST" /> <select name="numbers[]" multiple="multiple" size="5" /> <?php for($x=1;$x<=20;$x++){ if(in_array($x,$_SESSION['selected'])){ $selected = ' selected = "selected" '; }else{ $selected = ''; } echo '<option value="'.$x.'"'.$selected.'>'.$x."</option>\n"; } ?> </select> <br /> <input type="submit" name="submit" value="Confirm" /> </form>
  18. The problem is that you havn't specified which table the field id should be in, inside your subquery. Try: $sql=mysql_query("SELECT *, (SELECT COUNT(*) FROM news_comments WHERE news_id=news.id) AS 'numcomments' FROM news ORDER BY id DESC") or die(mysql_error());
  19. Try: UPDATE tbl SET IMAGEFILE = CONCAT(USERNAME,'jpg')
  20. Yep, i expect its a bit of both - lots of people don't know about them, and they are fairly expensive. Though, having said that, i expect most people who would say they are too expensive would be more than happy to spend that amount on a pair of trainers/some clothes.
  21. No - hence why it provides an unfair advantage.
  22. My comment of being allowed ot use it related more to the exams we sit. Since everybody in the country who is taking maths at A level will be taking the same exam, its probably unfair that some people (like myself) will have the aid of such a calculator - there's no doubt it makes the paper easier. But yes, i agree - different skills should be assessed in different ways.
  23. I love my TI calculator. It makes maths exams so much easier! Still cant believe im actually allowed to use it. Now, if only i could figure out a legitimate reason for needed a calculator in my psychology exam, i could stick some notes on it and i'd be sorted for that too.
  24. Indeed - but take any swear word and think of all the different ways that you could communicate that swear word without spelling it out exactly (e.g. symbols to represent letters, spaces in between, other symbols inbetween, mis-spelling etc). Now do the same for every other swear word you can think of. That's going to be one very large array.
  25. That depends on how you're doing your replacement. If you're using ereg_replace(), use eregi_replace(), if you're using preg_replace(), use the case insensitive modifier. If you're using str_replace(), use str_ireplace() Of course, you'll still have users putting spaces/other symbols in between letters to get around your filter anyway.
×
×
  • 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.