السلام عليكم
شكرا على التوضيح - عم بحاول حل هذه المشكلة ولاكن للاسف لا استطيع - أهل من الممكن محاولة ايجاد الخلل في الكود بناء على المعلومات التي افدتموني بها
هذا هو الكود
كود:
<?php
$current_month = date('n');
if($current_month == 1)
$days_total = 31;
else if($current_month == 2)
$days_total = 28;
else if($current_month == 3)
$days_total = 31;
else if($current_month == 4)
$days_total = 30;
else if($current_month == 5)
$days_total = 31;
else if($current_month == 6)
$days_total = 30;
else if($current_month == 7)
$days_total = 31;
else if($current_month == 8)
$days_total = 31;
else if($current_month == 9)
$days_total = 30;
else if($current_month == 10)
$days_total = 31;
else if($current_month == 11)
$days_total = 30;
else
$days_total = 31;
////////////////////////////////////////////////////
$user_prefrences_query = mysql_query("SELECT * FROM preferences WHERE user_id='$user_id' ");
$total_prefrence = mysql_num_rows($user_prefrences_query);
if($total_prefrence != 1){
echo "<div class=\"error\" align=\"center\">You have not yet set you prefrences!</div>";
exit();
}
$preferences_row= mysql_fetch_array($user_prefrences_query);
extract($preferences_row);
//-------------------------------------------------------------------
//db2
$favorit_resecpes = "SELECT * FROM my_favorite_recipes WHERE user_id ='$user_id' ORDER BY RAND() LIMIT $favorite_dinner ";
//my favorit array
$favorit_recepies_linklist_name = "";
$favorit_recepies_linklist_id = "";
//////////////$favorite_dinner FROM extract($preferences_row);
$days_total_left = $days_total - $favorite_dinner;
//-------------------------------------------------------------------
//db1
$select_resepes_query = "SELECT * FROM Recepies WHERE Lang='$Lang' AND deleted='0' AND Diat='$Diat' AND Vegetarian='$Vegetarian' AND
Diabetic='$Diabetic' AND Cholesterol='$Cholesterol' AND Hot='$Hot' AND Nutes='$Nutes' AND Dairy='$Dairy' AND Seafood='$Seafood' AND Beef='$Beef' AND
Pork='$Pork' AND Lamp='$Lamp' AND Chicken='$Chicken' AND (added_by='$user_id' OR publish='1') ORDER BY RAND() LIMIT $days_total_left";
//-------------------------------------------------------------------
mysql_query($select_resepes_query, db1);
mysql_query($favorit_resecpes, db2);
$query_test = mysql_query("SELECT db1.Recepies.name FROM db1.Recepies, db2.my_favorite_recipes WHERE db1.Recepies.id = db2.my_favorite_recipes.id ORDER
BY RAND() ");
/////////////////////////////////////////////////////
if(mysql_num_rows($query_test) > 0){
echo "<table class=\"flex_table\" width=\"95%\" border=\"3\" bordercolor=\"#ffffff\" >
<tbody><tr><th class=\"cat\">Sunday</th><th class=\"cat\">Monday</th><th class=\"cat\">Tusday</th><th class=\"cat\">Wednesday</th><th
class=\"cat\">Thrsday</th><th class=\"cat\">Friday</th><th class=\"cat\">Saturday</th></tr>
<tr>";
$cnt = 0;
for($x=1; $x < $days_total+1; $x++){
if( ($days_total == 31) && ($x == 31) )
$colspan_total = "colspan=\"5\"";
else if ( ($days_total == 30 ) && ($x == 30) )
$colspan_total = "colspan=\"6\"";
else
$colspan_total = "";
if( $cnt == 0){
$alt="alt";
$cnt=1;
} else {
$alt="alt2";
$cnt=0;
}
while( $resepes_array = mysql_fetch_array($query_test) ){
echo "<td class=\"$alt\" $colspan_total ><strong>$x</strong><br />
<a href=\"user_control.php?file=user_calender&day=$x&id=$resepes_row[id]\">$resepes_row[name]</a><br /><br />
<a href=\"user_control.php?file=user_calender&day=$x\">Edit</a></td>";
if( ($x % 7) == 0 )
echo "</tr><tr>";
$id_linklist[$rand_result] = "";
$name_linklist[$rand_result] = "";
} // end of while $query_test
} //end for loop
}// end of mysql_num_rows
?>
يرجا افادتي وشكرا