1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Sending Query Result to Excel

Discussion in 'PHP' started by coool, Aug 11, 2007.

  1. coool

    coool New Member

    Joined:
    Jul 12, 2007
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    0
    Hi guys,

    How can I send query result to EXCEL in PHP pages?

    is there such a function in PHP ? any code example !
     
  2. coool

    coool New Member

    Joined:
    Jul 12, 2007
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    0
    page.php
    HTML:
    
    <?php
    $items = "item1,item3";
    ?>
    
    <a href="form.php?selectedItems=<?=$items?>" >View Form<a/>
    
    

    form.php
    HTML:
    <form name="selectionform" method="post" action="">
    
                  <select  size="3" multiple name="selectedItems[]">
                    <option value="item1">Item1</option>
                    <option value="item2">Item2</option>
                    <option value="item3">Item3</option>
                  </select>
    
                  <input type="submit" value="View Result">
    </form>
    
    What I'm looking for is when user click "View Form" link, they get the for filled with items - i.e some items are alreay selected ---- then if the user want to deselect one of the items or select more items he should able to do that.. !

    to check the result: - in form.php
    PHP:
    if($_POST)
        echo 
    implode($_POST['selectedItems'],",");
    so what do you think ? having $_GET inside form.php will solve the problem ! .. but I've tried it and it doesn't work.. I didn't know how to handle the array and nothing selected !! .. can you take my sample code and add to it the proper things so it will work ! please
     
  3. coool

    coool New Member

    Joined:
    Jul 12, 2007
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    0
    oh the above reply was posted in the wrong thread..

    didn't see an icon to edit it or deleted it .. sorry for that.. :)
     

Share This Page