Web Design Forum: Jock - Viewing Profile - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting

Jock's Profile User Rating: *****

Reputation: 246 Excellent
Group:
Members
Active Posts:
1,470 (1.98 per day)
Joined:
15-May 10
Profile Views:
8,593
Last Active:
User is online Yesterday, 06:27 PM
Currently:
Viewing Topic: Cristiano Ronaldo - Funny

My Information

Member Title:
like a boss
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Male Male
Location:
Scotland
Interests:
Olympic weightlifting, Rowing, Darts

Contact Information

E-mail:
Private
Website URL:
Website URL  http://jock.me.uk/

Latest Visitors

Posts I've Made

  1. In Topic: Local server

    24 May 2012 - 08:47 PM

    inb4 xamp

    Zend Server CE is the best in my opinion

    http://www.zend.com/...ucts/server-ce/
  2. In Topic: convert_tz returns null

    24 May 2012 - 05:33 PM

    Is the timezone table properly populated?

    SELECT COUNT(*) FROM mysql.time_zone;
    
  3. In Topic: Variables in a class - where and when to declare/set, and using in a function?

    22 May 2012 - 03:21 PM

    A 'variable' inside a class (called a class member variable) should have $'s otherwise PHP will probably assume they're constants. Next, the 'var' keyword is from PHP4 - get rid of it and start using public, private or protected to define the variable scope. Public can be accessed from anywhere, protected can only be accessed by a child or parent class, private can only be accessed from the class itself..

    class FacebookProfile
    {
        private $password = '$3cr3tPassw0rD';
    
        protected $birthday = '31/01/1990';
    
        public $name = 'Jock';
    
    }
    
    


    The PHP docs on class member visibility explain this pretty well - http://www.php.net/m....visibility.php

    Anyway onto your question: There is no standard way of defining variable values. Personally if I have default values, I will hard code them into the variable definition at the top of the class, rather than setting them within the constructor. When you need to access or edit a member variable, it's much better practice to use an Accessor/Mutator method, read more on this on wikipedia - http://en.wikipedia..../Mutator_method

    It might look like hard work but an IDE like netbeans will automatically write getters/setters for you automatically.
  4. In Topic: questions about ir35 in the UK

    12 May 2012 - 12:30 AM

    Contractor here.


    Ignore IR35, as jack said above you only need to worry about it if you set up as a LTD company and only have 1 main stream of income.

    It wont effect you if you set up as a sole trader (you can be a Sole Trader and Full Time PAYE employee). You just need to declare your earnings via self assessment, and they will calculate your deductions at your tax bracket 20/40/50% e.g if you're in 20% bracket...

    PAYE Pay 		£20,000.00
    + Sole Trader earnings	£5,000.00
    
    - Tax 		£3,505.00
    - NI 		£2,132.64
    
    = £19362.36
    
    


    Not bad vs the £15962.36 you would earn without the extra 5K freelance income. Your sole trader income is entitled to tax deductible expenses/loss too.
  5. In Topic: Show tables php syntax

    12 May 2012 - 12:07 AM

    I always thought the syntax was

    "SHOW TABLES FROM `database_name`;"


    Anyway, you just keep echoing the resource, you need to do something like...

    $result = mysql_query($sql);
    while($table =  mysql_fetch_row($result)) {
        echo $table[0];
    }
    
    

Friends

Showing 18 random friends of 18

Comments

Page 1 of 1
  1. Photo

    MikeChipshop 

    19 Oct 2011 - 19:33
    Jock old chum. How did you get rid of the 'area of expertise' etc under your avatar in posts?
  2. Photo

    kingy da killa 

    23 Sep 2011 - 08:09
    cheers for the info :)
    dam im under for my standards gr. Ill catch up soon lol
    proper on this gym thing!!!
  3. Photo

    kingy da killa 

    14 Sep 2011 - 14:50
    what do u push on weight bench?
  4. Photo

    rubots 

    15 May 2011 - 15:24
    5-1 what a way to win the title.
Page 1 of 1