Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. If you only use $row['world'] type use mysql_fetch_assoc if you want to do something like list($field1, $field2) then use mysql_fetch_row mysql_fetch_array returns both whereby you get: Array ( [0] => hello, ['world'] => hello, [1] => bar, ['foo'] => bar )
  2. I told you: you can NOT use custom error constants with built-in functions. You can only replicate this behavior by using your own defined functions: function my_trigger_error($errstr, $errno = MY_ERR_NOTICE) { if (MY_ERR_NOTICE === $errno) { echo 'something'; exit(0); } } //in your code somewhere: my_trigger_error('BooBoo');
  3. But it does so 4 times what code goes behind this? what rolls them out?
  4. Did you install and included the mysql module for PHP?
  5. You disabled it with overflow: hidden other possible values can be found at http://htmldog.com/reference/cssproperties/overflow/
  6. What do you exactly want to achieve? You can also just use exception's: try { $do->something(); } catch (ServerMadeBooBoo $e) { echo 'Server made BooBoo.'; exit(0); } catch (UserMadeBooBoo $e) { echo 'You made BooBoo. You bad BooBoo.'; exit(0); } You can also go for the more complex and use a Chain-Of-Responsibility (CoR) pattern: $errorHandler = new ServerMadeBooBoo(new UserMadeBooBoo()); $errorHandler->handle(MY_ERR_CBOOBOO); // Output: You made BooBoo. You bad BooBoo. So what do you exactly want to achieve?
  7. Weird it should not return anything as roll_table.jpg shows no user with all weeks with a value "y" try OR instead of AND
  8. form1.php $_SESSION['POST_FORM1'] = $_POST; form2.php $POST_FORM1 = $_SESSION['POST_FORM']; $POST_FORM2 = $_POST; //dig, hit, kick till it's clean
  9. Mouse and keyboard should do fine Plus shouldn't eviction_container be #eviction_container? How's getting evicted BTW?
  10. Yes you can have your own error constants but you can't use these with any built-in error-handling functions.
  11. Move it to the WHERE clause (WHERE is less blind probably due to age) Edit: student_roll should be students_roll I think
  12. display: inline? padding: 0; margin: 0;? I had this problem once with creating HTML e-mails
  13. http://be.php.net/manual/en/errorfunc.constants.php You can only use the E_USER_* constants (NOTICE, WARNING, ERROR, DEPRECATED) You can define your own error constants but these are not usable by the built-in error handlers (unless they share the same integer value).
  14. Then why does it have student information stored? Send me an SQL dump (create table only) so that I can review your database and maybe optimize it. For your query try and tell if that comes close to what you want: SELECT first_name, last_name, count(*) as lessons FROM roll_table GROUP BY first_name, last_name HAVING week1 = 'y' AND week2 = 'y' ..
  15. No something along the lines of: header('Content-Type: ' . image_type_to_mime_type(IMAGETYPE_GIF)); $image = imagecreatetruecolor(180, 30); imagestring($image, 3, 5, 5, $_SERVER['REMOTE_ADDR'], imagecolorallocate($image, 255, 255, 255)); imagegif($image);
  16. What are you exactly trying to achieve (based on the roll_table.jpg)? Can you give a short table preview of the desired result, something like: field1, field2, field3 ----------------------- bla, bla, bla old, mcdonald, had a farm and on his, farm, he had a cow, .. I can create a query based on this result. It seems like Walt Disney has already been successful
  17. $timestamp = mktime(0, 0, 0, 9, 19, 2009); $datetime = new DateTime(); $datetime->setTimestamp($timestamp); $now = new DateTime(); $interval = $now->diff($datetime); if ($interval->y && $interval->m && $interval->d) { echo $interval->format('%y years, %m month(s), and %d day(s)'); } else if (0 === $interval->d && ($interval->y && $interval->m)) { echo $interval->format('%y years and %m month(s)'); } else if (0 === $interval->m && ($interval->y && $interval->d)) { echo $interval->format('%y year and %d day(s)'); } else if ((0 === $interval->m && 0 === $interval->d) && $interval->y) { echo $interval->format('%y year(s)'); } else if ($interval->m) { echo $interval->format('%m month(s)'); }
  18. <img src="http://my-cool-server.com/my-cool-page.php" width=".." height=".."> header('Content-Type: image/<image-mime>'); //your processing here.. //be sure to return an image at the end.
  19. Well 1) I'm always really interested in hearing your opinions on the help I provide, so thank you 2) I said that because I sometimes have a dark sense of humor that not everyone can appreciate (or is even funny at times) but I never mean to offend anyone and I am always willing to apologize to anyone who feels offended.
  20. It's from the book Thinking in C# (Larry O'Brien, Bruce Eckel)
  21. 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
  22. 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 )
  23. TRUNCATE TABLE tableName
  24. 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.
×
×
  • 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.