php - sql query don't pick the value -


i have simple sql insert query:

insert db_name (col1, col2, col3, ...)  values ('value1', (select name another_table id = :php_value), value3 .....) 

but col2 value null because select don't pick nothing (name exist) possible protect empty records? or need change script , keep select before insert (outside insert)? that's happen not regularly ~1/3000 records

i think problem condition id = :php_value query doesn't return data. can avoid insert row table empty name way:

insert db_name (col1, col2, col3, ...)  select 'value1', name, 'value3',...  another_table  id = :php_value 

Comments

Popular posts from this blog

php - Wordpress: Link a post to posts of another category manually -

delphi xe7 upload/download dropbox file using the rest client and show progress -

java - Get more than One value and display it -