Jump to content

Koobi

Staff Alumni
  • Posts

    419
  • Joined

  • Last visited

    Never

About Koobi

  • Birthday 10/06/1981

Contact Methods

  • Website URL
    http://www.flingbits.com/

Profile Information

  • Gender
    Male
  • Location
    Colombo, Sri Lanka | South Asia

Koobi's Achievements

Member

Member (2/5)

0

Reputation

  1. I'm looking at the ZCE PHP 5.3 exam. I'm pretty much convinced to do it now. I guess I should give you some background info. I want to eventually apply for a job abroad and having an extra certification always gives you an edge, I guess.
  2. In terms of being appealing to a potential employer, would you say that getting your RHCE (Red Hat Certified Expert) and/or Zend certification is a good idea? I have over 7 years of working experience as a developer but I have no bachelors degree (only an associates) so, what do you think? I am getting my CCNA within the next 30 days. I may consider CCNP as well. Feel free to suggest any other certifications as well.
  3. String replacement functions are ideal when you know exactly what you want to replace. If you are unsure about exactly what you want to replace but you have a vague idea of where the data you want to replace will appear, you could use pattern matching. Pattern matching in PHP is done using Regular Expressions. I am assuming you will always want to replace anything that appears within the quotes of the href attribute with your own text. If so, this will work: <?php $subject = "<a class=\"scorelink\" target=\"match_details\" onclick=\"window.open('','match_details','width=400,height=188,menubar=no,status=no,location=no,toolbar=no,scrollbars=no,resizable=yes')\" href=\"/default.dll/game?comp=cl_group_A&game=357186\">"; $replaced = preg_replace('/href=(["\'])[^\1]+\1/i', '', $subject); echo htmlspecialchars($subject); echo '<hr />'; echo htmlspecialchars($replaced);
  4. It's definitely one of my favourite shows of all time!
  5. Oh wow, that's excellent Never thought of it that way. This works fine: SELECT `users`.`id` AS `uid`, `users`.`name_first`, `users`.`name_last`, `cinemas`.`id` AS `cid`, `cinemas`.`title` FROM `cinemas` LEFT JOIN `users_cinemas`ON`users_cinemas`.`cinema_id`=`cinemas`.`id` LEFT JOIN `users`ON `users`.`id`=`users_cinemas`.`user_id` WHERE `users`.`id`=1 Do you see any potential bugs? Btw, any tips on naming conventions for a database? As in, naming conventions for field names, table names, join tables, primary keys, foreign keys, etc?
  6. I think you guys misunderstood what I was saying. Or maybe I just didn't explain completely in my last post. I am running on a custom compile of 5.3 too but the thing is, I'm building a framework for people to download and use. So if Joe Schmo wants to download my framework and use it on his server and he has no control over the PHP version on his server, he won't use my framework. I'm hoping to complete the framework by March. I'm just wondering if it's a realistic goal to build for 5.3 in case 5.3 is not widely supported by then. On average, how long does it take for hosts to upgrade to a release? 6 months? 1 year? Any ideas guys? I've been out of the loop for a while :/
  7. I got my first PC around 1999. Before that I used to mess around with Pascal/QBASIC/C/C++ at the school computer lab on my own. Funny thing is I have never, in my life, taken computing as a subject haha but it seemed so appealing. Anyway, after the PC in 99, I used to use the net a lot and I really got into design, almost sat for the Adobe Certified Expert test because I was so into it. Then I wanted to turn the designs into HTML so I started mucking about with HTML. Of course, that led me to CSS. I eventually got sick of CSS because it's so browser depedant and I wanted something dynamic so I got into JavaScript for a bit. Again, JavaScript was browser dependant and that really annoyed me so around 2002-2003, I thought I'd give PHP a shot since it seemed so easy to get started with and the syntax was somewhat similar to C. I finally settled with PHP because unlike client side languages, it behaves as expected on almost any environment. I also liked the fact that I could quickly implement ideas in PHP because it's such a light language. Really easy to build working prototypes. I started freelancing with PHP around 2005 and loved it. Took a small break from all scripting for about two years, beginning around 2007 to sort out some personal matters. I started messing with Ruby On Rails about 1.5 years ago just for fun. Mostly experimenting with things. I love their philosophy and the Ruby language is pretty awesome IMO. So I'm in between PHP and Rails at the moment. Wow...long post
  8. Oh I'm on a rackspace cloud so I can install any version I want But I'm creating a framework and I can't decide on making the minimum requirements PHP 5.2 or 5.3 I would love to go with 5.3 simply because there's so much more you can do with it...but if there's going to be little support, what's the point :/ I'll bet Debian will take about a year to get 5.3 :/
  9. I love some of the new things that PHP 5.3 brings with it. The problem is, it's quite new (6 months old?) I was wondering, how long do you guys think it would be before most reputed web hosts out there would start using PHP 5.3 as opposed to 5.2? I hope they begin supporting 5.3 before March 2010 at least!
  10. hmmm...So the idea is to start with the joining table and use left joins on that to connect to the others? I should re-learn my SQL joins. Can you recommend a good resource? In the meantime, using this query, on what basis would I order it to get the results I want?
  11. How are left joins done accross 3 tables in MySQL?
  12. Oops. Yeah, my mistake. I would change that to: SELECT * FROM `users`, `cinemas`, `users_cinemas` WHERE `users`.`id`=`users_cinemas`.`user_id` AND `cinemas`.`id`=`users_cinemas`.`cinema_id` But how do I make sure my data is ordered the way I want it?
  13. Actually, I was hoping you could tell me the best way to do that too. I've forgotten a lot of my SQL during my hiatus and I used to mostly use ORM's anyway so I never really used raw SQL but I want to get back into it. Right now, I would do it like this: SELECT * FROM `users`, `cinemas`, `users_cinemas` WHERE `users`.`id`=`users_cinemas`.`user_id` AND `cinemas`.`id`=`users_cinemas`.`cinema_id` AND `users`.`id`=1;
  14. $ mysql -V mysql Ver 14.12 Distrib 5.0.75, for debian-linux-gnu (i486) using readline 5.2 SQL is not one of my forte's, unfortunately, so I need your help with this Let me first show you the tables involved. mysql> show tables; +----------------------+ | Tables_in_issue_sort | +----------------------+ | cinemas | | users | | users_cinemas | +----------------------+ 3 rows in set (0.00 sec) mysql> describe cinemas; +-------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+----------------+ | id | smallint(6) | NO | PRI | NULL | auto_increment | | title | varchar(25) | NO | UNI | NULL | | +-------+-------------+------+-----+---------+----------------+ 2 rows in set (0.00 sec) mysql> describe users; +------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+-------------+------+-----+---------+----------------+ | id | smallint(6) | NO | PRI | NULL | auto_increment | | name_first | varchar(15) | NO | | NULL | | | name_last | varchar(15) | NO | | NULL | | +------------+-------------+------+-----+---------+----------------+ 3 rows in set (0.00 sec) mysql> describe users_cinemas; +-----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+-------------+------+-----+---------+-------+ | user_id | smallint(6) | NO | | NULL | | | cinema_id | smallint(6) | NO | | NULL | | +-----------+-------------+------+-----+---------+-------+ 2 rows in set (0.01 sec) As you can see, `users_cinemas` is a join table. I have to display a form where the Users details can be edited. This form would have a bunch of checkboxes of the Cinemas that can be assigned to the User. The checkboxes of Cinemas must be displayed in a particular order. The order is, the Cinemas which are assigned to the User being edited must appear first. How would I do this? Thanks for reading. :EDIT: I've included the SHOW CREATE TABLE output as well: mysql> show create table cinemas; +---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | cinemas | CREATE TABLE `cinemas` ( `id` smallint(6) NOT NULL auto_increment, `title` varchar(25) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `title` (`title`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 | +---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.01 sec) mysql> show create table users; +-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | users | CREATE TABLE `users` ( `id` smallint(6) NOT NULL auto_increment, `name_first` varchar(15) NOT NULL, `name_last` varchar(15) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 | +-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) mysql> show create table users_cinemas; +---------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | users_cinemas | CREATE TABLE `users_cinemas` ( `user_id` smallint(6) NOT NULL, `cinema_id` smallint(6) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.01 sec)
  15. wow. i'd say almost everything i feel so restricted when i get on my dad's Windows PC. Windows comes packaged a certain way and there's very little you can change in comparison to Linux. In Linux, you can take the entire OS apart if you really want to. In Windows, I can maybe customize my theme, mess with the registry a little and little things like that. luckily i'm not so fond of computer games so i don't need Windows i do a lot of audio production and so i have a MIDI controller. i can even hook that up via USB on Ubuntu and use audio software like RoseGarden and do all my production work. my dad uses Avast on his PC...i hope that's a good one because he really doesn't know what he's doing on the computer, half the time haha
×
×
  • 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.