Umm, not too clear on what you want.
I'm guessing you're having trouble figuring out what the $songid is or the value that the user gives it.
Basically, you answered your own question. What you need to do is add another field to your form that is hidden that says:
<input type="hidden" name="songid" value="$songid">
Now, in your form, where you want the user to specify the sort order, you say:
<input type="text" name="sort">
Now, in your PHP script, you call the two/three variables you want, and create the query:
<?php
$songid = $_POST['songid'];
$order = $_POST['sort'];
$query = "UPDATE songs SET sortOrder = '$order' WHERE songid = '$songid'";
$result = @msyql_query($query);
if(!$result)
{
echo "Error!!";
}
else
{
echo "Updated!!";
}
?>
That's the basics. You can use a variable ($i) and increment it based on the number of rows you are able to update. Then loop through each. Something like:
<?php
$i = 1;
while ($row2 = mysql_fetch_array ($vresult))
{
$stitle = $row2['stitle'];
$songid = $row2['songid'];
echo"<td class=\"hotNames\">$stitle </td>
<td><input name=\"sort$i\" type=\"text\" id=\"$songid\" size=\"3\">
<input type=\"hidden\" name=\"songid$i\" value=\"$songid\"></td>
</tr>";
$i++;
}
echo "<input type=\"hidden\" name=\"max\" value=\"$i\">";
/*
Now we'll work with our code!!
*/
$max = $_POST['max'];
for($i=1; $i<=$max; $i++)
{
$songi = 'songid'.$i;
$sorti = 'sort'.$i;
$songid = $_POST["'".$songi."'"];
$order = $_POST["'".$sorti."'"];
$query = "UPDATE songs SET sortOrder = '$order' WHERE songid = '$songid'";
$result = @mysql_query($query);
if(!$result)
{
echo "Error!!";
}
else
{
echo "Updated!!";
}
}
?>
Hope that helps.
~Brett