INSERT value using SELECT in mysql
<p>I have 2 tables: users with columns (id,username, password), and user_failed with columns (user_id, failed, time). is there any possible way i can insert into table user_failed by only using username? i try this code but it failed:</p>

<pre><code>INSERT INTO `login_attempts`(`user_id`, `time`, `failed`) 
VALUES (SELECT user_id FROM users WHERE username = 'pokemon','',3)
</code></pre>