Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. How can it use them in the average if they don't have a value? $a = 1; $b = 2; What's the average of $a, $b and $c?
  2. You don't know whether to put the URL there or... What?? Do you know how to display an image in HTML?
  3. That query won't return two rows. You're still using the wrong function. Use mysql_fetch_assoc
  4. Just remove that line and the one above it. And the one later trying to set magic quotes again.
  5. A query with a COUNT will always return exactly one row (assuming no grouping or other aggregates). The count of rows matching the criteria. Run the query in mysql and you'll see. You need to give the count an alias so you can use it in your script.
  6. The one where the image is... I don't understand your question at all. Is the folder in the web root? Then the path is that folder and the image filename.
  7. We also have a sticky thread with how to handle these errors.
  8. Pretty sure your teacher is fine. You just have a listening problem.
  9. Again - what part are you "stuck" on? Do you understand exactly what you're trying to do? Once you know what your goal is, find the functions that will do it, then write the code. Stop trying to use other people's code, and write your own.
  10. It's amazing how many people come on here and complain about their teachers being horrible. Your response to a bad teacher is to basically give up? Don't schools these days have administration anymore? When I had a bad teacher I complained to the people who could actually do something about it. Anyway since you've still not posted what errors you got with what code, you're still basically asking someone to do it for you. In the future, use code tags when you post, your code is unreadable.
  11. Why don't you try writing your own? You're not going to school to learn how to copy and paste are you?
  12. You need to show us what you tried and what didn't work. Our rules specifically state that we are not here to do your homework. If you can't do the coursework, you deserve to fail. If you can make an effort and get help based on the work you've done, that's fine IMO.
  13. Go read the documentation on the function you're using and then read about arrays. Then if you're still stuck post the actual code and errors.
  14. If you keep only showing bits and pieces and refusing to post actual errors with line numbers, this will take forever. Because I will go away.
  15. What error? Did you try any debugging?
  16. Post what you tried. Your code didn't have any fetch before.
  17. You should store in the session the user's ID, and a unique value to each user, which is also stored in the database (not their password). Use this to select the user's info when you need to use it. There's no need to use base64 encoding, or serializing (you're serializing a string, btw. Useless upon useless.) Make sure to add a die() after your header, and don't ever suppress errors.
  18. I'm not really interested in reading your code. The point is you know what user is logged in. You then need to determine if the user who is logged in is in the right group to view the page. What are you stuck on?
  19. So how does your site know if a visitor is logged in or not?
  20. You have your parentheses messed up. (strpos($string, "/images/grey_pins" !== FALSE))Is passing strpos two arguments, first is: $string, second is: "/images/grey_pins" !== FALSE Fix your parens and it should work.
  21. So it sounds like you don't have any kind of authentication in place already. Do your users register and login?
  22. $sql = "select * from mr_recipes WHERE id "; $rs = mysql_query($sql, $conn) or die ('Database not found ' . mysql_error() ); $result = mysql_query("SELECT * FROM mr_recipes"); while($row = mysql_fetch_array($result)){ Exactly as you've told it to. Your first query (the one you should use) is missing the rest of the where clause btw.
  23. Read the manual page for mysql_query. It has sample code to follow.
×
×
  • 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.