I have problems inserting a variable PHP $ _GET into my mysql table

This is a link that uses the $_GET method to pass category to a form

echo '<li><font class = "categories_list"><a href="postform.php?ct=' . $value[4] . '"</a>' . $value[0] . '</font></li>';

Once in the form I try to retrieve the $_GET variable and it echo's it correctly

if(isset($_GET['ct']))
{
echo $_GET['ct'];
$catname = $_GET['ct'];
}

Once I try to insert into my Mysql table it doesn't insert..

"INSERT INTO almt1(idnum, catname)
    VALUES ('$idnum', '$catname')";

When I do insert it goes in as an empty value


write your query like this

"INSERT INTO almt1(idnum, catname)
VALUES ($idnum, $catname)";

or,

"INSERT INTO almt1(idnum, catname)
VALUES ('".$idnum."', '".$catname."')";