<form method="post">
<html>
<head><title>ewan</title></head>
<body>
<?php
//create variable name
$id2=$HTTP_GET_VARS['id'];
//show the id
echo "<p>lalabas kaya ang id? : $id2</p>";
?>
<br><p><input type="text" maxlength="60" name="query"></p><br>
<input type="submit" value="submit">
<?php
//create variable names 2
$query=$_POST['query'];
//connect to mysql
$a=mysql_pconnect('localhost','root','96051152');
if (!$a)
{
echo "<p>Could not connect to mysql server. Please try again later.</p>";
exit;
}
//select db
mysql_select_db('toby');
$query="insert into query values
('".$id2."','".$query."')";
$results=mysql_query($query);
$num_results=mysql_num_rows($results);
echo "<p>$num_results</p>";
?>
</body>
</html>
but the thing when i look into the table "query" there are two values entered for "$id". i checked and i can see that the first instance of loading for $id2 gets inserted into the database when the page is loaded. can you tell me the problem in the code please?