Código:
insert into messages (message_title, message_body, message_date, id_user_from, id_user_to) values ('Titulo', 'Mensaje', now(), 1, (SELECT user_id FROM users WHERE username = 'usuario' ) )
pero me da el siguiente error :(
Código:
Error Code : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT user_id FROM users WHERE username = 'usuario' ) )' at li (0 ms taken)