php - Cannot Select table where Timestamp = GET -
i confused here, how can select table schedule_date_time = $_get['date_time'];
<?php require 'core/init.php'; $schedule_id = $_get['id']; $schedule_date_time = $_get['date_time']; $session_id = $_get['session']; $user_id = $_get['user']; $user_email = $_get['email']; $user_name = $_get['username']; $registry_id = $_get['registry']; $check1 = db::getinstance()->query("select * chat_schedule schedule_date_time = $schedule_date_time"); if ($check1->count()) { $insert = db::getinstance()->insert('chat_booked', array( 'schedule_id' => $schedule_id, 'schedule_date_time' => $schedule_date_time, 'session_id' => $session_id, 'user_id' => $user_id, 'user_email' => $user_email, 'user_name' => $user_name, 'registry_id' => $registry_id )); if ($insert = true) { echo "insert successful"; } } else { echo "no match found, insert failed!"; } do need parse date or something. can not figure out :(
change $schedule_date_time to '$schedule_date_time' like:
"select * chat_schedule schedule_date_time = '$schedule_date_time' "
Comments
Post a Comment