Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. I still think you need to go from 0 to 23.45, not 1-24.x You also have WAY more lines of code than you need! See my example? You need *ONE* line.
  2. So you are trying to do it in Java then. I can't help because I don't write Java, so I've moved it to the Java forum. I can tell you there is no reason you need more than one loop. Here's the PHP code: <?php for($i=0; $i<=9; $i++){ if(!isset($string)){ $string = "$i"; }else{ $string = $i.$string; } echo $string.'<br>'; } ?> PS: If this is homework, you need to learn to do it yourself. See the rules.
  3. This topic has been moved to Other Programming Languages. http://forums.phpfreaks.com/index.php?topic=364932.0
  4. Why would you need more than one loop? Also, Java != JavaScript != Java.
  5. You don't, you have another table with relations of products to categories.
  6. <?php for ($i=0.0;$i<23.5;$i+=0.5){ $i = number_format($i, 1); echo $i.'-'; echo date("H:i", strtotime($i)).'<br>'; } ?> I posted this on your other thread but it's really for here.
  7. I *think* you can leave the 4th param out since you will never have a number in the thousands, but you want your digits set to 1 based on your other code. But yes that is what I meant. <?php for ($i=0.0;$i<23.5;$i+=0.5){ echo number_format($i, 1).'<br>'; }
  8. You really should have that loop go from 0 to 23.5, 12:30 am is 0.5
  9. As I told you in your other thread, for your purposes it makes more sense to automatically convert to a decimal value of 1.0 or 1.5. If you insist on checking what type it is, there are functions like is_float(), etc.
  10. Do you have error reporting set to E_ALL so you can find problems on those specific pages? (Once you fix them you can turn errors back off for security reasons)
  11. I would just run number_format on it, regardless of what format it is already in.
  12. You'd need to do a LEFT JOIN rather than INNER if you want rows that don't have a matching value (IE, NULL) to show up.
  13. Going off that... put the extension in a separate column, that is what i always do when saving the files. Looks like OP already has that part, judging by the var dump, but needs to remove it from the existing names too.
  14. I've actually been working on some tutorials for my own blog which is not yet launched, I was going to do one on debugging the mysql/i errors like that. I'll start working on it now :-P Give me something to do this weekend in my 20 minutes of free time when the baby is asleep
  15. Wow. what? Get the list of appointments for that day, ordered by hour they start. You have to loop through something to list the hours anyway, then just check if the current hour has any appointments. Do you have any code yet?
  16. I saw the one missing the ; but I was under the impression that the last line can ommit it when there are ?> tags. Is that only the last line in the *file* or the last in the section? Because if that was the error would the line number be up by 170 ish?
  17. What programming related blogs or sites do you like? Not general tech like Gizmodo but specifically web dev related (including security, clients form hell, etc)
  18. I usually use isset personally, I don't know that one version is better than the other. If you "come up" with code, rather than asking other people if it's usable you could, you know, try to use it?
  19. Agreed, on both points. I can volunteer to write that one, if you guys will proof it for me
  20. You're calling mysql_free_result($result); then trying to use the $result.
  21. I thought it was because he and the girl who played Penny split up? Edit: Polly? Peggy? Shoot..you know, the girl...
×
×
  • 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.