Array And Post In Php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dangutm
    New Member
    • Feb 2007
    • 4

    Array And Post In Php

    1.How can i save all my variable in ane array and post then once
    2.How can i call eg list of country from database and make it drop down menu
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    I am not sure about your #1 question.

    try this for #2

    [PHP]<?php
    require '../dbcon.php';//Database con string
    $query = "SELECT p_id FROM products";

    $result = mysql_query($qu ery) or die('Error, query failed');
    $count = mysql_num_rows( $result);
    if ($count > 0)
    {

    echo '<select name="item">';
    while($result_r ow = mysql_fetch_arr ay($result))
    {
    echo '<option value="'.$resul t_row[0].'" >';
    echo ($result_row[0]);
    echo '</option>';
    }
    echo '</select>';

    }
    else
    {
    echo "There are no project numbers in the system";
    }
    ?>[/PHP]

    Comment

    Working...