Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. select concat( a.name, ' - ', concat_ws( ', ', ba.Category, bb.Category, bc.Category ) from tableA as a inner join tableB as ba on ( ba.id_cat = a.A ) inner join tableB as bb on ( bb.id_cat = a.B ) inner join tableB as bc on ( bc.id_cat = a.C )
  2. That still doesn't fix the php issue... and a 7MB image?
  3. You can dump HTML code to and from a DB field.... but it sounds like it's going to be a mess.
  4. No need... a JOIN replaces this loop... and you can do the calcluation in mysql...
  5. Whoa... you can't put an INSERT into an update like that. and END goes after the else. what are you trying to do again?
  6. Yes, I understand... but where are these values coming from? If could get it into a DB table, you're golden.
  7. Shouldn't be a problem... you just need to join table b as many times as you have columns for A-F (just be sure to use a different alias for each)... e.g. select a.name, ba.name, bb.name, bc.name from tableA as a inner join tableB as ba on ( ba.id = a.a ) inner join tableB as bb on ( bb.id = a.b ) inner join tableB as bc on ( bc.id = a.c ) etc.
  8. You may want to use the CASE statement... a little bit easier than IF.
  9. I'm not sure what you mean... what's the desired output?
  10. But the cnode table already has node1 and node2? If so, then select * from cnode as c inner join node as n1 on ( n1.node = c.node1) inner join node as n2 on ( n2.node = c.node2) Will get you all of the pairs -- it's not hard to convert this select statement into and update statement.
  11. Where are you getting these xyz values?
  12. How do you figure out which cnode record to use/
  13. You should be able to simply add this line to the my.cnf file... but I'm not sure why you're having this issue. Do you have very long multi-valued insert statements? or huge blobs?
  14. What do you mean by restore?
  15. Could you post the table structure? Sounds like you're going to need to join in the nodes table twice.
  16. You've been warned... I strongly urge you to stop. If you'd like to frequent another forum, I'm sure you'll be dearly missed. LOCKED.
  17. Something along the lines of: $result=mysql_query("select * from html where id = ' . mysql_real_escape_string( $_GET['item'] ) . '"); But you'd have to consult a proper php tutorial to be sure.
  18. I take back my "NEVER" to make one final comment... Then you made a poor choice of selecting books and tutorials -- caveat lector. Just because you can't understand something doesn't make it a riddle or a puzzle. And just because you can't figure out why I thought a one-liner was sufficient to get the bottom of your "problem" doesn't make it a clue. I've responded over ~8K questions, many with one-liners -- no one else seems to have a problem. No join condition = full cartesian product = M x N rows. That's the ANSWER to your QUESTION. But I'm not going to write code for you -- a simple glance at the mysql refman would make it painfully obvious why you're not getting the desired output. But that would require far too much effort, I suppose. Oh wait, that's a one liner too... like I said before, you don't want help, you want someone else to tell you what to do so that you can cut & paste. That's not learning, btw... unless that's not why you're coming here. Any further discussion on this matter, and the thread will be locked.
  19. Is this ID from the html table? If so, just add a where clause based on the value of this GET parameter (properly escaped, of course).
  20. There's a max packet size from mysql that may be responisible.. as well as a php timeout.
  21. Normally if you INSERT and hit a duplicate key, it will throw an error. With ON DUPLICATE KEY UPDATE, you get the chance to tell the database how to treat such a collision -- in your case, you simply want to update the word, and keep everything else the say.
  22. Should be pc.categories_id.
  23. Which one do you want to keep/
  24. No direction? I provided you with a question that should have led you directly to the answer... but you insist on having all of the answers spoon-fed to you. You posted a query about joins without the word "join" in it... that should have been your first hint. You obviously have a warped sense of the word "direct" and "learn". Oh don't you worry... I'll make a point of NEVER responding to any of your posts again. Good luck with life... I sincerely hope that's not the way you treat others that respond to your countless requests for help.
  25. Where's the JOIN condition?
×
×
  • 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.