PHP Object Oriented and DB

Discussion in 'PHP' started by motti, Jul 2, 2008.

  1. #1
    Hello

    I'm new to PHP programming (most of the job that I need i just outsource), but now i want to learn it.

    If any one know Esyndicat and the program structure how does it used the php DB connection in obejct oriented.

    Let me explain:

    In this directory you can add new fields to a listing but the Listing class does not have any listing field properties like title, url it's like it generate all the information from the DB.

    I want to buld a script that have this kind of dynamic but I can't under the logic behind it.

    Most book just duplicate the DB table columes with class properties which make the application hard to extend with changing alot of code.

    Does this approach have a name ?
     
    motti, Jul 2, 2008 IP
  2. 2slick

    2slick Peon

    Messages:
    73
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you can edit any table in esyndicat using their class name esyndicat, this can be found on includes/classes folder.

    well, i just have only the free version.
     
    2slick, Jul 2, 2008 IP
  3. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Mysqli is the OO way of connecting to mysql in php eg:
    $sql = new mysqli(*connection details*);
    $qry = 'SELECT * FROM blah';
    $res = $sql->query($qry);
    while ($row = $res->fetch_object()) {
    //do something with the row, eg print $row->id;
    }
     
    matthewrobertbell, Jul 3, 2008 IP
  4. muf2002

    muf2002 Banned

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    look inside the classes folder and read the codes you will understand how it's done.
     
    muf2002, Jul 3, 2008 IP