Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. Programming is not copying and pasting other people's "codes".
  2. Why? Why don't you just leave it as is...? Save those two arrays in a file and then include them.
  3. Jessica

    Sub Queries

    Yes, those are two different things.
  4. Do not bump your posts. The quote pretty much explains it as far as what you need to know to use it. For more information see the PHP manual. http://us2.php.net/manual/en/language.types.resource.php
  5. You should be using prepared statements in mysqli, NOT escape string.
  6. You probably have a typo somewhere. Using strict error reporting and/or a good IDE like NetBeans will help catch it.
  7. If you'd explained some of this up front it would have gone a lot faster. It probably has to do with the configuration of your relationships, which you haven't shown. I suggest you read the links in my signature on how to get help. David: counterCache is supposed to handle that count automatically - hence why it's trying to update the userCount automatically when the users table is updated. It's a tool for CakePHP.
  8. Not if you're using mysql_ functions, you're not.
  9. That makes even less sense. An address has multiple users???
  10. Edit: Do the remove command within the loop. Not at the end.
  11. Why would you bother with three lines of code though? That's the same as just doing: echo $structure[0]['cards'][0]['info']['city']['title'] Or: echo $structure[0]['cards'][0]['info'][$somekey][$someotherkey]
  12. That makes no sense. When you delete a user, why would you attempt to update their Address count? You should call that when you delete an ADDRESS, not a user.
  13. You shouldn't even be using it anymore. New code should be using mysqli/PDO.
  14. http://www.phpfreaks.com/page/rules-and-terms-of-service Read the link in my signature on Debugging your SQL. Research using prepared statements.
  15. Best practice is to use an auto-incrementing id as your primary key, even if you think usernames will never change. OP: You haven't posted a question or a problem or any code. You've just posted what you want to happen. Cool story.
  16. How should we be able to help? You've posted no code. You also said it was an UPDATE before, now it's a DELETE? If you don't even know what your code is doing, how should we?
  17. Jessica

    Sub Queries

    Which is it? You want just the count, or you want all the rows?
  18. I'd start by writing some code. This forum is for help with code you've written. If you need application design advice, we have a forum for that.
  19. Jessica

    Sub Queries

    Yes. Properly normalize your data, then you can use COUNT() and GROUP BY to get it all in one query.
  20. OP: If you always are going to use the first card, is there a reason you have it in an array called 'cards'? Why not just one card?
  21. Unless you made your personal computer accessible over the internet, there's no reason to change your local setup.
  22. Jessica

    Sub Queries

    Use an OR clause between those two. WHERE name ... AND (sms .. OR email .. )
×
×
  • 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.