<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Semplice problema post da multiple select]]></title><description><![CDATA[<p dir="auto">Buonasera a tutti,<br />
ho un semplice select multiplo in un form:</p>
<pre><code class="language-html">&lt;select multiple="multiple" id="nome"&gt;
</code></pre>
<p dir="auto">con un js che mi prende i dati</p>
<pre><code>function addRecord()
{
    var term_nome = $('#nome').val();        //Storing the value of textbox into a variable
    
    if(term_nome == '')                        //Checking for NULL
    {
        $('#propspectDiv').html('Inserire i dati obbligatori');    //Prints the progress text into our Progress DIV
        return;
    }
    else{
        $('#propspectDiv').removeClass('error');                                     //Removing the error class from the progress DIV
        $('#propspectDiv').html('Attendere prego...&lt;br&gt;&lt;img src="ajax.gif" /&gt;');    //Prints the progress text into our Progress DIV
        
        $.ajax({
                url : 'data.php',                     //Declaration of file, in which we will send the data
                data:{
                    "nome" : term_nome,                //we are passing the nome value in URL
                },
                success : function(data){
                    window.setTimeout(function(){
                        $('#propspectDiv').html('Grazie, la missione è stata registrata'); //Prints the progress text into our Progress DIV
                        $('#data').css("display","block");  //Changes the style of table from display:none to display:block
                        $('#data').html(data);                //Prints the data into the table
                    }, 1500);
                }
            });
    }
}
</code></pre>
<p dir="auto">e un php che mi salva su db mysql</p>
<pre><code class="language-php">&lt;?php
$nome = $_REQUEST['nome'];

$con = mysql_connect("localhost","root","");

mysql_select_db("missioni", $con);

$sql = 'INSERT INTO `data` (`ID`, `nome`) VALUES (NULL,"'.$nome.'")';

if (!mysql_query($sql,$con))
  {
  die('Errore: ' . mysql_error());
  }
  else{
    $sqlnew = 'SELECT * from missioni ORDER BY ID desc LIMIT 1;';
    $res = mysql_query($sqlnew);
    while($row = mysql_fetch_array($res))
    {
        echo '

        &lt;p class="lead text-success"&gt;'.$row['nome'].'&lt;/p&gt;

        ';
    }
  }

mysql_close($con);
?&gt;
</code></pre>
<p dir="auto">Il problema è che dal select multiplo il dato che mi salva è "array".<br />
come bisogna fare per impostare il salvataggio dei valori impostati, casomai separati da virgola ?<br />
grazie</p>
<p dir="auto">MP</p>
]]></description><link>https://dev.connect.gt/topic/190632/semplice-problema-post-da-multiple-select</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 16:52:38 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/190632.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Jun 2013 19:45:52 GMT</pubDate><ttl>60</ttl></channel></rss>