Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
Overall the design will be improved (courtesy of Jeff). There will be some general refactoring (to make my life easier in the future), a tagging/category system for tutorials, asset manager for people with author permissions so they don't have to host images etc. externally. There are some other things I haven't decided completely on yet, so I won't disclose that. Otherwise I'll just have people saying "but you said we would get X and Y!" Again, there is no ETA available though.
-
I'll take a look at it, but it won't be done before the next release of the website. The ETA for that is whenever I have time to finish it. It includes some other stuff as well.
-
I think what SA meant was that the higher paying jobs require skills that take a long time obtaining. Studying several years on a university and working yourself up to a high level management position in a large corporation takes a lot of time and is thus highly paid. The low-pay back breaking jobs, on the contrary, typically require no prior qualifications, and you could walk in from the street getting the job assuming they need more people.
-
No. Double posting is in fact against the rules. I can move this topic for you if you wish.
-
What does that have to do with this topic? Anyway, I'd argue it won't. What about the people who browse with Javascript off like myself? You would violate the progressive enhancement principle I just mentioned.
-
Overall, well written HTML and CSS will be adequate for modern mobile browsing. If you use things like separation of concerns, progressive enhancement and unobtrusive Javascript you shouldn't get into any trouble. You should follow those principles either way.
-
[SOLVED] continue from other post...Pattern Match
Daniel0 replied to glenelkins's topic in Regex Help
You put it after the delimiter, which in this case is the percentage sign. -
Dumping Data Backups From Server to Other Workstations
Daniel0 replied to needs_upgrade's topic in Application Design
Setup replication. It's explained in the manual. Of course this is probably not a backup in the sense you mean. If you delete a row on the master server it would propagate to the slave servers as well. You could have a cron job for routinely dumping the data on the slave servers though, which will give you extra redundancy. -
[SOLVED] continue from other post...Pattern Match
Daniel0 replied to glenelkins's topic in Regex Help
preg_replace('#foo#m', 'bar', $string); ? It works like all the other modifiers and it's explained in the manual page I linked to. -
[SOLVED] continue from other post...Pattern Match
Daniel0 replied to glenelkins's topic in Regex Help
Use the multi-line modifier: #patternHere#m http://dk.php.net/manual/en/reference.pcre.pattern.modifiers.php -
Well, evidently it would not be preferable. As you have found out yourself, getting any meaningful data out of a such setup would be much more difficult. You are in no way the only person who has ever needed a many-to-many relationship. It happens very often. As corbin said, it would be a good idea to look into database normalization. Less does not automatically mean better. Often quite the contrary in fact.
-
Why don't you just use an XML parser?
-
[SOLVED] Warning: require_once(/home/gxforums/
Daniel0 replied to Monkuar's topic in PHP Coding Help
As far as I know their license prohibits removing the copyright notice... -
Is there some kind of php to don't allow browsers to cache files?
Daniel0 replied to pneudralics's topic in PHP Coding Help
The only thing you can do is to kindly request the user agents that they do not cache anything. You can't enforce it. -
Nowadays you would just be wasting your time learning that.
-
You were already given the simple way. This is a standard many-to-many relationship. Schema: CREATE TABLE cities ( city_id int(10) unsigned NOT NULL auto_increment, name varchar(100) NOT NULL, PRIMARY KEY (city_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE users ( user_id int(10) unsigned NOT NULL auto_increment, username varchar(50) NOT NULL, PRIMARY KEY (user_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE user_city_choices ( user_id int(10) unsigned NOT NULL, city_id int(10) unsigned NOT NULL, PRIMARY KEY (user_id,city_id), KEY city_id (city_id), CONSTRAINT fk_users__user_id FOREIGN KEY (user_id) REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT fk_cities__city_id FOREIGN KEY (city_id) REFERENCES cities (city_id) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Data: INSERT INTO `cities` (`city_id`, `name`) VALUES (1, 'Foo'), (2, 'Bar'), (3, 'Baz'), (4, 'Another city'), (5, 'Hello World'); INSERT INTO `users` (`user_id`, `username`) VALUES (1, 'Daniel'), (2, 'John Doe'), (3, 'Someone Else'); INSERT INTO `user_city_choices` (`user_id`, `city_id`) VALUES (1, 1), (2, 1), (3, 1), (1, 2), (2, 5), (3, 5); To get the popularity of each city: SELECT c.name, IF(u.user_id IS NULL, 0, COUNT(*)) AS count FROM cities AS c LEFT JOIN user_city_choices AS x ON x.city_id = c.city_id LEFT JOIN users AS u ON x.user_id = u.user_id GROUP BY c.city_id ORDER BY count DESC; Result: +--------------+-------+ | name | count | +--------------+-------+ | Foo | 3 | | Hello World | 2 | | Bar | 1 | | Baz | 0 | | Another city | 0 | +--------------+-------+ To get the things that Daniel chose: SELECT c.city_id, c.name FROM user_city_choices AS x INNER JOIN cities AS c ON x.city_id = c.city_id INNER JOIN users AS u ON x.user_id = u.user_id WHERE u.username = 'Daniel'; Result: +---------+------+ | city_id | name | +---------+------+ | 1 | Foo | | 2 | Bar | +---------+------+
-
http://php.net/manual http://www.phpfreaks.com/tutorials
-
What do you mean with coding in PHPUnit? PHPUnit is a unit testing framework. You don't "code in it". Moreover, do not bump your topics without providing additional information. If you don't get a response either a) nobody knows, or b) you didn't provide enough information. Simply bumping your topic won't fix neither a nor b. It's explained in this document which you were supposed to read before you even created an account here.
-
how to become a reseller of a "domain registrar"
Daniel0 replied to suyesh.amatya's topic in Miscellaneous
Didn't you just create that topic? http://www.phpfreaks.com/forums/index.php/topic,254057.0.html -
That depends how the plugin is supposed to work. Do you know the observer pattern?
-
Well, you definitely do not want to prepare the statement within the loop. Doing that you throw away the performance gains you would otherwise get. Also, mt_rand is faster than rand(). Also, it should be WHERE conditions should be separated by AND and not a comma.
-
Add foreign characters like è to a database?
Daniel0 replied to Punk Rock Geek's topic in PHP Coding Help
Because I believe you should store the raw data and format/filter it at the moment you need it and not before. -
Add foreign characters like è to a database?
Daniel0 replied to Punk Rock Geek's topic in PHP Coding Help
Well, in my opinion you shouldn't insert HTML escaped data into the database. If you're having trouble with IPB you should contact their support department. Especially considering you are actually paying them. -
Add foreign characters like è to a database?
Daniel0 replied to Punk Rock Geek's topic in PHP Coding Help
Well, you can set the MySQL connection to UTF-8 by running this query after connecting: SET NAMES utf8; You set it in the browser like this: header('Content-type: text/html; charset=utf-8'); And as described on htmlentities's manual page, you do something like this: htmlentities($string, ENT_COMPAT, 'UTF-8'); -
[SOLVED] How to calculate two dates into a percentage
Daniel0 replied to DirtySnipe's topic in PHP Coding Help
That doesn't make any sense. If you have 2009-05-27 and 2009-05-30 and you are "30% completed", what would that mean, and what data would you use to get to that number?