Reputation: 1
I have two tables employee and time_stamp each employee has his hex and emp_id and i want to insert into time_stamp table the time the hex that will come from the time stamping machine and the emp_id from the employee table... this is my query ..
INSERT INTO time_stamp (hex,time,emp_id)
SELECT emp_id ({$hex}, NOW() )
FROM employee
WHERE hex = {$hex}
and thats what I get as an error:
FUNCTION junicom.emp_id does not exist
Upvotes: 0
Views: 55
Reputation: 33935
Just guessing...
INSERT INTO time_stamp (hex,time,emp_id)
SELECT hex, NOW(), emp_id
FROM employee
WHERE hex = '$hex'
Upvotes: 1