Jump to content

salathe

Staff Alumni
  • Posts

    1,832
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by salathe

  1. Looks like you're trying to use iMacros; the best place is to (re)read their documentation. You're more likely to get an answer there, than taking your chances here that someone has used that software and can help you out.
  2. As cpd said, there is no array at the moment (which is probably what is confusing us, and you). Your onHoverCounter() function takes the id of the <div> that you're attaching it to, e.g. ahri. This is a string value, not an array. Your function then gets the second letter of that string when doing ChampID[1] (JS, like PHP, allows you to access individual letters in a string by their zero-based offset). So in your example, show1 contains the string h.
  3. Variable interpolation will still occur regardless of whether the variable exists or not. php-coder, as DavidAM showed you should be using single-quotes around that string (or backslash-escaping the dollar).
  4. XML element names don't have spaces. When you use something like <John Doh> it is the start tag of a John element with an empty Doh attribute. The errors that you are seeing are because </John Doe> is not valid XML (it expects only the element name there). It would probably make more sense to have a structure that does not rely on the model name being a valid XML element name, perhaps <model name="John Doh">…</model> then you can search the <model> elements by their name attribute. XPath makes this easy, and we can help you with that if you need it.
  5. wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers The above is great if you're familiar with the "old" way of using mysql_* functions, but even if you haven't used those it's a good overview.
  6. So does the PHP manual, but you don't hear anyone complaining because it hasn't (yet) been the subject of a smear campaign.
  7. Could you elaborate a little more on precisely what you want? Is it such that, if the date is the last day of a month then show the last day of the next month? What about the next-to-last day, or the second-to-last day? What would you want to show for the following dates: 2013-02-25 2013-02-26 2013-02-27 2013-02-28 2013-03-01 2013-03-02 The strtotime() function will not do what you're wanting, so you'll need a little bit of code to handle whatever it is that you want to do. Once we can get a better idea of what you're aiming for, some code help shouldn't be too hard to come by.
  8. Why not do all the hard work in the query? SELECT event.*, GROUP_CONCAT(CONCAT(?, photo_thumbnail) SEPARATOR '|') AS thumbnails … Then pass in the URL prefix as a query parameter, like you do with event_user. This would return the thumbnail URLs in the correct format that you can just plonk into the data-images attribute in your HTML.
  9. You say that the list comes from your database, but is the actual comma-separated string returned directly from there or do you have some PHP constructing that comma-separated list?
  10. Users followed by User 1 SELECT id, logo FROM users JOIN follow ON follow.user_id = users.id WHERE follow.follow_user_id = 1 Users following User 1 SELECT id, logo FROM users JOIN follow ON follow.follow_user_id = users.id WHERE follow.user_id = 1
  11. You could use DateTime::createFromFormat(), adjusting the format string as necessary for your Oracle timestamp. $date = DateTime::createFromFormat('d-M-y h.i.s.u??? A', '12-JAN-13 12.00.00.000000000 AM'); echo $date->format('F d, Y'); // January 12, 2013
  12. When calling the function: saveXMLFile('menu.xml', $sxe); Inside the function: $dom->save($filename);
  13. Why would anyone choose to do that? There are several "huh, wha, why?" points in that single line of code.
  14. We do not recommend using the mysql_* family of functions when writing new code. The better and more up-to-date alternatives (MySQLi and PDO) have methods available for returning the whole result set into an array with one method call.
  15. Look at the example, it is used (number-of-results + 1) times.
  16. There is nothing built-in for your particular example. You could look at rolling your own iterator with the functionality that you need; something like a stripped-down version of a CachingIterator might be handy.
  17. As jcbones suggests, the DateTime class is your friend. // OOP style $date = new DateTime; // uses current date and time by default echo $date->format('t'); // prints number of days in the month echo $date->format('L'); // prints 1 if leap year, 0 otherwise // Procedural style $date = date_create(); echo date_format($date, 't'); echo date_format($date, 'L'); See the date() manual page for the meanings of the letters used with format().
  18. djburner, look at the arguments you are passing in to the function and how the function uses them. In particular, the $filename argument, which should be a string containing the path to the file that should be written. Also, there is no need to use fopen() and friends to write the file. Instead use $dom->save($filename).
  19. Did you try it? What happened? In the PHP script, look at the $argv array. Of course there are other ways. To give one example, you could use popen() and push the data to the PHP script via stdin. This would also allow you to get feedback out of the PHP script (more than just its exit code) by reading its stdout/stderr. But for simplicity, system() will serve you well enough. P.S. Tony, the OP has some C code and wants to call a PHP script from it. Maybe the confusion arose from asking a C question on a PHP forum? Upon reading it as a C question, the original post isn't particularly cryptic at all.
  20. I don't know which datepicker the OP is using, but any worth their salt would have a customisable output-date format. I'm with Jessica, in suggesting looking in that direction. Then you can compare the dates either using PHP's DateTime objects or with plain-old-string-comparison.
  21. Are you just going to /products/search when searching?
  22. Sure it is, see Date Formats and in particular the "American month, day and year" format.
×
×
  • 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.