Q:

My MySQL query doesn't work, nothing goes to the database

I am trying to put a single article to the database, but fail:
$con = mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("easy_db",$con);
mysql_query("INSERT INTO easy_db.article (Title, Article, Topics, author) VALUES($title, $data, $topic, $author)");

mysql_close();

I checked the spelling and printed all the variables ($title, $data, $topic, $author), that I got from the post-http..
Nothing is being inserted to the database with that statement. Why?
UPDATED
I have got an error in this one too:
= mysql_query("SELECT page FROM `easy_db`.`article` ORDER BY article_id DESC LIMIT 1")  or die(mysql_error());

A:

Use an error checking statement after your query, so you know what's going wrong. Also, beware of SQL INJECTION, and put single quotes around your values:
 $con=mysql_connect("localhost","root","") or trigger_error(mysql_error());
    mysql_select_db("easy_db",$con);
    $title = mysql_real_escape_string($title);
    $article = mysql_real_escape_String($article);
    $topic = mysql_real_escape_string($topic);
    $author = mysql_real_escape_string($author);
    mysql_query("INSERT INTO easy_db.article (Title, Article, Topics, author)
                 VALUES('".$title."', '".$data."', '".$topic."', '".$author."')") 
                 or die ('Error: '.mysql_error());

   // mysql_close();  this is not necessary, though

