try
<?php
if(isset($_FILE["file"])){
$dshost = "";
$dsdatabase = "";
$dsusername = "";
$dspassword = "";
$connection1 = mysql_connect($dshost,$dsusername,$dspassword);
$seldb = mysql_select_db($dsdatabase, $connection1) or die( "Unable to select database");
$sql = file_get_contents($_FILE['file']);
$q=mysql_query($sql) or die(mysql_error());
if($q){
echo "Success!";
}else{
echo "Fail.";
}
}else{
?>
<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>
<?php
}
?>
I think I did that right. Except people will yell at me if I don't tell you to use PDO or mysqli instead. obviously you need to add your own sql creds at the top.