php - MySQL - select in an insert -


this question has answer here:

i want insert ids 1 table along post variables of form.

insert tickets (name,text,betreff,priority,statusid,date,user_id) values     (         '".mysql_real_escape_string( $name )."',         '".mysql_real_escape_string( $text )."',         '".mysql_real_escape_string( $betreff )."',         '".mysql_real_escape_string( $priority )."',         '".mysql_real_escape_string( $statusid )."',         now() (select id login)     )"; 

that gets me error!

you have error in sql syntax; check manual corresponds mysql server version right syntax use near '(select id login))' @ line 10

any suggestions?

you missing where clause, selecting multiple ids single insert statement.

select id login <?> 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -