Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Zane

  1. yeah your right, he can do that

    but look at his keys for POST
    $variable1 = $_POST['variable1'];
    $variable2 = $_POST['variable2'];
    $variable3 = $_POST['variable3'];

    they're just the same as the name of the variables he wants
    so he'd be just as well off using extract.

    I don't know why you don't just use the POST vars themselves, directly

    $variabel1 = $_POST['variable1'];
    echo $variable1;

    Does the same thing as

    echo $_POST['variable1'];

    nothing really different at all.
  2. you can't grab the scope of another function with global

    global is meant to extend the scope of variables outside all function and classes


    I don't exactly know what your question is but I can tell you you're not going to be able to grab val1 and val1 from Variable() by asking for globals in Bar()

    take a gander at this page and research globals
    http://us3.php.net/global
  3. Another way of thinking of is....like a till for a register
    Like at grocery store, everyone has their own till/register drawer
    and each person's drawer begins with a set amount of bills.

    You could call that the Till Class
    It has 100 dollars
    -10 Ones
    - 10 Fives
    - 2 Tens
    - 2 Twenties

    When the shift starts there are probably 5 employees that get a new till
    so

    $beth = new Till;
    $john = new Till;
    $henry = new Till
    $zane = new Till;
    $bob = new Till;

    5 new instances of a Till
    and with each Till you can...... takeFiveDollars()
    or takeTenDollars()

    $beth->takeTenDollars();
    $zane->takeTenDollars();
    $zane->takeOneDollar();
    $zane->takeTwentyDollars();
    $john->giveFiveDollars();

    eventually each person's set amount of bills will change
    and that is the theory behind objects and classes.....all the employees are objects of Till
  4. $xtpl is an object of something you have declared earlier in the code.....or even in an  included file

    somewhere, either above this snippet or in an included file you have said something along the lines of
    $xtpl = new Something;

    and then in the snippet you're making a variable out of the return of a function from that class
    $myvar = $xtpl->resultofmyfunction("pudding");

    meaning somewhere in the Something class
    you have a function named resultofmyfunction
  5. [quote author=Kano link=topic=114272.msg464894#msg464894 date=1163000588]
    does <? work the same as <?php
    [/quote]

    yes, as long as you have short_tags turned on

    the only real difference is that you can do echo statements on the fly with short tags

    for instance
    <?="stuff" ?>
    is the equivalent of
    <?php echo 'stuff" ?>
  6. This is backwards
    mysql_fetch_array($standings_query) = $table_rows

    it should be

    $table_rows = mysql_fetch_array($standings_query)

    Furthermore, you need to call it $table_row instead so it will work.
    seeing as how you're calling $table_row[points] and such

    also the word points need to be in quotes
    same for name too

    i.e.
    $table_row['points']
  7. [quote]I want to select all the records from courses that don't exist in course_users BUT only where 'user_id' is equal to a seesion var used to id them.[/quote]
    [code]
    SELECT courses.course_id FROM courses INNER JOIN course_users ON courses.course_id != course_users.course_id WHERE user_id = "whatever"
    [/code]

    give that a try...
  8. What's this supposed to accomplish btw..
    What's the goal output

    Are you just wanting a list the directory for Glen or for every user

    What I'm getting at is you could probably do better with a JOIN
    SELECT weddings.directory FROM weddings INNER JOIN profiles.user_id ON weddings.user_id = profiles.user_id GROUP BY weddings.user_id;

    i don't have anything to test that with so I can't guarentee that'll work
×
×
  • 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.