I have a very simple insert into the database.
I have verified conectivity, and when I enter the outputted insert statement straight into the db, all works fine.
When run on the site, I receive no MySQL error, but nothing is inserted into the database.
Table description and code are listed below.
Please help?
Thanks,
-=Lazzerous=-
<?
// $q is the search query submitted by the user
$add_phrase = "insert into search_tracker set term='$q', term_count='1'";
echo $add_phrase . "<br><br>\n";
if (!mysql_query($add_phrase))
{
$update_phrase = "update search_tracker set term_count = term_count + 1 where term='$q'";
echo $update_phrase . "<br><br>\n";
if (!mysql_query($update_phrase))
{
echo "Search Term Tracking Failed!<br>\n";
}
}
?>
mysql> desc search_tracker;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| term | varchar(50) | YES | MUL | NULL | |
| term_count | int(11) | | | 0 | |
+------------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)