Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. It needs to be outside if the PHP tags (unless you use PHP to generate some of the variables) and be valid JavaScript.
  2. I'd do it in jQuery. You should be able to easily google "javascript change css class" and "javascript get time". The end result depends on exactly what you want to do.
  3. header('Location: URL here');
  4. You want us to help you but you won't post your code? What do you expect us to do, wave a magic wand? Something is causing the code to run twice, OR the problem is IN your code.
  5. It already IS JSON. Treat it as such.
  6. This forum is for help with code you write. What part are you stuck on? What have you done?
  7. http://www.php.net/manual/en/function.parse-url.php#104874 ?? Maybe?
  8. Also it looks like there was a fix in 5.4.7 for the no http cases.
  9. So check if the first part is http:// and if not add it...
  10. Yes, it's possible.
  11. No, how do you store the actual quizzes. You should have a table for quizzes, questions, answers. Then for quizzes taken with questions answered. Google data normalization.
  12. And for the actual quizzes that are taken?
  13. What's the problem? You need to do some basic debugging. See the link in my signature on debugging SQL. I see several MAJOR issues. 1. What is $value? 2. Why are you selecting the quiz ID from the questions? What is your table structure? It looks like you may have some issues with that. 3. Your last query could be written much cleaner. a. Don't put numbers in quotes in MySQL b. Don't use PHP to calculate the time. Really that field should have a default value. $inscore = "INSERT INTO tblresult VALUES (NULL, $x['QuizId'], $score, NOW())"; c. You should list the fields, so ideally: $inscore = "INSERT INTO tblresult(quizId, score) VALUES ($x['QuizId'], $score)"; 4. You never RUN the query, which is probably your biggest issue. 5. This looks like you'll insert one row for every question. Big problem.
  14. That's JavaScript. You should be able to google it and find plenty of examples.
  15. That's not at all what I was asking for, but it does expose that you're running queries in loops. BAD. Stop that.
  16. That whole line doesn't even make sense. $arr[] = $r;. When you want to use the values later you'll want to check if they are set but it would be at a more logical place.
  17. Can you dump the structure and some sample data?
  18. Scuze me, "new-to-me"
  19. Isn't that what PASSWORD does?http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html
  20. Instead of organizing your table by years, then customers, do it by customers, then years. $NewArray3 = array( "2year"=>array_count_values($custnames3), "1year"=>array_count_values($custnames2), "less1year"=>array_count_values($custnames1) ); That's the part you'll want to change first. Edit: And I see no reason you can't do the entire thing in SQL.
  21. That actually made things more confusing. Either way you need to JOIN to the other table first.
  22. Make your query ORDER BY the date posted field. To do the categories you'll need to make it JOIN to the category table, ON the category id.
  23. I told you the way to check what the variable is, and a way to specifically avoid this error. The bigger problem is you need to trace back to when the variable is created. If you don't "do" php, you should tell whoever told you to fix it that you either need time to learn, or they should pay someone who DOES know PHP.
  24. Responses like this are why 99% of the time, I don't write as much as I did in my reply. Did you even read it? It's like, why do I waste my time actually telling to how to do it, when you're just going to ask how to do it?
×
×
  • 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.