Results 1 to 14 of 14

Thread: function.. [RESOLVED]

Threaded View

  1. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    philippines
    Posts
    245

    Angry Re: function..

    ok... i have solved most of my problems now.. umm how can i add items to a list on my form using the records from my database? <- got this working.. but the problem is.. the results are shown on a diffrent page.. i am wondering how can i expose all results on the same page.. i will post the code..

    PHP Code:
    <html>
    <head>
    </body>
    <form>
      <p> 
        <select name="mGrid" id="mGrid">
          <option value="NONE">----- SELECT GRID -----</option>
          <option value="NORTH">NORTH</option>
          <option value="EAST">EAST</option>
          <option value="SOUTH">SOUTH</option>
          <option value="WEST">WEST</option>
        </select>
        <input type="button" name="Button" value="Button" onClick="show()"> ** how can i call show after clicking the button?? **
        <br>
        <br>
        <select name="select" size="10">
          <option>--------------- LIST OF BRANCHES ---------------</option>
        </select>
    </form>
    </html>
    <? function show(){
    $host = 'localhost'; 
    $user = 'root'; 
    $password = 'admin'; 
    $conn = mysql_connect($host, $user, $password) 
    or die ("Could Not Connect to DB"); 

    $mooo = '$mGrid';
    $sd = mysql_select_db("ifl-sales", $conn) 
    or die ("Could Not Select DB" . mysql_error()); 
    $tableaccess = "select branch_name from branch where grid = '$mooo'";
    $sb = mysql_query($tableaccess, $conn); 
    while ($row = mysql_fetch_array ($sb)) 
        { 
        echo("<option>");
        echo($row['branch_name']);
        }
    }
    ?>

    everytime ic click the button nothing happens..
    Last edited by titan7262; Sep 8th, 2005 at 04:45 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width