Im trying to update information into mysql by deleting the previous row then re-inputing my own data from a form. but im getting these errors:
Error:
Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in /home/a6620699/public_html/postv.php on line 29
Warning: mysql_query(): 8 is not a valid MySQL-Link resource in /home/a6620699/public_html/postv.php on line 42
Code:
$con = mysql_connect("mysql2.000webhost.com","a6620699_oils","******");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("a6620699_oils", $con);
mysqli_query($con,"DELETE FROM Input WHERE id='1'");
$sql="INSERT INTO Imput (id, Imput) VALUES('1','$_POST[Vlink]')";
mysql_close($con);
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "<br><br><br><br><br><center><h1>1 record added</h1></center>";
mysql_close($con)
.
<form action="postv.php" method="post">
Video Link: <input type="text" name="VLink" class="span12" /><br><br>
<input class="btn btn-large pull-right margin-top-15" type="submit" />
<input class="btn btn-small pull-left margin-top-15" type="reset" />
</form>