Hi, I'm trying to update my database with the string that is selected
by the user but am not sure how to do so?  Thank you.

Here is my call in html.

<td name='search' id='search' value='' ></td>
<div id='autocomplete_choices' class='autocomplete'></div>

  <input type="hidden" id="artist_id" name="artist_id" value=""/>
                                 <script type='text/javascript' 
language='javascript'
charset='utf-8'>
                                 // <![CDATA[
                                          new 
Ajax.Autocompleter('search','autocomplete_choices','ajax-
autocompletion/server.php',{minChars: 3,afterUpdateElement :
getSelectedId});
                                // ]]>

                                function getSelectedId(text, li) {
                                        $('artist_id').value=li.id;
                                }
                                </script>

The PHP code from wiseguys

        $sql = "SELECT UNIQUE_CUST_ID FROM MyDB WHERE UNIQUE_CUST_ID
LIKE
'%" . $_POST['search'] . "%'";
        $rs = mysql_query($sql);
?>

<ul>

<? while($data = mysql_fetch_assoc($rs)) { ?>
  <li><? echo stripslashes($data['UNIQUE_CUST_ID']);?></li>
<? } ?>
</ul>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to