Jump to content

requinix

Administrators
  • Posts

    15,290
  • Joined

  • Last visited

  • Days Won

    436

Everything posted by requinix

  1. Do you want mansethaberler.php to show only one headline? According to the link you clicked? Or to show all of them but show the one from the link first (and the user can see others)?
  2. What problem are you having trying to do that? Isn't that the same thing that slider.php is already doing? Just copy that.
  3. Actually you can create a view with a subquery. But you shouldn't for this. Relying on GROUP BY as a way to choose distinct rows is a MySQL quirk. So you're storing coach information alongside the school? What happens when the coach changes? Do you duplicate all the other school information into a new row? Why aren't you storing school information in one place and school coaches in another?
  4. If you're outputting multiple addPostCode()s then that part is right. Next place to look would be inside that function...
  5. Manipulating appearance like this is a pain. You know what's easier? Applying a class to an appropriate container ancestor and using CSS rules.
  6. You put the $mig_postcode in the loop. You didn't put the addPostCode in the loop too.
  7. Methods are code so there's nothing to persist there. Data can be serialized. Do try to serialize the data and not the object though - more portable and less dependent on your PHP. Depends on the nature of the process. I don't have the answers to this one. All sorts of concerns, yeah. Such as the fact that you only have the one cookie so that means you get only the one key. The key should be enough information to uniquely identify the data. Same key means the same data, though the same data could hypothetically exist under multiple keys. If you wanted to cache the result of finding the 100th Fibonacci number then "fibonacci_100" would be a good cache key. If you have to. Polling as a whole sucks. If it takes code to make the object available then that same code should be able to (somehow) notify a client. If there's no way to notify a client then give them expected/retry time periods (eg, "not available yet, try again at X time") based on some reasonably intelligent estimates.
  8. That's not very good table design, but whatever. You're running a second query to get totals, right? Have the query return a count of rows too. (So AL has 10 rows, AR has 5, and so on.) Before your loop, start a counter at 0. Increment the counter every time you print a row. When that counter reaches the number of rows the state has, print out a separate <tr> row with the information you want. Then reset the counter to 0 for the next state's rows.
  9. Then put it echo "<tr><td>" . $row['cmlstate']."</td>"; inside the table cell. Stick the <br> and $row[whatever] values in there.
  10. Repeating your question for the fourth time does not answer mine. Do you want to put the total inside the table cell?
  11. You don't want to put it inside the table cell?
  12. A line break is a <br>.
  13. Failure to chown() is just a warning so it won't stop the script. However that does mean (a) the warning is not being recorded in a log somewhere, or (b) it is and you haven't looked there yet... Additionally, if the script chmod()s then it may not be taking into account the umask, which typically only strips write permissions from the Group and Other masks but could be set to something stricter for you. If Apache can't read the file then it must be owned by a different user and/or group, and there aren't read permissions. (Or it could be a missing exec bit on the directory, but if Apache can read other files in it then that's not the issue.) So go into the terminal and verify for yourself exactly what user and group owns the files and what the permissions are. You should also confirm exactly what users and groups Apache and PHP are running as.
  14. You're reinventing caching. Set yourself up a redis or memcached server and store stuff in there.
  15. First step to understanding why something doesn't behave as it should is to know how it's supposed to behave. Why is that correct? Are you implying a delivery time of 1 day? Thus today (Tuesday the 18th) + 2 days of a delay before sending + 1 day of delivery = 3 days from now (Friday the 21st)? What is $off? Is $standard_days the number of business days for delivery? $saturday is apparently whether final delivery can happen on a Saturday but does that also allow mean Saturdays count towards delivery progress? Is $delay in fact some sort of pre-shipment time or does it mean something else? In other words, how is this function being used?
  16. 0775 means your file is an executable. Is it an executable? 0644 should be fine. PHP can't change ownership of a file unless PHP is running as root. It isn't, right? Have you seen yourself that the file is owned by http:http, or is that just what the code tries to do?
  17. Unless you think you can get an official answer from the Gmail team about why some emails were spam and some weren't, you're going to have to settle for my answer of "it varies by account".
  18. Yeah. It's called "some people think these emails are spam and some people don't". There is no absolute truth about what constitutes spam. It can vary by account.
  19. Start with an empty array where you will store everything. Use explode() to split the whole textarea string into an array of all the lines. Then use a loop to go over all those lines. Split each line into a name and a country. Check if the empty array from before has an entry according to the country. If it does not, add it as a (sub) array. Append the name to that (sub) array. Try writing the code for that. If you have problems, post what you wrote.
  20. Ohhh... yeah. Okay. This makes sense now. A (start, end) key finds the start quickly but the end is only useful for an exact match of a start value. Which is useless for the second half of a BETWEEN. And the lone end key won't do anything useful. So you have to do it in two pieces. I was thinking the (start, end) would somehow work for finding an end given an initial position located by the start value, but that's totally wrong.
  21. It doesn't matter what the domain is. It's just an email address.
  22. It depends on the service. I don't think you can safely change everything: some of them may use the same mail system for all of the domains, some of them might not. What's wrong with the original email addresses? Why do they have to change?
  23. That's quite a difference. What does the EXPLAIN say? I would think they should be the same: index scan to find the start, index scan to find the end, return everything (which should be just the one row since ranges don't overlap).
  24. Going to need more information than that. What are these emails? Where are they coming from? Why are they so mixed up if you don't want them to be? Why are you trying to change them to be from different domains?
  25. The query I posted won't have that problem.
×
×
  • 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.