Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. You need to read up on data sanitizing. In addition to just plain not working, your script is open to SQL injection. If you were checking for MySQL errors as well you'd get a useful error explaining why it doesn't work.
  2. For future reference you can view your actual settings by doing php_info() or an ini_get() so you can check if you changed anything
  3. And we should "trust" you why???
  4. Because something is adding LIMIT 0, 10 without the space after DESC. Did you actually read the error??
  5. <td>Forum ID<td/> Notice anything??
  6. If you make your function return a value instead of echoing it, you can call it before you need to echo the value. Your logic should be separate from your presentation.
  7. You still never run the query. Now it's a string, which is better. But it's just a string.
  8. http://www.php.net/manual/en/function.end.php See how end expects a variable passed by reference? I personally haven't encountered this but I wonder if doing it this way will resolve the error: $arr = explode("/", $_SERVER['SCRIPT_NAME']); $page_name = substr(end($arr), 0, -4); Edit: Actually I'm 99% sure that would fix it. "The array. This array is passed by reference because it is modified by the function. This means you must pass it a real variable and not a function returning an array because only actual variables may be passed by reference." From the manual.
  9. Why not do one big rectangle of one color, then you only have to do the other color's squares?
  10. I moved it here from PHP coding help, that's my bad Kevin. Application design is a better place.
  11. And that's why using your actual code and not an example matters.
  12. The very last line that isn't a comment is an SQL statement, but it's not in a string. It's just sitting there in your code. The blank page indicates you need to turn on error reporting.
  13. The code you attached is dramatically different from the code you posted, and doesn't have anything like this code. Your code also stores First and Last name in separate fields (which is GOOD) but you're only echoing 'name' in your posted code. Edit: The fact that you're running mysql_real_escape_string on values you just SELECTED from the database makes me think your code has some serious issues. You're not checking for any SQL errors either. Edit 2: You ALSO are trying to use $ID before it's been defined for your update. Turn error reporting on!
  14. Did you check that the information in your database is what you think it is? What do you get when you run the query in MySQL or phpMyAdmin? What if you do a print_r() on $res?
  15. You don't typically set a page color for a document like that. 1. Printers can't print to the edge of the page, so you'd have a white border. 2. Think of how much ink that would use. I doubt it's possible to set the page color. You could just draw a big rectangle over the whole page.
  16. Because your echo is outside of your while loop.
  17. You'll want to use usort
  18. Then don't call yourself a pro. Being 16 is not an excuse to be a whiny baby. You're well old enough to: A. Use correct grammar and spelling in your posts B. Take responsibility for your own education. Especially if you've been programming various languages for 4 years. When you learn something new, don't whine about how you didn't know it before. C. Read the rules and guidelines of this forum and follow them.
  19. That code could not produce that error. If you look at the error it will tell you the file and the line number.
  20. We can read the code, that doesn't tell us what YOU WANT TO DO and most importantly WHY. As an aside, if PHP *HASN'T* changed dramatically in 15 years it would be dying. Have you bothered to do any reading about PHP??? 1. Why do you have so many userX columns? normalize that data. 2. You don't need to select a row just to update another row. 3. you have random SQL in your PHP code, not in a string, not being executed. 4. you haven't even told us what is going wrong. We are not psychic. Only you know what you want to happen, and what you don't like about what does happen.
  21. I think OP isn't posting his entire code, just random bits of it, because he doesn't even know what it all does.
  22. By the way someone who can't resolve a simple syntax error is not a pro in php. I'm also not confident you know the difference between Java and Javascript.
  23. Stop putting the ; before the or.
  24. And no, we can't tell what you're trying to do. I can tell you if you have a table that has 10 fields called user1-user10, it's WAY wrong. Why don't you explain exactly what the steps are you are trying to complete?
×
×
  • 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.