Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. That doesn't sound consitent with the fact that it's the same page. Comment out all of your code, uncomment block by block, you'll find it.
  2. You can't mix those statements that way.... first, you want a join, not a union. Second, you have to put these clauses into your update statement after your set clause.
  3. Maybe I wasn't clear.... an INSERT statement will always INSERT -- NULL or NOT NULL, it doesn't matter. You need to check the values in PHP.
  4. Tsk, tsk... don't mix comma and JOIN! Let me guess, you're using MySQL 5? This will work, but it's band-aid: SELECT o.*, u.user_name, u.email, od.artist_id,cm.nexchange_price FROM ( tug_orders o,tug_currency_master cm ) INNER JOIN tug_users u ON o.user_id = u.user_id INNER JOIN tug_order_details od ON o.order_id = od.order_id WHERE o.order_id = '5' AND o.vorder_currency = cm.vcurrency_code AND o.user_id = 1 ORDER BY o.order_date DESC This is much better: SELECT o.*, u.user_name, u.email, od.artist_id,cm.nexchange_price FROM tug_orders o INNER JOIN tug_currency_master cm ON ( o.vorder_currency = cm.vcurrency_code ) INNER JOIN tug_users u ON ( o.user_id = u.user_id ) INNER JOIN tug_order_details od ON ( o.order_id = od.order_id ) WHERE o.order_id = '5' AND o.user_id = 1 ORDER BY o.order_date DESC
  5. I don't see any logic that checks for empty fields.
  6. That's impossible... is it a valid JPEG? Could you show me some sample data from the table?
  7. Right after issuing the query. Seeing the query too, with an echo, would help.
  8. Well, ahem, you didn't put the subquery in your SELECT column list, so how could it? You'll have to write a dependent subquery that get evaluated for each id.
  9. Yeah, that too... but the * issue still applies.
  10. I'm confused... why can't you let the DB generate these numbers for you?
  11. Primary Key and Foriegn Key.
  12. Define "work".
  13. I'm sorry, I thought there was a problem with the sql... maybe it the PHP code that's wrong... does the page work without tha twhile loop?
  14. Hey, that's only a 5 step program... ;-)
  15. select categories_id FROM categories as c LEFT JOIN products as p ON ( c.category_id = p.master_categories_id ) WHERE p.master_categories_id IS NULL Will give you the "empty" categories... it's not difficult to convert this into a delete.
  16. Dell can't?
  17. You need to to LEFT JOIN cat and cat_desc with products and check IS NULL for the join condition.
  18. Like I said before, you can run `whois` and specify whatever whois server that you "trust"... read here.
  19. Sounds like you need a 3-table JOIN...
  20. I prefer JOIN syntax, but yes... I'd verify with an equivalent select query to make sure it will do what you want first.
  21. There are many examples of sql birthday logic on the mysql refman page on date/time functions.
  22. how to do such thing? there's a list of domains somewhere? You can choose which WHOIS server to use... some aren't evil.
  23. You can't... * isn't psychic. You'll need to alias one of the id fields. BTW, you should really name your PK bid_id and user_id... that way, both the PK and FK have the same name, and you won't ever have name collisions.
  24. Then you're missing indexes... let's see the EXPLAIN output.
  25. Then you need a LEFT JOIN.
×
×
  • 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.