Commit f78c1085 by Saucy

Fix: PHP v7 database connections for v2 website

parent b50e613d
......@@ -17,7 +17,7 @@ download
*/
$page = isset($_GET["page"]) ? mysql_real_escape_string($_GET["page"]) : NULL;
$page = isset($_GET["page"]) ? $_GET["page"] : NULL;
$pagelist_amount = count($archivelist);
if(!in_array($page, $archivelist)) {
......@@ -88,18 +88,15 @@ if($page == "portfolio") {
echo "<div class='box'>
<div class='text' style='padding: 0px; margin: 0px;'>";
$tbl_portfolio = mysql_query("
SELECT
$page"."_id,
$page"."_title,
$page"."_text,
$page"."_file,
date
FROM ".$saucy["DevDB"]["Name"][$page]."
ORDER BY date DESC") or die (mysql_error());
while($row_portfolio = mysql_fetch_array($tbl_portfolio)) {
$sql = "SELECT {$page}_id, {$page}_title, {$page}_text, {$page}_file, date
FROM {$saucy["DevDB"]["Name"][$page]}
ORDER BY date DESC";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
$stmt->execute();
while($row_portfolio = $stmt->fetch()) {
$id_portfolio = $row_portfolio[$page."_id"];
$title_portfolio = bbkod($row_portfolio[$page."_title"]);
$text_portfolio = $row_portfolio[$page."_text"];
......@@ -117,18 +114,16 @@ if($page == "portfolio") {
} elseif($page == "download") {
foreach($downloadables as $category) {
$tbl = mysql_query("
SELECT DISTINCT
download_id,
download_parent,
download_title,
date
FROM ".$saucy["DevDB"]["Name"][$page]."
WHERE download_parent = '$category'
ORDER BY download_id DESC") or die (mysql_error());
$tbl_amount = mysql_num_rows($tbl);
$sql = "SELECT DISTINCT download_id, download_parent, download_title, date
FROM {$saucy["DevDB"]["Name"][$page]}
WHERE download_parent = :category
ORDER BY download_id DESC";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':category', $category, PDO::PARAM_STR);
$stmt->execute();
$tbl_amount = $stmt->rowCount();
if(!empty($tbl_amount)) {
echo "<div class='box'>
......@@ -139,9 +134,9 @@ if($page == "portfolio") {
</div>
<div class='$category'>
<div class='spacer' style='margin-bottom: ".($box_pad*2)."px;'></div>";
while($row = mysql_fetch_array($tbl)) {
while($row = $stmt->fetch()) {
$id = $row["download_id"];
$title = bbkod($row["download_title"]);
$date = $row["date"];
......@@ -172,15 +167,15 @@ if($page == "portfolio") {
$page = "download";
}
$result_year = mysql_query("
SELECT DISTINCT
EXTRACT(YEAR FROM date) AS date_year
FROM ".$saucy["DevDB"]["Name"][$page]."
ORDER BY date_year DESC") or die (mysql_error());
while($row_year = mysql_fetch_array($result_year)) {
$sql = "SELECT DISTINCT EXTRACT(YEAR FROM date) AS date_year
FROM {$saucy["DevDB"]["Name"][$page]}
ORDER BY date_year DESC";
$stmt = $conn->prepare($sql);
$stmt->execute();
while($row_year = $stmt->fetch()) {
$date_year = $row_year['date_year'];
echo "<div class='box'>
......@@ -191,26 +186,26 @@ if($page == "portfolio") {
</div>
<div class='archive_$date_year'"; if($date_year != date("Y")) { echo " style='display: none;'"; } echo ">
<div class='spacer'></div>";
$result_month = mysql_query("
SELECT DISTINCT
EXTRACT(YEAR FROM date) AS date_year,
EXTRACT(MONTH FROM date) AS date_month
FROM ".$saucy["DevDB"]["Name"][$page]."
WHERE YEAR(date) = '$date_year'
ORDER BY $page"."_id DESC") or die (mysql_error());
while($row_month = mysql_fetch_array($result_month)) {
$date_month = $row_month['date_month'];
$result_num_days = mysql_query("
SELECT
date
FROM ".$saucy["DevDB"]["Name"][$page]."
WHERE YEAR(date) = '$date_year' AND MONTH(date) = '$date_month'") or die (mysql_error());
$count_month = mysql_num_rows($result_num_days);
$sql = "SELECT DISTINCT EXTRACT(YEAR FROM date) AS date_year, EXTRACT(MONTH FROM date) AS date_month
FROM {$saucy["DevDB"]["Name"][$page]}
WHERE YEAR(date) = :date_year
ORDER BY {$page}_id DESC";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':date_year', $date_year, PDO::PARAM_INT);
$stmt->execute();
while($row_month = $stmt->fetch()) {
$sql = "SELECT date
FROM {$saucy["DevDB"]["Name"][$page]}
WHERE YEAR(date) = :date_year AND MONTH(date) = :date_month";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':date_year', $date_year, PDO::PARAM_INT);
$stmt->bindParam(':date_month', $date_month, PDO::PARAM_INT);
$stmt->execute();
$count_month = $stmt->rowCount();
echo "<div class='text big'>
<a id='archive_$date_year-$date_month' class='showArchive tooltipArchive' title='".bbkod($saucy["Default"]["Locale"]["ArchivesMonthHover"])."'>
".date('F : Y',mktime(0,0,0,$date_month+1,0,$date_year))." : [ $count_month ]
......@@ -220,36 +215,28 @@ if($page == "portfolio") {
<div class='spacer' style='margin: $box_pad"."px ".($box_pad*8)."px ".($box_pad*2)."px ".($box_pad*8)."px'></div>";
if($page == "list" OR $page == "tutorial") {
$result_day = mysql_query("
SELECT DISTINCT
EXTRACT(YEAR FROM date) AS date_year,
EXTRACT(MONTH FROM date) AS date_month,
$page"."_id,
$page"."_title,
date
FROM ".$saucy["DevDB"]["Name"][$page]."
WHERE YEAR(date) = '$date_year' AND MONTH(date) = '$date_month'
ORDER BY $page"."_id DESC") or die (mysql_error());
$sql = "SELECT DISTINCT EXTRACT(YEAR FROM date) AS date_year, EXTRACT(MONTH FROM date) AS date_month, {$page}_id, {$page}_title, date
FROM {$saucy["DevDB"]["Name"][$page]}
WHERE YEAR(date) = :date_year AND MONTH(date) = :date_month
ORDER BY {$page}_id DESC";
} else {
$result_day = mysql_query("
SELECT DISTINCT
EXTRACT(YEAR FROM date) AS date_year,
EXTRACT(MONTH FROM date) AS date_month,
$page"."_id,
$page"."_parent,
$page"."_title,
date
FROM ".$saucy["DevDB"]["Name"][$page]."
WHERE YEAR(date) = '$date_year' AND MONTH(date) = '$date_month'
ORDER BY $page"."_id DESC") or die (mysql_error());
$sql = "SELECT DISTINCT EXTRACT(YEAR FROM date) AS date_year, EXTRACT(MONTH FROM date) AS date_month, {$page}_id, {$page}_parent, {$page}_title, date
FROM {$saucy["DevDB"]["Name"][$page]}
WHERE YEAR(date) = :date_year AND MONTH(date) = :date_month
ORDER BY {$page}_id DESC";
}
while($row_day = mysql_fetch_array($result_day)) {
$stmt = $conn->prepare($sql);
$stmt->bindParam(':date_year', $date_year, PDO::PARAM_INT);
$stmt->bindParam(':date_month', $date_month, PDO::PARAM_INT);
$stmt->execute();
while($row_day = $stmt->fetch()) {
$id_day = $row_day[$page."_id"];
$title = bbkod($row_day[$page."_title"]);
$date = $row_day["date"];
......
<?php
// Mysql config
$host = "localhost"; // Change this if needed
$database = "database_name"; // Change this if needed
$user = "username"; // Change this if needed
$password = "password"; // Change this if needed
$host = 'localhost'; // Change this if needed
$database = 'database'; // Change this if needed
$username = 'username'; // Change this if needed
$password = 'password'; // Change this if needed
// Main connection
$conn = mysql_connect($host, $user, $password) or die("Can't find the Database Server");
mysql_select_db($database, $conn);
mysql_set_charset("utf8",$conn);
$conn = new PDO(
"mysql:host=$host;dbname=$database",
$username,
$password,
[
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_FOUND_ROWS => true,
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'
]
);
define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']));
?>
......@@ -513,32 +513,29 @@ if(!empty($saucy["DevShow"]["Column"]["All"])) {
// LIST
if(!empty($saucy["Panel"]["List"]["Enabled"])) {
$tbl_list_index = mysql_query("
SELECT
list_id,
list_title,
date
FROM ".$saucy["DevDB"]["Name"]["list"]."
$sql = "SELECT list_id, list_title, date
FROM {$saucy["DevDB"]["Name"]["list"]}
ORDER BY date DESC
LIMIT ".$saucy["Panel"]["List"]["Limit"]["Articles"]."") or die (mysql_error());
while($row_list_index = mysql_fetch_array($tbl_list_index)) {
LIMIT {$saucy["Panel"]["List"]["Limit"]["Articles"]}";
$stmt = $conn->prepare($sql);
$stmt->execute();
while($row_list_index = $stmt->fetch()) {
$list_id_index = $row_list_index["list_id"];
$list_title_index = bbkod($row_list_index["list_title"]);
$list_date_index = $row_list_index["date"];
// LIST COMMENTS
$tbl_list_comments_index = mysql_query("
SELECT
comment_parent_id,
comment_parent,
comment_approved
FROM ".$saucy["DevDB"]["Name"]["comment"]."
WHERE comment_parent_id = '$list_id_index' AND comment_parent = 'list' AND comment_approved = '1'
ORDER BY date DESC") or die (mysql_error());
$row_list_comments_amount_index = mysql_num_rows($tbl_list_comments_index);
$sql = "SELECT comment_parent_id, comment_parent, comment_approved
FROM {$saucy["DevDB"]["Name"]["comment"]}
WHERE comment_parent_id = :id AND comment_parent = 'list' AND comment_approved = 1
ORDER BY date DESC";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':id', $list_id_index, PDO::PARAM_INT);
$stmt->execute();
$row_list_comments_amount_index = $stmt->rowCount();
echo "<div class='box'>
<div class='text big'>
<a id='list' class='show tooltip' title='".bbkod($saucy["Panel"]["List"]["Locale"]["TitleHover"])."'>".
......@@ -553,17 +550,16 @@ if(!empty($saucy["DevShow"]["Column"]["All"])) {
// LIST CONTENT
$list_counter_index = 1;
$tbl_list_content_index = mysql_query("
SELECT
list_content_id,
list_content_title,
list_content_text
FROM ".$saucy["DevDB"]["Name"]["listcontent"]."
WHERE list_content_parent_id = $list_id_index
$sql = "SELECT list_content_id, list_content_title, list_content_text
FROM {$saucy["DevDB"]["Name"]["listcontent"]}
WHERE list_content_parent_id = :id
ORDER BY list_content_id ASC
LIMIT ".$saucy["Panel"]["List"]["Limit"]["Posts"]."") or die (mysql_error());
while($row_list_content_index = mysql_fetch_array($tbl_list_content_index)) {
LIMIT {$saucy["Panel"]["List"]["Limit"]["Posts"]}";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':id', $list_id_index, PDO::PARAM_INT);
$stmt->execute();
while ($row_list_content_index = $stmt->fetch()) {
$list_content_id_index = $row_list_content_index["list_content_id"];
$list_content_title_index = $row_list_content_index["list_content_title"];
$list_content_text_index = bbkod($row_list_content_index["list_content_text"]);
......@@ -698,18 +694,16 @@ if(!empty($saucy["DevShow"]["Column"]["All"])) {
</div>
<div class='search_category' "; if(empty($saucy["Panel"]["Category"]["Show"])) { echo "style='display: none;'"; } echo ">
<div class='spacer' style='margin-bottom: ".($box_pad*2)."px;'></div>";
$tbl_categories_index = mysql_query("
SELECT DISTINCT
".$saucy["DevDB"]["Name"]["category"].".category_id,
category_title,
category_popular
FROM ".$saucy["DevDB"]["Name"]["category"]."
INNER JOIN ".$saucy["DevDB"]["Name"]["categoryparent"]." ON ".$saucy["DevDB"]["Name"]["category"].".category_id = ".$saucy["DevDB"]["Name"]["categoryparent"].".category_id
$sql = "SELECT DISTINCT {$saucy["DevDB"]["Name"]["category"]}.category_id, category_title, category_popular
FROM {$saucy["DevDB"]["Name"]["category"]}
INNER JOIN {$saucy["DevDB"]["Name"]["categoryparent"]} ON {$saucy["DevDB"]["Name"]["category"]}.category_id = {$saucy["DevDB"]["Name"]["categoryparent"]}.category_id
ORDER BY category_popular DESC
LIMIT ".$saucy["Panel"]["Category"]["Limit"]["Posts"]."") or die (mysql_error());
while($row_categories_index = mysql_fetch_array($tbl_categories_index)) {
LIMIT {$saucy["Panel"]["Category"]["Limit"]["Posts"]}";
$stmt = $conn->prepare($sql);
$stmt->execute();
while($row_categories_index = $stmt->fetch()) {
$categories_id_index = $row_categories_index["category_id"];
$categories_title_index = bbkod($row_categories_index["category_title"]);
......@@ -737,18 +731,16 @@ if(!empty($saucy["DevShow"]["Column"]["All"])) {
</div>
<div class='search_tool' "; if(empty($saucy["Panel"]["Tool"]["Show"])) { echo "style='display: none;'"; } echo ">
<div class='spacer' style='margin-bottom: ".($box_pad*2)."px;'></div>";
$tbl_tools_index = mysql_query("
SELECT DISTINCT
".$saucy["DevDB"]["Name"]["tool"].".tool_id,
tool_title,
tool_popular
FROM ".$saucy["DevDB"]["Name"]["tool"]."
INNER JOIN ".$saucy["DevDB"]["Name"]["toolparent"]." ON ".$saucy["DevDB"]["Name"]["tool"].".tool_id = ".$saucy["DevDB"]["Name"]["toolparent"].".tool_id
$sql = "SELECT DISTINCT {$saucy["DevDB"]["Name"]["tool"]}.tool_id, tool_title, tool_popular
FROM {$saucy["DevDB"]["Name"]["tool"]}
INNER JOIN {$saucy["DevDB"]["Name"]["toolparent"]} ON {$saucy["DevDB"]["Name"]["tool"]}.tool_id = {$saucy["DevDB"]["Name"]["toolparent"]}.tool_id
ORDER BY tool_popular DESC
LIMIT ".$saucy["Panel"]["Tool"]["Limit"]["Posts"]."") or die (mysql_error());
while($row_tools_index = mysql_fetch_array($tbl_tools_index)) {
LIMIT {$saucy["Panel"]["Tool"]["Limit"]["Posts"]}";
$stmt = $conn->prepare($sql);
$stmt->execute();
while($row_tools_index = $stmt->fetch()) {
$tools_id_index = $row_tools_index["tool_id"];
$tools_title_index = bbkod($row_tools_index["tool_title"]);
......@@ -776,25 +768,18 @@ if(!empty($saucy["DevShow"]["Column"]["All"])) {
</div>
<div class='latest' "; if(empty($saucy["Panel"]["Latest"]["Show"])) { echo "style='display: none;'"; } echo ">
<div class='spacer' style='margin-bottom: ".($box_pad*2)."px;'></div>";
$tbl_latest_index = mysql_query("
SELECT
blog_id,
blog_title,
date,
blog_parent
FROM ".$saucy["DevDB"]["Name"]["blog"]."
$sql = "SELECT blog_id, blog_title, date, blog_parent
FROM {$saucy["DevDB"]["Name"]["blog"]}
UNION
SELECT
review_id,
review_title,
date,
review_parent
FROM ".$saucy["DevDB"]["Name"]["review"]."
SELECT review_id, review_title, date, review_parent
FROM {$saucy["DevDB"]["Name"]["review"]}
ORDER BY date DESC
LIMIT ".$saucy["Panel"]["Latest"]["Limit"]["Posts"]."") or die (mysql_error());
while($row_latest_index = mysql_fetch_array($tbl_latest_index)) {
LIMIT {$saucy["Panel"]["Latest"]["Limit"]["Posts"]}";
$stmt = $conn->prepare($sql);
$stmt->execute();
while($row_latest_index = $stmt->fetch()) {
$latest_id_index = $row_latest_index["blog_id"];
$latest_title_index = bbkod($row_latest_index["blog_title"]);
$latest_parent_index = $row_latest_index["blog_parent"];
......
......@@ -5,7 +5,7 @@ require($saucy["Default"]["Conn"]);
require($saucy["Default"]["Functions"]);
//require_once($saucy["Default"]["SubmitRating"]);
$page = isset($_GET["page"]) ? mysql_real_escape_string($_GET["page"]) : NULL;
$page = isset($_GET["page"]) ? $_GET["page"] : NULL;
$pagelist_amount = count($informationlist);
if(!in_array($page, $informationlist)) {
......@@ -149,20 +149,18 @@ if($page == "cookies" OR $page == "about" OR $page == "statistics" OR $page == "
echo "<div class='box'>";
// Hämta alla rader du vill ha med.
$tbl = mysql_query("
SELECT
link_category,
link_title,
link_url
FROM ".$saucy["DevDB"]["Name"][$page]."
ORDER BY link_category ASC") or die (mysql_error());
$sql = "SELECT link_category, link_title, link_url
FROM {$saucy["DevDB"]["Name"][$page]}
ORDER BY link_category ASC";
$stmt = $conn->prepare($sql);
$stmt->execute();
// Skapa en tom array för att lagra resultatet i
$tbl_array = array();
// Loopa igenom alla rader i PHP
while ($row = mysql_fetch_assoc($tbl)) {
while ($row = $stmt->fetch()) {
// Lägg dem i en multidimensionell array med datumet som nyckel i första ledet.
// Hämta datumet som vi skall använda som "nyckel"
$category = $row['link_category'];
......
......@@ -5,7 +5,7 @@ require($saucy["Default"]["Conn"]);
require($saucy["Default"]["Functions"]);
//require_once($saucy["Default"]["SubmitRating"]);
$page = isset($_GET["page"]) ? mysql_real_escape_string($_GET["page"]) : NULL;
$page = isset($_GET["page"]) ? $_GET["page"] : NULL;
$pagelist_amount = count($searchlist);
if(!in_array($page, $searchlist)) {
......@@ -14,17 +14,19 @@ if(!in_array($page, $searchlist)) {
}
$id_get = mysql_real_escape_string($_GET["id"]);
$id_get = $_GET["id"];
$id_url = ((isset($id_get) AND is_numeric($id_get)) ? intval($id_get) : 0);
$sql = "SELECT
".$saucy["DevDB"]["Name"][$searchlist[0]].".".$searchlist[0]."_id,
".$saucy["DevDB"]["Name"][$searchlist[1]].".".$searchlist[1]."_id
FROM ".$saucy["DevDB"]["Name"][$searchlist[0]].", ".$saucy["DevDB"]["Name"][$searchlist[1]]."
WHERE ".$saucy["DevDB"]["Name"][$searchlist[0]].".".$searchlist[0]."_id=$id_url OR ".$saucy["DevDB"]["Name"][$searchlist[1]].".".$searchlist[1]."_id=$id_url";
{$saucy["DevDB"]["Name"][$searchlist[0]]}.{$searchlist[0]}_id,
{$saucy["DevDB"]["Name"][$searchlist[1]]}.{$searchlist[1]}_id
FROM {$saucy["DevDB"]["Name"][$searchlist[0]]}, {$saucy["DevDB"]["Name"][$searchlist[1]]}
WHERE {$saucy["DevDB"]["Name"][$searchlist[0]]}.{$searchlist[0]}_id = :id_url OR {$saucy["DevDB"]["Name"][$searchlist[1]]}.{$searchlist[1]}_id = :id_url";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':id_url', $id_url, PDO::PARAM_INT);
$stmt->execute();
$id_result = mysql_query($sql) or die (mysql_error());
if(mysql_num_rows($id_result) > 0){
if($stmt->rowCount() > 0){
$page_id = $id_get;
......@@ -119,18 +121,21 @@ $(document).ready(function(){
<?php
$update = mysql_query("
UPDATE ".$saucy["DevDB"]["Name"][$page]."
SET $page"."_popular = $page"."_popular + 1
WHERE $page"."_id = $page_id") or die (mysql_error());
$sql = "UPDATE {$saucy["DevDB"]["Name"][$page]}
SET {$page}_popular = {$page}_popular + 1
WHERE {$page}_id = :page_id";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':page_id', $page_id, PDO::PARAM_INT);
$stmt->execute();
$tbl_page = mysql_query("
SELECT
$page"."_id,
$page"."_title
FROM ".$saucy["DevDB"]["Name"][$page]."
WHERE $page"."_id = $page_id") or die(mysql_error);
while($row_page = mysql_fetch_array($tbl_page)) {
$sql = "SELECT {$page}_id, {$page}_title
FROM {$saucy["DevDB"]["Name"][$page]}
WHERE {$page}_id = :page_id";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':page_id', $page_id, PDO::PARAM_INT);
$stmt->execute();
while($row_page = $stmt->fetch()) {
$id = $row_page[$page."_id"];
$title = bbkod($row_page[$page."_title"]);
......@@ -147,14 +152,14 @@ if($page == "category") {
foreach($categories as $category) {
$tbl = mysql_query("
SELECT
$category"."_id
FROM ".$saucy["DevDB"]["Name"]["categoryparent"]."
WHERE category_id = $page_id AND $category"."_id IS NOT NULL
ORDER BY $category"."_id DESC") or die (mysql_error());
$tbl_amount = mysql_num_rows($tbl);
$sql = "SELECT {$category}_id
FROM {$saucy["DevDB"]["Name"]["categoryparent"]}
WHERE category_id = $page_id AND {$category}_id IS NOT NULL
ORDER BY {$category}_id DESC";
$stmt = $conn->prepare($sql);
$stmt->execute();
$tbl_amount = $stmt->rowCount();
if(!empty($tbl_amount)) {
echo "<div class='box'>
......@@ -165,20 +170,18 @@ if($page == "category") {
</div>
<div class='search_$category$page_id'>
<div class='spacer' style='margin-bottom: ".($box_pad*2)."px;'></div>";
while($row = mysql_fetch_array($tbl)) {
while($row = $stmt->fetch()) {
$id_category = $row[$category."_id"];
$tbl_content = mysql_query("
SELECT
$category"."_id,
$category"."_title,
date
FROM ".$saucy["DevDB"]["Name"][$category]."
WHERE $category"."_id = '$id_category'") or die (mysql_error());
while($row_content = mysql_fetch_array($tbl_content)) {
$sql = "SELECT {$category}_id, {$category}_title, date
FROM {$saucy["DevDB"]["Name"][$category]}
WHERE {$category}_id = :id_category";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':id_category', $id_category, PDO::PARAM_INT);
$stmt->execute();
while($row_content = $stmt->fetch()) {
$id_content = $row_content[$category."_id"];
$title_content = bbkod($row_content[$category."_title"]);
$date = $row_content["date"];
......@@ -208,14 +211,15 @@ if($page == "category") {
foreach($tools as $tool) {
$tbl = mysql_query("
SELECT
$tool"."_id
FROM ".$saucy["DevDB"]["Name"]["toolparent"]."
WHERE tool_id = $page_id AND $tool"."_id IS NOT NULL
ORDER BY $tool"."_id DESC") or die (mysql_error());
$tbl_amount = mysql_num_rows($tbl);
$sql = "SELECT {$tool}_id
FROM {$saucy["DevDB"]["Name"]["toolparent"]}
WHERE tool_id = :page_id AND {$tool}_id IS NOT NULL
ORDER BY {$tool}_id DESC";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':page_id', $page_id, PDO::PARAM_INT);
$stmt->execute();
$tbl_amount = $stmt->rowCount();
if(!empty($tbl_amount)) {
echo "<div class='box'>
......@@ -226,20 +230,19 @@ if($page == "category") {
</div>
<div class='search_$tool$page_id'>
<div class='spacer' style='margin-bottom: ".($box_pad*2)."px;'></div>";
while($row = mysql_fetch_array($tbl)) {
while($row = $stmt->fetch()) {
$id_tool = $row[$tool."_id"];
$tbl_content = mysql_query("
SELECT
$tool"."_id,
$tool"."_title,
date
FROM ".$saucy["DevDB"]["Name"][$tool]."
WHERE $tool"."_id = '$id_tool'") or die (mysql_error());
while($row_content = mysql_fetch_array($tbl_content)) {
$sql = "SELECT {$tool}_id, {$tool}_title, date
FROM {$saucy["DevDB"]["Name"][$tool]}
WHERE {$tool}_id = :id_tool";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':id_tool', $id_tool, PDO::PARAM_INT);
$stmt->execute();
while($row_content = $stmt->fetch()) {
$id_content = $row_content[$tool."_id"];
$title_content = bbkod($row_content[$tool."_title"]);
$date = $row_content["date"];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment