Announcement

Collapse
No announcement yet.

Looking for some PHP help.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Looking for some PHP help.

    Im working on my website currently and pretty new to php and js.. mostly a .NET person myself.

    What im curious of is i got something similar to here on EQTC where i have a table setout and a button next to it, and i want when the button is pressed it will create a subtable under it with addition info from my db.

    IF anyone can help that be great.
    Last edited by Britneyy; 12-01-2004, 11:18 PM.

  • #2
    If you want it to do it without opening a new page, you have to add javascript (or VBscript) a different language alltogether.

    If you open a new page, it is all in how you deal with the form data. I personally have a "controlling" page, that then has a switch statment to handle the button being pressed (or If statement if you only have one posible button) and include (the actual include command) other pages that do the work of what that button wants.
    PHP Code:
    switch ($Submit) {
            case "Search":
                    include ("item_edit_search.php");
                    include ("item_edit_list.php");
                    break;
            case "Edit":
                    $db = new mysql($MAINDB);
                    if (!$result=$db->query('xxxxx','*',"WHERE item_id = $item_id")) {
                        print "There is no such item: $item";
                        break;
                    } else {
                        $data = mysql_fetch_array($result, MYSQL_ASSOC);
                    }
                    include ("item_form.php");
                    break;
            case "Make Changes":
                    include ("item_edit_submit.php");
                    include ("item_edit_search.php");
                    break;
            default:
                    include ("item_edit_search.php");
    } 
    
    Ngreth Thergn

    Ngreth nice Ogre. Ngreth not eat you. Well.... Ngreth not eat you if you still wiggle!
    Grandmaster Smith 250
    Master Tailor 200
    Ogres not dumb - we not lose entire city to froggies

    Comment

    Working...
    X