我正在使用Apple的EPFImporter工具http://www.apple.com/itunes/affiliates/resources/documentation/epfimporter.html
这是一个Python脚本,它将采用空格分隔的EPF文件列表并将它们导入我的数据库.
这就是我所拥有的:
Braden-Keiths-MacBook-Pro:~ bradenkeith$ ./EPFImporter.py /Users/bradenkeith/Downloads/popularity20120314
Run Code Online (Sandbox Code Playgroud)
以下是CLI返回的内容:
2012-03-14 22:12:28,748 [INFO]: Beginning import for the following directories:
/Users/bradenkeith/Downloads/popularity20120314
2012-03-14 22:12:28,748 [INFO]: Importing files in /Users/bradenkeith/Downloads/popularity20120314
2012-03-14 22:12:28,749 [INFO]: Starting import of /Users/bradenkeith/Downloads/popularity20120314...
2012-03-14 22:12:28,749 [INFO]: Beginning full ingest of epf_application_popularity_per_genre (2000491 records)
2012-03-14 22:14:28,774 [INFO]: ...at record 1797000...
2012-03-14 22:16:02,152 [INFO]: Full ingest of epf_application_popularity_per_genre took 0:03:33.402408
2012-03-14 22:16:02,196 [INFO]: Import of popularity20120314 completed at: 12-03-14 22:16:02
2012-03-14 22:16:02,196 [INFO]: Total import time for popularity20120314: 0:03:33.44
2012-03-14 22:16:02,196 [INFO]: …
Run Code Online (Sandbox Code Playgroud) 我有点像菜鸟 - 我很难过......
我需要一些代码来搜索db表以找到与$ id变量匹配的行.我需要抓住该表"描述"中的字段.如果它为null,我需要显示一条消息,如果不是另一条消息.这是我的代码(我知道我需要添加mysqli转义字符串,只需从内存中快速执行此操作):
$query = "SELECT description FROM posts WHERE id = $id";
$result = mysqli_query($dbc, $query);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC) ;
if(!$row){
echo "<p>'No description'</p>";
} else {
echo '<p>' . $row['description'] . '</p>';
}
Run Code Online (Sandbox Code Playgroud)