Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=334216.0
  2. Maq

    Newbie Help

    You will need ajax to do this, check out: https://developer.mozilla.org/en/AJAX
  3. You're already using UPDATE, what's the problem?
  4. If I had to guess, it's broken somewhere.
  5. http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_sum (There are also specific examples in the comments below)
  6. - Please be conscious of where you post, I moved your thread to the correct section. - Read the forums rules and section descriptions before creating a thread! - In the future, please place tags around your code.
  7. Please refer to the documentation next time: SELECT SUM(A + B) AS total FROM table_name;
  8. @daybyday, in the future, please place tags around your code.
  9. You have to use a combination of date and strtotime: ini_set ("display_errors", "1"); error_reporting(E_ALL); $s = strtotime("Tue May 24 18:51:38 +0000 2011"); $today = date('F d Y', $s); $future = date('F d Y', (strtotime('+6 month', $s))); echo "today->$today \n future-> $future"; ?>
  10. Makes no sense to me.
  11. Maq

    if statement

    Huh? Yes, you should be handling errors from $rsUpdate correctly. Similar to: http://www.phpfreaks.com/blog/or-die-must-die
  12. So has your questioned been solved?
  13. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=334133.0
  14. Thank God you arrived!!! Without searl's translator I don't think we would ever understand.
  15. Something like that would be a huge security & privacy issue.
  16. Comments in the code: $query="select * from u_data WHERE username='$username'"; echo "QUERY-> " . $query; //Echo out the string query value $res=mysql_query($query) or die(mysql_error()); //die and show error, if query is invalid if(mysql_num_rows($res) > 0) //retrieve number of results returned from query { die("Username already in use."); //you need to handle this properly & not use die() } EDIT: mjd beat me to it.
  17. Where is $username defined?
  18. It's called "screen scraping", Google it.
  19. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=334128.0
  20. Your query is probably failing. Remove the '@' & change this line to: $res=mysql_query($query) or die(mysql_error());
  21. So what happens? Do you see any errors? Provide more information. - You shouldn't be using the mysql_query return value (resource or FALSE) to check how many rows are returned. Use mysql_num_rows. - You shouldn't be using the '@' suppressor symbol. Fix your errors & warnings. - If the username is already in use, don't kill the script by using die. Handle it properly, maybe give them another chance to pick a name.
  22. Your site isn't loading for me anymore (it did at one point).
  23. I moved your post to the appropriate section. Be conscious of where you're starting a thread, you have 76 posts and should know better than to put coding questions in "PHPFreaks.com Questions, Comments, & Suggestions"...
  24. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=334042.0
  25. Also, check out this blog entry for ways to help detect and handle exceptions and errors: http://www.phpfreaks.com/blog/or-die-must-die
×
×
  • 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.