-
Posts
16,168 -
Joined
-
Last visited
-
Days Won
4
Everything posted by fenway
-
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 )
-
That still doesn't fix the php issue... and a 7MB image?
-
You can dump HTML code to and from a DB field.... but it sounds like it's going to be a mess.
-
No need... a JOIN replaces this loop... and you can do the calcluation in mysql...
-
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?
-
[SOLVED] Update of multiple records - efficient way to?
fenway replied to Conjurer's topic in MySQL Help
Yes, I understand... but where are these values coming from? If could get it into a DB table, you're golden. -
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.
-
You may want to use the CASE statement... a little bit easier than IF.
-
I'm not sure what you mean... what's the desired output?
-
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.
-
[SOLVED] Update of multiple records - efficient way to?
fenway replied to Conjurer's topic in MySQL Help
Where are you getting these xyz values? -
How do you figure out which cnode record to use/
-
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?
-
What do you mean by restore?
-
Could you post the table structure? Sounds like you're going to need to join in the nodes table twice.
-
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.
-
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.
-
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.
-
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).
-
There's a max packet size from mysql that may be responisible.. as well as a php timeout.
-
Checking for UNIQUE entries without returning error
fenway replied to kingnutter's topic in MySQL Help
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. -
Should be pc.categories_id.
-
Which one do you want to keep/
-
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.
-
Where's the JOIN condition?