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
Post a Comment