Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. SELECT * FROM inventory WHERE username = '$username'
  2. check your php.ini mcrypt may be disabled (; in front of the line)
  3. Anyway this should be your final query, you can't count the number of weeks a student attended the school (unless you change your db scheme) but this should do the trick: SELECT first_name, last_name FROM student_roll WHERE (tutor_name = '$tutor_name' AND school = '$school_name' AND term = '$term' AND year = '$year') AND (week1 = \'y\' AND week2 = \'y\' AND week3 = \'y\' AND week4 = \'y\' AND week5 = \'y\' AND week6 = \'y\' AND week7 = \'y\' AND week8 = \'y\' AND week9 = \'y\' AND week10 = \'y\') This will list all students who have attended all weeks
  4. I found your problem (finally ) First you query: Perform this query it should give you 4 rows as a result Then you perform: Which loops for 4 times thus displaying one record 4 times. Execute these 2 queries separatly in PHPMyAdmin for confirmation.
  5. 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 )
  6. 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');
  7. But it does so 4 times what code goes behind this? what rolls them out?
  8. You disabled it with overflow: hidden other possible values can be found at http://htmldog.com/reference/cssproperties/overflow/
  9. 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?
  10. 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
  11. form1.php $_SESSION['POST_FORM1'] = $_POST; form2.php $POST_FORM1 = $_SESSION['POST_FORM']; $POST_FORM2 = $_POST; //dig, hit, kick till it's clean
  12. Mouse and keyboard should do fine Plus shouldn't eviction_container be #eviction_container? How's getting evicted BTW?
  13. Yes you can have your own error constants but you can't use these with any built-in error-handling functions.
  14. Move it to the WHERE clause (WHERE is less blind probably due to age) Edit: student_roll should be students_roll I think
  15. display: inline? padding: 0; margin: 0;? I had this problem once with creating HTML e-mails
  16. 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).
  17. 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' ..
  18. 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);
  19. 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
  20. $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)'); }
  21. <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.
  22. 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.
  23. It's from the book Thinking in C# (Larry O'Brien, Bruce Eckel)
×
×
  • 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.