Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Then what did you expect to update? I'm confused.
  2. No, nothing was deleted. If it returned 0 then you didn't update anything which most likely means your WHERE condition didn't match on anything. Echo out your query and check your DB manually to make sure an entry actually exists.
  3. Inspect your query and find the error. You're missing a comma.
  4. From the manual:
  5. Welcome, I'm sure you will learn a lot here.
  6. Because you're actually assigning $messages_query to the return value of mysql_query($sql). Upon success mysql_query() returns a resource id or false on failure, which is used multiple times later in the code. Read more in the manual: http://us2.php.net/mysql_query
  7. What happens now? i add your codes top of the page. but nothing reporting on page... I think he wanted you to change specific lines, not add them to the top of the page. Anyway, I assume it's just a blank page which usually is caused by a fatal error. Add these two lines directly after your opening <?php tag: ini_set ("display_errors", "1"); error_reporting(E_ALL);
  8. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=326995.0
  9. What happens now?
  10. Because you print out the success message no matter what. Try checking how many rows got updated with - mysql_rows_affected.
  11. Please use tags in the future.
  12. Because you are assigning $from and $subject before the loop so it's always the first row. I fixed your code up a bit: $sql = "SELECT * FROM messages WHERE recipient='$username'"; if (!$messages_query = mysql_query($sql)) { throw new Exception('SQL Error: ' . mysql_error()); } if (mysql_num_rows($messages_query) > 0) { while ($messages_row = mysql_fetch_array($messages_query)) { echo "From: " . $messages_row['sender']; echo "Subject: " . $messages_row['subject']; } } else { echo "No results."; }
  13. No, I don't think so. What happens when you try to post?
  14. These types of errors usually refer to your query being invalid. You can also get a specific error message by temporarily changing this line to: $messages_query = mysql_query("SELECT * FROM messages WHERE to='$username'") or die(mysql_error()); You should be handling errors and exceptions properly though. Have a read through this blog: http://www.phpfreaks.com/blog/or-die-must-die
  15. Ugh, must be hell supporting that. Like Pika said, it's all about preference. You compromise either way. One is easier to read while longer and vice versa. Good, you'll be an expert in no time
  16. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=327017.0
  17. 'to' is a reserved word in MySQL: http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html You should try your best not to use them as table names. You can either change the table name and every query with it or put backtics around `to` wherever it's used.
  18. I'm almost positive that it's invalid to use the '*' wildcard to select every table name.
  19. Lol, yeah we need the codes.
  20. Your code and logic look good. Is there something in particular that you're not happy with (performance, format, etc.)?
  21. Do they provide some sort of support or documentation? It's hard for us to help you.
  22. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=327011.0
  23. Hi, welcome to the community!
  24. http://www.phpfreaks.com/tutorials
  25. Was there something specific?
×
×
  • 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.