Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. You can set the timezone of your MySQL server with the command All returned data will then be modified to your timezone so you don't have to call extra functions in PHP
  2. Why is that? For real I mean I am really interested in hearing your opinions (you can even PM me if you don't want to humiliate me in public )
  3. TRUNCATE TABLE tableName
  4. Although this may seem like a smart move it also has some drawbacks, for example: if you want to replace an existing levels name (from a back-end) suddenly those that are level 3 are level-less. (progress - levels_minfans) / levels_maxfans - levels_minfans * 100 Edit: damn Daniel0 beat me to it. Edit2: I forgot to incalculate the player's progress Multiply by 100 to get a percentage.
  5. You may also be interested in: $query = 'SELECT field1, field2, field3 FROM table WHERE ..'; $result = mysql_query($query); list($field1, $field2, $field3) = mysql_fetch_row($result);
  6. I found this on MySQL manual UTC is the way to go apparently. I also found: For more information http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html
  7. <a href="#" onClick="return submitForm('formName');">text</a> <script type="text/javascript"> function submitForm(formName) { var form = document.getElementById(formName); form.submit(); return false; } </script>
  8. Is this a loop? and yes, it uses integers, also wouldn't $in be - ,13 (If the ID is 13 that is) No this is not a loop it uses the IN operator to delete all rows with the corresponding ID's (=integers provided by $_POST['checkedItems']) And if you pass 13 it will show up as 13 if you pass 12 and 13 it will show up as 12, 13
  9. do: echo $sqlquery; after $sqlquery = "DELETE .. and tell us what is says
  10. Query with both $_GET['id'] as you $_SESSION stored user_id
  11. No a far better approach then the foreach () would be: $in = implode(',', $_POST['checkedItems']);// I recommend that you verify that 1) the user is allowed to do this 2) it's an array containing only integers $query = "DELETE FROM table WHERE id IN ($in)"; $result = mysql_query($query);
  12. np although I do advice you to pick up a book or take a course on the matter it will enable you to spot errors/flaws and correct them yourself. these corrections will be made based on domain knowledge (what I am currently missing due to the fact I don't know every angle of your project)
  13. ignace

    XML DTD Issues

    No but you can do: <!ATTLIST option sex (male|female) #REQUIRED>
  14. There are a few ways you can do this? I don't suggest using tables as you will have to make sure each row contains exactly 4 images or that you give the correct colspan to the correct <TD> So a far easier method is to just put every <img> in a <div> float:left each div and make sure the total width of the containing element fits the total size of 4 images. It will put the other images on the next line automatically while maintaining valid HTML
  15. What happened to CrayonViolent's LaserShark's? Are they still in production? They seemed to be quiet effective
  16. Yes? I don't see a problem? tbl_orders would look like: 1, 1, 3, 5, 2010/4/2 -- John bought 5 medium-sized skirts on 2010/4/2 2, 1, 10, 1, 2010/4/2 -- John also bought 1 small-sized dress on 2010/4/2
  17. Your looking for FOUND_ROWS http://dev.mysql.com/doc/refman/5.5/en/information-functions.html#function_found-rows SELECT SQL_CALC_FOUND_ROWS * FROM users LIMIT 0, 10 SELECT found_rows() as found_rows -- OR -- SET @found_rows = found_rows() -- allows for later use
  18. Depends on what you consider complex. echo date_diff($timestamp)->format('%d days %i minutes');
  19. It will be "removed" yes but administrative personnel is still able to read the messages.
  20. You have a logic error if mysql_num_rows() returns something different then 1 the variable $theTeam does not exist and results in NULL and a warning (do you have error_reporting and display_errors set correctly in your php.ini?). The solution is to simple include all your code in the if (mysql_num_rows($result) === 1) block.
  21. You could set a delete field with a 0 or 1 then when retrieving WHERE delete = 0
  22. WHERE date >= now() ORDER BY date
  23. How did you try it did you enter: http://<WAN-IP>/
  24. tbl_orders (id, customer_id, product_has_size_id, quantity, purchase_date) If you wonder why not: tbl_orders (id, cart_id) Then the answer is simple if he clears his cart your customer history is gone
×
×
  • 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.