Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/06/2020 in all areas

  1. There's no context around the code you've posted, but there appear to be a couple issues. First and foremost, you're using get_currentuserinfo() , which is deprecated in favor of wp_get_current_user(). Even beyond that, you're requesting the data of the currently logged in user, which is you. So actually your code is doing exactly what you've asked it to do. Another issue is that you're calling get_currentuserinfo() multiple times - if all this code is in the same template you don't need to do that. Give some context to what you're trying to do with this code. If you're in the WordPress loop, use the information about the current post.
    1 point
  2. Of course, you could store the city and the full school name, then using the technique we discussed in this forum a couple of weeks ago, remove the city from the school name when required. I.E. SELECT school , city , TRIM(REPLACE(school, COALESCE(city,''), '')) as short_school FROM school; +------------------------------+----------------+----------------------+ | school | city | short_school | +------------------------------+----------------+----------------------+ | Bloomington North | Bloomington | North | | Columbus East | Columbus | East | | Fort Wayne Bishop Dwenger | Fort Wayne | Bishop Dwenger | | Neil Armstrong High | NULL | Neil Armstrong High | | Davy Crockett School | San Antonio | Davy Crockett School | | Kokomo | NULL | Kokomo | | Logansport | NULL | Logansport | | Marion | NULL | Marion | | Jefferson | Lafayette | Jefferson | | McCutcheon | Lafayette | McCutcheon | | Harrison | West Lafayette | Harrison | | Carmel Greyhounds | NULL | Carmel Greyhounds | | Zionsville Eagles | NULL | Zionsville Eagles | | Fishers Tigers | NULL | Fishers Tigers | | Noblesville Millers | NULL | Noblesville Millers | | Westfield Shamrocks | NULL | Westfield Shamrocks | | Hamilton Southeastern Royals | Hamilton | Southeastern Royals | +------------------------------+----------------+----------------------+
    1 point
  3. IMO, you are just creating a problem mixing data. It doesn't matter if the school name is the same as the city. A city is a city, a school is a school.
    1 point
  4. Have you tried adding some tracing to that code to see what it is doing, shows you values of things, etc? And who uses js script tags in the middle of their php logic?
    0 points
This leaderboard is set to New York/GMT-04:00
×
×
  • 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.