I am getting a syntax error for my MySQL query. The code of the whole script is below, and here is the query:
$query = "INSERT INTO videos (embed_html, description) VALUES $embedHTML,$videoDesc)";
Any ideas?
<?php
if($_POST){?>
<html>
<table>
<tr>
<td> <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"> Embed HTML:</td>
<td> <textarea rows="5" cols="50" wrap="virtual" name="embedHTML"> Enter Embed HTML Here </textarea></td>
</tr>
<tr>
<td>Description: </td>
<td><textarea rows="5" cols="50" wrap="physical" name="description"> Describe The Video Here </textarea></td>
</tr>
<tr>
<td><input type="submit" value="Add Video!"></form></td>
</tr>
</table>
</html>
<?php
} else {
if (isset($_POST['embedHTML'])||isset($_POST['description']))
{
require_once("dbConnect.php");
$embedHTML = trim(mysql_real_escape_string($_POST['embedHTML']));
$videoDesc = trim(mysql_real_escape_string($_POST['description']));
$query = "INSERT INTO videos VALUES ($embedHTML,$videoDesc)";
$result2=mysql_query($query) or die(mysql_error());
}
if($result2){
echo "video added to the DB!";}
elseif(empty($result2)){ echo "The Fields Are empty";}
}
?>