hi. need some help. am trying to add entries into my database, but when i run it, i get the following message:
"'You have not entered all the required details.Please go back and try again.".
I have included the code below.Could someone help me out and tell me what's wrong with it? thanks loads.
echo 'Error: Could not connect to database. Please try again later.';
$query = "insert into cd values
('".$category_id."', '".$cd_title."', '".$cd_artist."', '".$cd_price."', '".$cd_year."')";
$result = mysql_query($query);
echo mysql_affected_rows().' cd inserted into database.';
// NOTE: these have the p_ prefix because of the 'import_request_variable' section listed above
echo "<b><u> THESE HAVE A P_ PREFIX </u></b> <br>";
echo "$p_catagory_id <br>";
echo "$p_cd_title <br>";
echo "$p_cd_artist <br>";
echo "$p_cd_price <br>";
echo "$p_cd_year <br>";
This message is b'coz you are checking for the values of the variable that you pass from the first page (ie your form). Make sure that your passing the variable as post method or get method. If you use get method the you have to use like $HTTP_GET_VARS['varibale1']; or if post the $HTTP_POST_VARS['variable1'];