I am attempting to put a value into a Mysql database using php. I am only at the earliest stages, to ensure it works before applying it to my project. I have looked at different ways to implement through other people's questions, and I am not sure why this isn't inserting the value.
Am I supposed to assign a particular row to insert it to? Right now, I am simply trying to insert the value of 3 into the Yield column of the database. I have checked to ensure proper capitalization of the first letter in the column name, and proper name of database table being cost_table.
When I run this, I get the printed statement, "failed to insert.." When I check the database, it is still entirely null.
<?php
//variables as connection info...//
$LinkID=mysql_connect("$host","$username","$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql = "INSERT INTO cost_table('Yield') VALUES 3";
$check=mysql_query($sql,$LinkID);
if (!$check){
die ("failed to insert..");
}
echo "Insert Successful!";
?>