Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. How would you make sure that strtotime links to strtotime and not just time, or even worse, a kludge of links that all have time in the name?
  2. I think you have to put it on the column, not the index.
  3. Jessica

    PHP, MySql

    In your previous code you are looping through db results. Do the same thing. If you can't, go read your code and figure out what it does.
  4. for the array_chunk that does work better, but you'd want to do 6 and then add one random one on the end, according to the OP.
  5. What's the format of the file?
  6. Jessica

    PHP, MySql

    No, you already know how to loop through results, unless you're just copying and pasting code without understanding it, in which case me giving you more to c&p won't teach you anything.
  7. You will probably have to have a set of delimiters you look for - spaces would be one, space and . would be another, and in your example > < would be a pair. It might be near impossible to get all the cases, but most of them should be easy enough.
  8. Jessica

    PHP, MySql

    First problem is you shouldn't do a select inside a loop. Simple select the customers order by country name, then loop through them. Store the name of the country and when you get to a different one, print it out, otherwise don't print it. <?php $sql = "SELECT * FROM customers ORDER BY country"; $last_country = NULL; while(){ //loop here if($country != $last_country){ $last_country = $country; echo $country; } echo $customer_info_here; }
  9. Are you generating lotto tickets?
  10. Jessica

    PHP, MySql

    What errors do you get?
  11. That's exactly why I did it, it was a fun little challenge. I think I edited mine at least a dozen times to make it "better". I was trying to get down to as few lines as possible lol
  12. <?php $rows = 7; $columns = 7; $numbers = range(1,($rows*$columns)); shuffle($numbers); for($row = 0; $row<$rows; $row++){ $this_row = array(); for($column =0; $column<($columns-1); $column++){ $this_row[] = array_shift($numbers); } sort($this_row); $this_row[] = array_shift($numbers); echo implode($this_row, ' '); echo '<br />'; } ?> Not tested Edit: Saw the other requirement and made changes
  13. It would help if you tell what the errors are. strlen gives you the length of the string. If you're letting them pick between 1 and 23 (which again, is already military time but you've chosen to ignore that I guess) strlen($hour) will never be greater than 2. The strlen of '1463' is 4. Logically what you're doing doesn't make sense. You can make the whole thing a lot shorter.
  14. Ah, I see what you did there.
  15. That still won't work, as he said when $siteid is zero he gets no results.
  16. That won't return all of them if $siteid is 0, which is what he said he needs. You'll have to use PHP to only add the where clause if $siteid > 0
  17. After your am pm check, you also check if the am is <=12, and if pm <=23. if any of the hours are >12 it's already military time. There's no such thing as 13:00 pm. It's either 1 pm or 13:00. So that part seems wrong to me. You also have an error message within your PM check that will never occur and doesn't make any sense. If they chose PM, and the hour is > 23, you tell them to select PM for the hour range. Not sure what you're trying to do there. You also have multiple spelling errors.
  18. I'd do it Barand's way, seems a lot less verbose.
  19. Right click on the red W, what options are there?
  20. height;80px; Doesn't anything look wrong there? You may want to format your code a little better body{ color: #FFFFFF; border: 2px solid red; } is a lot easier to read than the way you have it.
  21. Which one isn't working? use print_r($_POST); to see the contents of post.
  22. what is your SQL? before you echo this try print_r($row) and see what it contains
  23. I always do a <?php inside the code tags and I get the syntax highlighting. <?php $a = "testing"; ?>
  24. Did you start Wamp Server? You should see a green W in the righthand side of your start bar, near the clock. If it's red or not there, Wamp Server isn't running.
×
×
  • 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.