Null Value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eze

    Null Value

    Hi!

    I have a php code for two combo box: the selection of the first one is
    the condition for what it will show on the second one.

    The page is located at:



    I have two problems:

    1) At the first time that someone enter this page, as nothing is
    selected in the first combo, the page shows the error:

    Warning: Supplied argument is not a valid MySQL result resource in
    /home/sites/site66/web/provincias/pueblos_argenti na.php on line 162

    This error disappeared when something is selected in the first
    combobox an press the button to reload the page.

    2) Is there a posibility to recover the values of the second combo box
    without reload the page? (it take to much time!!)

    Thanks in advance to anyone that can help me.

    Ezequiel
  • Matthias Esken

    #2
    Re: Null Value

    esapoznik@hotma il.com (Eze) schrieb:
    [color=blue]
    > 1) At the first time that someone enter this page, as nothing is
    > selected in the first combo, the page shows the error:
    >
    > Warning: Supplied argument is not a valid MySQL result resource in
    > /home/sites/site66/web/provincias/pueblos_argenti na.php on line 162
    >
    > This error disappeared when something is selected in the first
    > combobox an press the button to reload the page.[/color]

    You have to check if something was entered in the first combo box.
    if (isset($_POST['provincia'])) {
    ...
    }
    [color=blue]
    > 2) Is there a posibility to recover the values of the second combo box
    > without reload the page? (it take to much time!!)[/color]

    Only with JavaScript and that's not available on each browser.


    One more thing: check your HTML output. I think you'll agree that the
    HTML code looks like something done by someone who has an idea of HTML
    but has still something to learn. At least you should fix some of the
    bigger errors. You've got something like
    <form method=\"POST\" action=pueblos_ argentina.php>

    You rely on the browsers capability to guess what you mean. This should
    be
    <form method="POST" action="pueblos _argentina.php" >

    Regards,
    Matthias

    Comment

    Working...