syntax - printing a mysql query -
i prepared statement:
set @table_name = 'w13lat'; set @sql_text = concat('drop table if exists ',@table_name); set @sql_text2 = concat('create table ', @table_name, ' (`student_id_number` int(9) unsigned not null) engine=myisam default charset=latin1 '); prepare stmt @sql_text; prepare stmt2 @sql_text2; execute stmt; execute stmt2; the problem doesn't create table. i'd debug printing out mysql query generated prepared statements. possible right mysql command line? example, i'd remove execute stmt; , execute stmt2; , replace them echo stmt; or print stmt; or whatever command see actual statement generated. also, if see error made why didn't create table, please let me know! thanks!
you're right...it work. there's tiny little button @ bottom of sequel pro says 'refresh table list' :/
and select @sql_text statement. worked well.
Comments
Post a Comment