Jump to content

Rykin

New Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Rykin's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Tried using that mb_str_replace function from that thread but it just returned a bunch of warnings and didn't work. Sounds like this is an issue with str_replace though so I guess I will just write a function that uses preg_replace for all the strings/characters that str_replace has issues with.
  2. I am using str_replace() to clean up some data I am getting from another source and it is working just fine in some instances but not at all in others. For instance it isn't replacing … or ‘ or ’ or a number of other characters. I am feeding str_replace two arrays, one with the characters/strings to replace and another with the characters/strings to replace them with. Any ideas why it would be replacing some characters just fine but not others?
  3. Are you storing you time as a timestamp or as a string like "14:53"? Also what language are you working in? I am mostly a PHP guy so I would do it like this (not saying this code will work but it will hopefully help point you in the right direction): $current = time(); $currentLessTen = $current - 600; $query = 'SELECT subject FROM news WHERE time BETWEEN ' . $currentLessTen . ' AND ' . $current . ' ORDER BY time DESC'; "ORDER BY time DESC" assumes you want the results listed from newest to oldest.
  4. I am having one issue with reading an SQLite 3 database via PHP's PDO class and I have one question about queries in general. The issue I am having is with my query string not returning anything if any of the fields I am checking are empty even though others are not empty. Here is the query string I am using: SELECT * FROM ZENTRY WHERE ZPLATFORM = "' . $platform . '" AND ZCUSTOM2 != "wishlistitem" ORDER BY ZTITLE ASC Some of the ZCUSTOM2 fields contain the data "wishlistitem" and the rest contain no data at all. Is there anything I can do besides inserting data into the empty fields (which does work but is not the best solution in this case) to fix this? Now my question is simply is it possible to write a query with a wildcard for the field in the WHERE part of the query? Example: SELECT * FROM ZENTRY WHERE ZPLATFORM = "' . $platform . '" AND * != "wishlistitem" ORDER BY ZTITLE ASC Basically I would like to set it up so that if any field contains the string "wishlistitem" it returns false so that if I ever decided to share this it will be easier for others to setup their databases (this is a read-only web front-end for a desktop application that stores its data in SQLite 3 format) without needing to edit much (or better yet anything) in the PHP files.
×
×
  • 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.