Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. So instead of incrementing $count in the loop, just increment it when the answer is correct. Remove $count from your loop structure.
  2. *smh* Do you know that $Produce is an object? (And that PHP lines need to end in ; )
  3. There is no code to even check their answers, let alone count the correct ones.
  4. The same way you access any object's property. You're doing it with $Product.
  5. Because you missed the point I made over and over. Your code keeps changing the name on the input. You also keep changing what name you try to use. You don't have to be an expert to understand that a computer thinks "master_plan" and "masterplan" are two different things.
  6. Look at the query I posted and tell me what is different for mine and yours. You don't NEED separate functions to run separate queries for this. JUST DO ONE QUERY ONLY EVER ONE.
  7. Good job. Post the query for me?
  8. Also, I wouldn't call Yii easy to learn.
  9. Nevermind. *smh*
  10. userID is a column. userID is a column. Does userID = userID? Yes, on EVERY SINGLE ROW. Does 1=1? Yes, on EVERY SINGLE ROW. Does 'bob' = 'bob'? Yes, on EVERY SINGLE ROW. See a theme? You did it correctly for the first query: "SELECT * FROM gn_messages WHERE messageTo = $messageTo AND messageDeleted = '0' ORDER BY messageDate DESC" Now add your inner join to that query. "SELECT gn_messages.*, CONCAT(userFirstName, ' ', userSurname) AS full_name FROM gn_messages INNER JOIN gn_users ON gn_users.user_id = gn_messages.messageTo -- assuming you want the user's name who it is to. You'll need to do this join AGAIN to get the sender's name as well. WHERE messageTo = $messageTo AND messageDeleted = '0' ORDER BY messageDate DESC" On a totally unrelated note I suggest picking a naming convention and sticking with it. Switching from camelCase to underscores_and_back is really annoying.
  11. We use Yii as a base for the framework at my work, and I like it okay. It's very heavy on the memory usage though, or at least the way we've implemented it.
  12. $query = ("SELECT CONCAT(userFirstName, ' ', userSurname) AS full_name FROM gn_users WHERE userID = userID"); userID will always be equal to userID Come on. You need to make this one query with an INNER JOIN. See my post above.
  13. You need to post the code that you're having trouble with, and be a lot more specific about your question. You are confused about how to retrieve data? Or display it?
  14. Well for one, your function echos the text, not returns it. You also have random PHP inside a string. You can put variables inside a string, you can't put entire exp<b></b>ressions and functions inside them and have it work. Edit: If you keep changing it we can't help you. Now your code is using $return before it's defined. Read your error messages and attempt them. The HUGE problem is that you're running a query inside a loop by doing this. You should INNER JOIN the gn_messages table to the gn_users table and do ONE query.
  15. OP: you need to learn basic debugging. You completely missed the point I was trying to make, and unless you go back and understand what you were doing wrong, it'll happen again.
  16. That's not valid PHP. Is that your actual code? It has syntax errors. You can't just start writing HTML without either putting it in a string or exiting PHP. Please post your *actual* code.
  17. You can't just concatenate random stuff inside an array key string and expect it to do anything. You can however concat it IN the query. Either of these. SELECT CONCAT_WS(' ', userFirstName, userSurname) AS full_name FROM gn_users -- Rest of query SELECT CONCAT(userFirstName, ' ', userSurname) AS full_name FROM gn_users -- Rest of query
  18. Kicked you are very right, I stand corrected.
  19. I like CakePHP a lot.
  20. Yeah I have no idea why I said server. Lol!! Thanks Barand
  21. You need to check for errors. rand is a reserved keyword.
  22. The original code you posted is VERY different from the code you just now posted. You also posted masterplan and master_plan. Pick one and stick with it. The code I posted works.
  23. What makes sense logically?
  24. I'd post my real code, not write code that has completely different names which just wastes people's time when you're trying to identify an element by NAME.
×
×
  • 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.