I'm having some trouble about inserting a new post in my database. I ran it on shared host and there was no problem, but on my vps it gives me the following error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/sam/public_html/admin/include/functions.php on line 37
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/sam/public_html/admin/include/functions.php on line 46
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/sam/public_html/admin/include/functions.php on line 55
Here is my code (functions.php) :
<?php
include("../../Connections/confing.php");
function offset_time($time,$ofset)
{
$time_array = explode(":",$time);
$am = "";
$hours = $time_array[0];
$minutes = $time_array[1];
$new_hour = $hours +10;
if($new_hour>24){
$new_hour = $new_hour - 24;
$am = "am";
}else{
$am = "pm";
}
if ($new_hour>12){
$new_hour = $new_hour -12;
}
$offset_time = $new_hour . ":". $minutes ." ".$am ;
return $offset_time;
}
//---------------------- Get Cat ID -------------------------------------------
function getcatid($newsid){
$minSql = "select catid from art_news where newsid=".$newsid;
$RSofGet = mysql_query($minSql);
$RSget = mysql_fetch_array($RSofGet);
$catid = $RSget["catid"];
return $catid;
}
function getzoneid($newsid){
$minSql = "select zoneid from art_news where newsid=".$newsid;
$RSofGet = mysql_query($minSql);
$RSget = mysql_fetch_array($RSofGet);
$zoneid = $RSget["zoneid"];
return $zoneid;
}
function get_news_lang($newsid){
$minSql = "select lang from art_news where newsid=".$newsid;
$RSofGet = mysql_query($minSql);
$RSget = mysql_fetch_array($RSofGet);
$lang = $RSget["lang"];
return $lang;
}
function get_art_lang($artid){
$minSql = "select lang from art_articles where artid=".$artid;
$RSofGet = mysql_query($minSql);
$RSget = mysql_fetch_array($RSofGet);
$lang = $RSget["lang"];
return $lang;
}
function get_video_lang($albumid){
$minSql = "select lang from video_albums where albumid=".$albumid;
$RSofGet = mysql_query($minSql);
$RSget = mysql_fetch_array($RSofGet);
$lang = $RSget["lang"];
return $lang;
}
function get_gallery_lang($albumid){
$minSql = "select lang from glr_albums where albumid=".$albumid;
$RSofGet = mysql_query($minSql);
$RSget = mysql_fetch_array($RSofGet);
$lang = $RSget["lang"];
return $lang;
}
function getphoto_newsid($photoid){
$minSql = "select newsid from art_photos where photoid=".$photoid;
$RSofGet = mysql_query($minSql);
$RSget = mysql_fetch_array($RSofGet);
$newsid = $RSget["newsid"];
return $newsid;
}
function get_photo_albumid($photoid){
$minSql = "select albumid from glr_photos where photoid=".$photoid;
$RSofGet = mysql_query($minSql);
$RSget = mysql_fetch_array($RSofGet);
$albumid = $RSget["albumid"];
return $albumid;
}
?>