Something is wrong with that code, i mean, it's not doing what i want it to.
<?php
$con = mysql_connect($db_s, $db_u, $db_p);
$db = mysql_select_db("saritur", $con);
$query = "SELECT resumo FROM resumos";
$res = mysql_query($query,$con);
echo "<select name='usuario' id='usuario'>";
while (($row = mysql_fetch_row($res)) != null)
{
echo "<option value = '".$row['resumo']."'>".$row['resumo']."</option>";
}
echo "</select>";
mysql_close($con);
?>
<select name="resumo" id="usuario">
<?php
$db_u = 'phiter';
$db_p = '****';
$db_s = '127.0.0.1';
$con = mysql_connect($db_s, $db_u, $db_p);
$db = mysql_select_db("saritur", $con);
$query = "SELECT * FROM resumos";
$res = mysql_query($query,$con);
while ($row = mysql_fetch_row($res))
{
echo "<option value = '{$row['resumo']}'>{$row['resumo']}</option>";
}
mysql_close($con);
?>
</select>
Notice: Undefined index: resumo in xxx on line 48
mysql_fetch_row
mysql_fetch_array
I'm going to have a gamble here that this is the only thing that is wrong...
while (($row = mysql_fetch_row($res)) != null)
change to
while (($row = mysql_fetch_assoc($res)))
Why? See the reference pages
http://php.net/manual/en/function.mysql-fetch-row.php
http://php.net/manual/en/function.mysql-fetch-assoc.php
mysql_fetch_row() returns a numerical array, whereas mysql_fetch_assoc returns a keyed array... which is how you're using it.
Alternatively you can keep using mysql_fetch_row() but then use $row[0] or reset($row) to access the first value.