当前位置: 动力学知识库 > 问答 > 编程问答 >

mysql - Export Database's Table from button Laravel 5.3 into .sql files

问题描述:

i had already try this code in my Model :

 $file = storage_path('table.sql');

DB::statement("SELECT * INTO OUTFILE '".addslashes($file)."' FROM table_name");

but if i opened table.sql in my text editor, i got this :

41 9 Not Present Not Present Not Present 2016-05-09 18:45:56 \N

42 5 Come \N \N 2016-11-09 18:46:21 \N

43 25 Come Go Home \N 2016-11-09 18:46:29 19:24:33

47 25 Late Go Home \N 2016-11-10 08:43:21 08:46:19

48 26 Late \N \N 2016-12-01 08:46:28 \N

66 5 Late \N \N 2017-01-01 19:23:57 \N

67 1 Late Go Home \N 2017-02-03 15:23:32 15:46:29

68 3 Late Go Home \N 2017-02-14 07:14:07 07:16:56

69 5 Late \N \N 2017-02-14 07:48:47 \N

70 6 Late Go Home \N 2017-02-14 08:04:25 08:10:12

71 7 Late \N \N 2017-02-14 08:19:31 \N

72 8 Late \N \N 2017-02-20 07:44:22 \N

73 10 Late \N \N 2017-02-20 07:54:54 \N

74 5 Late \N \N 2017-02-20 07:56:44 \N

75 3 Late \N \N 2017-02-20 07:57:01 \N

76 2 Late \N \N 2017-02-20 08:07:24 \N

77 1 Late Go Home \N 2017-02-20 08:08:30 08:19:25

78 24 Late Go Home \N 2017-02-20 08:20:43 08:27:47

79 22 Late \N \N 2017-02-20 08:28:31 \N

80 21 Late Go Home \N 2017-02-20 08:29:13 08:30:23

81 18 Late Go Home \N 2017-02-20 08:32:12 08:32:50

82 17 Late Go Home \N 2017-02-20 08:34:21 09:05:19

83 25 Late Go Home \N 2017-02-20 08:53:02 08:53:24

84 23 Late Go Home \N 2017-02-20 08:55:55 08:58:47

85 19 Late \N \N 2017-02-20 09:04:16 \N

86 15 Late \N \N 2017-02-20 10:30:37 \N

87 13 Late \N \N 2017-02-20 10:31:58 \N

88 12 Late \N \N 2017-02-20 10:32:28 \N

it's totally difference when i exported my table using export menu in my PHPMyAdmin and opened it in my text editor.

please you guys help me to solving my problem... or you guys have some other ways...

Thanks

分享给朋友:
您可能感兴趣的文章:
随机阅读: