Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. What did the error say?
  2. Programming is not copying and pasting other people's "codes".
  3. Moved to the appropriate forum.
  4. Why? Why don't you just leave it as is...? Save those two arrays in a file and then include them.
  5. Jessica

    Sub Queries

    Yes, those are two different things.
  6. 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
  7. You should be using prepared statements in mysqli, NOT escape string.
  8. You probably have a typo somewhere. Using strict error reporting and/or a good IDE like NetBeans will help catch it.
  9. 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.
  10. Not if you're using mysql_ functions, you're not.
  11. That makes even less sense. An address has multiple users???
  12. Edit: Do the remove command within the loop. Not at the end.
  13. 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]
  14. 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.
  15. You shouldn't even be using it anymore. New code should be using mysqli/PDO.
  16. http://www.phpfreaks.com/page/rules-and-terms-of-service Read the link in my signature on Debugging your SQL. Research using prepared statements.
  17. 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.
  18. 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?
  19. Jessica

    Sub Queries

    Which is it? You want just the count, or you want all the rows?
  20. 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.
  21. Jessica

    Sub Queries

    Yes. Properly normalize your data, then you can use COUNT() and GROUP BY to get it all in one query.
  22. 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?
  23. Unless you made your personal computer accessible over the internet, there's no reason to change your local setup.
  24. 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.