Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Two things: 1) It's not really a hash, since the RVALUE should really be: { 'fromid':'<?php echo $row['fromid'];?>', 'subject':'<?php echo $row['subject'];?>', 'mail':'<?php echo nl2br($row['mail']);?>' }; 2) That's because you have to escape linebreaks in JS -- in fact, if you had single-quotes in your subject field, you'd have problems too. So I don't know what nl2br() is not doing...
  2. First, that's impossible. Second, you have some very scary looking code there -- for example, you should be calling inform(this.value)... not hard-coding the order! Third, your button function should at least take the form object (with this.form)...
  3. Try this: SELECT products.name, products.prodID, IFNULL( promotions.price, products.price ) AS price FROM products LEFT JOIN promotions ON ( promotions.prodID = products.prodID )
  4. All SQL dates are stored in a standard format... so you have to store it that way too (and you should). You can request it in any way you want.
  5. Don't change how to store it... it was correct. If you want it back different, use DATE_FORMAT().
  6. That's how you search and store them....
  7. I usually just include a parent_uid field, have it NULL for the "parent", and then just left join in as many levels as are needed.
  8. A few things... 1) link1 is a string, not a JS variable. Not that I know where the id variable comes from...? 2) You have quoting issues -- you can't put double quotes in a double quoted string literal, or the parser won't know where the string starts and end. 3) document.write() isn't always the best way to go. 4) You have lots of code duplication -- a hash would be better. 5) No semi-colons? 6) No functions? Something like: <script type="text/javascript"> var sLink = ( hLinks[id] ) ? id : 'DEFAULT'; var hLinks = { 'link1':{ 'id':'link1', 'href':'#', 'src':'page GFX/New_Products/More_offers.jpg' }, 'link2':{ 'id':'link2', 'href':'#', 'src':'page GFX/New_Products/Back_to_start.jpg' }, 'DEFAULT':{ 'id':'default, 'href':'#', 'src':'page GFX/New_Products/default.jpg' } }; var sImageHTML = '<a href="'+hLinks[sLink].href+'" id="'+hLinks[sLink].id+'"><img src="'+hLinks[sLink].src+'"></a>'; document.write( sImageHTML ); </script> Of course, if I were emehrkay, then writing out the HTML code would be method of an custom object ;-)
  9. onclose has strange browser support... there's another thread my jaymc on this topic.
  10. Easy? I find the method they discuss to be very difficult to maintain.
  11. LEFT( speakers, 1 ) will also work.
  12. I'd put parenthesis around your BETWEEN clauses... ANDs and ORs don't mix.
  13. Why not just interconvert?
  14. fenway

    Mysql Problem

    No it's not... you were *denied* access. Check the grants table for that host.
  15. Don't add the trailing semicolon.
  16. Yeah, that's not very elegant at all.. but you're limited by the denormalization of the source data... and I assume you don't want to fix it during the import. At the very least, make a fulltext index for the notes and use that.
  17. At the risk of sounding stupid, "how/where?" Take a look at the relevant refman page -- this way, you can compare the variables (global is the important one).
  18. That's the right way to build a RegExp object.
  19. Well, the number 101 is arbitrary -- so you know it -- a COUNT(*) will give you other #.
  20. that NOT IN is very expensive... are you running this often, or just as maintenance once?
  21. fenway

    mysql error

    The error is that you're not showing us the query.
  22. How did you work around this?
  23. You're trying to build HTML from MySQL...
  24. Yes, but the ISO is the default... it's not "detecting" that.
  25. You need to compare the sql modes on the source & destination databases.
×
×
  • 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.