ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
who? client? lead-developer? I can't imagine either making such a choice on a project nor wanting such a responsibility to use an untested framework in production. script-kiddies will have your website for breakfast working their way through your entire portfolio and probably be done by lunch.
-
From what I can remember from my VB.NET classes should this be the equivalent without all the internal validation ofcourse // $_POST['records'] = array([n] => <id>) $in = implode(', ', $_POST['records']); $query = "SELECT * FROM table WHERE field IN ($in)"; $result = mysql_query($query); if ($result && mysql_num_rows($result)) { while ($row = mysql_fetch_assoc($result)) { //do your processing here } }
-
difference between multi dimensional arrays in php 4 and 5
ignace replied to cristalmolix's topic in PHP Coding Help
Arrays are the same in PHP4 & 5 Post your code -
UPLOAD_ERR_INI_SIZE Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini. Reading the manual truly helps http://www.php.net/manual/en/features.file-upload.errors.php
-
What the hell is this? $sort2 = $_GET["sort"]; $_SESSION["sort"] = $_GET["sort"]; $sort = $_SESSION["sort"]; Shorter and easier to read: $sort = $_SESSION["sort"] = $_GET["sort"]; The same goes for: $dekleuris = $_COOKIE['uploadskleur']; $kleurachtergond= $dekleuris; $kleurachtergond = $_COOKIE['uploadskleur']; PS I know about "copy-on-write" still doesn't mean it can't be clean.
-
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
-
You mean like http://httpd.apache.org/docs/1.3/mod/core.html#virtualhost ?
-
JetBrains PhpStorm -> http://www.jetbrains.com/webide/
-
Comment system... PHP/MYSQL... just like youtube
ignace replied to rx3mer's topic in Application Design
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. -
Stop building your own framework (poor quality of code, probably untested, ..), avoid vendor lock-in and use Zend framework
-
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');
-
What do you mean by setting up a website? Registering the domain name?
-
Comment system... PHP/MYSQL... just like youtube
ignace replied to rx3mer's topic in Application Design
I understand your question quite well you are worried about performance because you would hit the database with so many queries -
SELECT c.catid, s.subcatid, c.catname, s.subcatname FROM cat c, subcat s WHERE c.catid = s.catid
-
parse error in C:\wamp\www\eigenofferte3.php on line 13...
ignace replied to svenjcvd's topic in PHP Coding Help
eregi() is deprecated -
On the other hand a sledgehammer would do fine to.
-
Mail funtion is working but not getting email.
ignace replied to denoteone's topic in PHP Coding Help
$to="me@localhost"; Do you have a mail server running on your client? -
Do you mean something like? AND FK_Projid = (SELECT FK_Projid FROM tbl_gantt WHERE ..)
-
This does assume your script will be finished reading all directories without hitting the memory_limit or the time_limit
-
set_time_limit(0); ..read directory ..do stuff exit(0);
-
Comment system... PHP/MYSQL... just like youtube
ignace replied to rx3mer's topic in Application Design
That's why they invented caching -
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 ' : ''); }
-
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.
-
Comment system... PHP/MYSQL... just like youtube
ignace replied to rx3mer's topic in Application Design
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. -
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 ...