', '
')); break; default: echo 0; return 0; break; } $insert_news = $mySQLconnect -> prepare('insert into noticias (title, content, icon_route, page_source, author, frist_paragraph) values (?, ?, ?, ?, ?, ?)'); $insert_news -> bindParam(1, $title, PDO::PARAM_STR); $insert_news -> bindParam(2, $inner_HTML, PDO::PARAM_STR); $insert_news -> bindParam(3, $icon, PDO::PARAM_STR); $insert_news -> bindParam(4, $page, PDO::PARAM_STR); $insert_news -> bindParam(5, $author, PDO::PARAM_STR); $insert_news -> bindParam(6, $frist_p, PDO::PARAM_STR); $insert_news -> execute(); $ids_done = file_get_contents('./control-files/00_ids_done.txt'); $num = $ids_done + 1; file_put_contents('./control-files/00_ids_done.txt', $num); rename($news_unique,"./news/$num.html"); file_put_contents('./control-files/00_news_done.txt', " ./news/$num.html", FILE_APPEND); } function bring_the_news_back_home($actual_page, $news_per_page) { require './mySQLconnect.php'; $frist_calc = $actual_page * $news_per_page; $second_calc = ($actual_page * $news_per_page) - $news_per_page; $prepared_query = $mySQLconnect -> prepare("select id, title, frist_paragraph, icon_route from noticias where id < ? and id > ?"); $prepared_query -> bindParam(1, $frist_calc, PDO::PARAM_INT); $prepared_query -> bindParam(2, $second_calc, PDO::PARAM_INT); //$prepared_query -> execute(array($actual_page * 10, $actual_page * 10 - 10)); $prepared_query -> execute(); $return = $prepared_query -> fetchAll(); return $return; } function bring_the_choosen_one($id) { require './mySQLconnect.php'; $prepared_query = $mySQLconnect -> prepare('select * from noticias where id = ?'); $prepared_query -> bindParam(1, $id, PDO::PARAM_INT); $prepared_query -> execute(); $return = $prepared_query -> fetchAll(); return $return; } ?>