I am running an insert statement from a PHP file and then I run some code to check if the insert worked. PHP tells me "success". But when I check my database to see if the record exists, it does not. Furthermore, when I run the sql statement directly in MySQL administrator, it works fine. I am quite certain that I am not inserting into the wrong database or table. Here is a cleaned up version of the code:
$sql = "INSERT INTO companies (name, source_id, source_site, seeking_cf, currency, i_target, equity_offered, money_raised, num_investors, raised_pct, descr, city, state, country, categories_id, logo) VALUES (\"XYZ Widgets\", \"31\", 22, 1, \"£\", 250000, 0, 0, 0, 0, \"(Business Plan\", \"London\", \"\", \"UK\", 0, \"http://www.website.com/xyz.jpg\")";
$rs = mysql_query($sql, $conn);
if(mysql_affected_rows($conn) == 0) {
$utoh = "fail";
} else {
$utoh = "success";
}
echo $utoh;
So the result says "Success" but the record is not in the db. PHP is version 5.3. MySQL is 5.5.