diff options
-rw-r--r-- | import.php | 7 | ||||
-rw-r--r-- | inc/functions.php | 1 |
2 files changed, 7 insertions, 1 deletions
@@ -28,7 +28,12 @@ else { | |||
28 | { | 28 | { |
29 | $a = $li->find('a'); | 29 | $a = $li->find('a'); |
30 | $url = $a[0]->href; | 30 | $url = $a[0]->href; |
31 | $parametres_url = prepare_url($url); | 31 | |
32 | # FIXME corriger cette génération d'ID | ||
33 | $req = $db->getHandle()->query("SELECT id FROM entries ORDER BY id DESC"); | ||
34 | $id = $req->fetchColumn()+1; | ||
35 | |||
36 | $parametres_url = prepare_url($url, $id); | ||
32 | $sql_action = 'INSERT INTO entries ( url, title, content, is_read ) VALUES (?, ?, ?, ?)'; | 37 | $sql_action = 'INSERT INTO entries ( url, title, content, is_read ) VALUES (?, ?, ?, ?)'; |
33 | $params_action = array($url, $parametres_url['title'], $parametres_url['content'], $read); | 38 | $params_action = array($url, $parametres_url['title'], $parametres_url['content'], $read); |
34 | try | 39 | try |
diff --git a/inc/functions.php b/inc/functions.php index a6109ef7..b7c7baff 100644 --- a/inc/functions.php +++ b/inc/functions.php | |||
@@ -240,6 +240,7 @@ function action_to_do($action, $id, $url, $token) | |||
240 | if ($url == '') | 240 | if ($url == '') |
241 | continue; | 241 | continue; |
242 | 242 | ||
243 | # FIXME corriger cette génération d'ID | ||
243 | $req = $db->getHandle()->query("SELECT id FROM entries ORDER BY id DESC"); | 244 | $req = $db->getHandle()->query("SELECT id FROM entries ORDER BY id DESC"); |
244 | $id = $req->fetchColumn()+1; | 245 | $id = $req->fetchColumn()+1; |
245 | 246 | ||