There are a few things that can be done to improve your script. Since your question is so broad I will point a few of them out..
First..
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
Can be shortened to simply
$con = mysql_connect("localhost","root","") or die('Could not connect: ' . mysql_error());
Second, you forgot to add the resource parameter in your mysql_query(). Though this parameter is optional, by the way you've got your variable names ($sql15) I assume you may have multiple connections.
$result5=mysql_query($sql5, $con);
Also, I am not sure what you're doing here..
$sql5 = ("SELECT dept from `user_pwd` WHERE name = '$myusername'");
your syntax may be perfectly valid for all I know, but I've never seen a string defined like this before and a quick Google search didn't show me anything.. so you may want to change that to just..
$sql5 = "SELECT dept from `user_pwd` WHERE name = '$myusername'";
Next, you close your connection before you call your data. You might want to move the mysql_close() down to a line that is AFTER $myvars3 = 'department='.$row5['dept'];
Oh, and you're using mysql_fetch_array() and then referring to it as an associative array ($row5['dept']). To be safe, either change $row5=mysql_fetch_array($result5); to $row5=mysql_fetch_assoc($result5); or add the associative array result type like so.. $row5=mysql_fetch_array($result5, MYSQL_ASSOC);
And finally we'll address the uploading of your data..
I don't know how you've got it worked out but you're basically taking a webpage and breaking it into an array everwhere there is a comma and trying to upload the array into a table. Unless you know EXACTLY how many commas appear on that page and you know that the number matches the number of columns in your table this is a really awful idea. I don't know what you're trying to accomplish but I assure you, there is a better way.
And to answer you actual question.. the SQL syntax to insert a row is "INSERT INTO table (column1, column2) VALUES ('value1', 'value2')";
FINAL NOTE.. You're using an old API, switch to PDO. SEE BIG RED WARNING here
So, to put it all together...
session_start(); // NEVER forget this!
$con = mysql_connect("localhost","root","") or die('Could not connect: ' . mysql_error());
mysql_select_db("webauth", $con);
$myusername = $_SESSION['myusername'];
//$result = mysql_query("SELECT * FROM user_pwd");
$sql5 = "SELECT dept from `user_pwd` WHERE name = '$myusername'";
$result5=mysql_query($sql5, $con);
$row5=mysql_fetch_assoc($result5);
// echo "<br />";
$url3 = 'http://localhost:1090/WebEmpLoad.hal';
$myvars3 = 'department='.$row5['dept'];
mysql_close($con);
$ch3 = curl_init( $url3 );
curl_setopt( $ch3, CURLOPT_POST, 1);
curl_setopt( $ch3, CURLOPT_POSTFIELDS, $myvars3);
curl_setopt( $ch3, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch3, CURLOPT_HEADER, 0);
curl_setopt( $ch3, CURLOPT_RETURNTRANSFER, 1);
$response3 = curl_exec( $ch3 );
//echo $response3;
$arr = (explode(',',$response3,100));
$Num = sizeof($arr);
$rows = ($Num - 1)/2;
echo $rows;