Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. The reason you are having a hard time is because your db has been badly designed: products ----------- product_id product_name company ----------- company_id company_name license ----------- license_id license_name product_id company_id license_numbers Your company can have many products but not each product may have a license. company --(1..*)--> product --(0..*)--> license products ----------- product_id product_name company_id companies ----------- company_id company_name licenses ------------ license_id license_name license_sum product_id Now you can query these by using: SELECT * FROM companies c -- use LEFT JOIN if you want to show up companies that have no products -- in this case the relation becomes company --(0..*)--> product JOIN products p ON c.company_id = p.company_id -- if the product has no license all fields for licenses will return NULL LEFT JOIN licenses l ON p.product_id = l.product_id
  2. You mean like http://httpd.apache.org/docs/1.3/mod/core.html#virtualhost ?
  3. JetBrains PhpStorm -> http://www.jetbrains.com/webide/
  4. And my response still stands CACHE your page (keep separate caches for both the song details and the comments) invalidate the comment cache upon receiving a new comment.
  5. Stop building your own framework (poor quality of code, probably untested, ..), avoid vendor lock-in and use Zend framework
  6. I believe __DIR__ is only available since PHP 5.3.x and more then likely he has a version <5.3 @OP DIRECTORY_SEPARATOR solves the slash thing include_once(rtrim(dirname(__FILE__), '/\\').DIRECTORY_SEPARATOR.'filename.php');
  7. What do you mean by setting up a website? Registering the domain name?
  8. I understand your question quite well you are worried about performance because you would hit the database with so many queries
  9. SELECT c.catid, s.subcatid, c.catname, s.subcatname FROM cat c, subcat s WHERE c.catid = s.catid
  10. On the other hand a sledgehammer would do fine to.
  11. $to="me@localhost"; Do you have a mail server running on your client?
  12. Do you mean something like? AND FK_Projid = (SELECT FK_Projid FROM tbl_gantt WHERE ..)
  13. This does assume your script will be finished reading all directories without hitting the memory_limit or the time_limit
  14. set_time_limit(0); ..read directory ..do stuff exit(0);
  15. That's why they invented caching
  16. notice 'now' while ($row = mysql_fetch_assoc($result)) { $start = new DateTime('now'); $end = new DateTime($row['end']); $interval = $end->diff($start); // replaces time_compare() if ($interval->invert) { echo 'Item Sold'; continue; } // these 4 lines replace your entire time_format() function with equal functionality echo (!empty($interval->d) ? $interval->d . ' days ' : ''), (!empty($interval->h) ? $interval->h . ' hours ' : ''), (!empty($interval->i) ? $interval->i . ' minutes ' : ''), (!empty($interval->s) ? $interval->s . ' seconds ' : ''); }
  17. IMO this suggested to the OP that PEAR::Mail notifies him whenever a mail is not opened/received while PEAR::Mail merely allows you to send your mail through something different then the built-in mailer like SMTP.
  18. No it is not as it would use the parameters in $_GET or $_POST. Anyway you can use one page for all songs as they all will look the same except will differ in content.
  19. My code would do the same: The second number is the number of players in each group Group 1, 0 Group 2, 0 Group 3, 0 Group 1, 1 Group 2, 0 Group 3, 0 Group 1, 1 Group 2, 1 Group 3, 0 Group 1, 1 Group 2, 1 Group 3, 1 Group 1, 2 Group 2, 1 Group 3, 1 ...
  20. I see more and more Belgian users so that makes me wonder how many actually are on this forum. So tell us your real name, city, age and occupation if you live in or have lived in Belgium. We could be neighbors without knowing Ignace Knops, Landen, 23, Webdeveloper If there are enough users from a certain city we could setup regular meetings where we could discuss adventures or hold presentations about PHP specific topics.
  21. If you are looking for best practices then you may not be interested in CMS systems especially open-source as they usually contain anything but best practices. A few things I picked up from Google http://net.tutsplus.com/tutorials/php/30-php-best-practices-for-beginners/ (2009 http://www.odi.ch/prog/design/php/guide.php (2005) http://www.mikebernat.com/blog/My_PHP_Best_Practices (2008)
  22. ignace

    XML DTD Issues

    What do you exactly want to do?
  23. When I was younger, so much younger than today, I never needed anybody's help in any way.. Help me if you can, I'm feeling down and I do appreciate you being round. Help me, get my feet back on the ground, won't you please, please help me?
  24. PEAR::Mail is no different then mail() it only allows you to use something different then the native PHP mailer. It will not tell you if your recipient actually received the e-mail. There are a few other ways though you can use: 1. Use a 1x1 pixel image <img src="http://www.yourserver.com/mail-received.php?email=.." width="1" height="1> Ofcourse if their e-mail client blocks images you'll never know who read it. 2. Use the Return-Path header. This will send an e-mail back to you in the event a mail could not be received. You can use PHP to read incoming mail (http://www.evolt.org/article/Incoming_Mail_and_PHP/18/27914/index.html) Your best option is to use http://www.campaignmonitor.com/ this is a tool that provides you with all the needed statistics
×
×
  • 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.