here is the query that errors
mysql_select_db("behavioral_logistics",$db) or die("cant change");
$date_query = "SELECT name_date_id FROM client_db_doctor_client WHERE client_db_doctor_client_id LIKE'%$client_id_doctor_client' AND client_date_doctor_client LIKE'%$for_date'";
$date_success = mysql_query($date_query, $db);
$after_date_success = mysql_result($date_success, 'name_date_id');
and here is the entire if statement with query and function to solve the variables of the failing query
if($client_id_info){
$mytime = TIME();
$for_date = DATE("Y,m,d,H,i",$mytime);
mysql_select_db("behavioral_logistics",$db) or die("cant change");
$query_pre="INSERT INTO client_db_doctor_client (name_date_id, first_name, mid_init, last_name, client_db_doctor_client_id, client_date_doctor_client) VALUES ('', '".$first_name."', '".$mid_init."', '".$last_name."', '".$client_id_info."', '".$for_date."')";
mysql_query($query_pre, $db);
mysql_select_db("behavioral_logistics",$db) or die("cant change");
$result_access = mysql_query("SELECT client_db_doctor_client_id FROM client_db_doctor_client WHERE first_name LIKE'%$first_name' AND last_name LIKE'%$last_name'", $db);
$pre_success = mysql_result($result_access, 'client_db_doctor_client_id');
$client_id_doctor_client = $pre_success;
mysql_select_db("behavioral_logistics",$db) or die("cant change");
$date_query = "SELECT name_date_id FROM client_db_doctor_client WHERE client_db_doctor_client_id LIKE'%$client_id_doctor_client' AND client_date_doctor_client LIKE'%$for_date'";
$date_success = mysql_query($date_query, $db);
$after_date_success = mysql_result($date_success, 'name_date_id');
mysql_select_db("behavioral_logistics",$db) or die("cant change");
$query="UPDATE client_db_doctor_client SET consumer_progress ='$field_name', consumer_med_purpose ='$med_purpose', consumer_lab_results_notes ='$lab_results_notes', consumer_med_compliance ='$med_compliance', consumer_lab_summary ='$lab_summary', consumer_general_behavior ='$general_behavior', consumer_motor_skills ='$motor_skills', consumer_appearance ='$appearance' WHERE name_date_id ='$after_date_success'";
$success = mysql_query($query,$db);
if($success){
echo "Your data has been entered.";
//mysql_select_db("behavioral_logistics",$db) or die("cant change");
//$result = mysql_query("SELECT client_id FROM client_db_info WHERE client_first_name LIKE'%$first_name' AND client_last_name LIKE'%$last_name'", $db);
// $result_row = mysql_result($result, 'client_id');
//$client_id_result = $result_row['client_id'];
// echo "your clients ID is" . $result_row;
// $_SESSION['result_row'] = $result_row;
}
else echo "problem saving data";
}
i get a final echo that the data has been entered
i don't know what the problem is ???? with the code my code looks perfect.