הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   בעיה בPHP וSQL (https://hosts.co.il/forums/showthread.php?t=23158)

-VladK- 03-06-06 06:42

בעיה בPHP וSQL
 
שלום.
היום הוספתי דבר קטן...לבדוק אם התמונה פעילה במסד...אחרי שהוספתי את זה הכל התחרטת לי...מדוע?
הנה הקוד:
PHP קוד:

<?php
if (!defined ("PHP_FILE")) {
    
header("index.php");
    exit;
}else {
    
$rand mysql_query("SELECT * FROM `advertising` WHERE adStatus = `OnLine` ORDER BY rand()");
    
$rrow mysql_fetch_assoc($rand);
    if(
mysql_num_rows($rand) == '0') {
        echo 
"<a href=\"index.php?act=advertising\" target=\"_blank\"><img src=\"images/posthere.gif\" border=\"0\" width=\"468\" height=\"60\"></a>";
    } else {
        echo 
"<a href=\"".$rrow['adURL']."\" target=\"_blank\"><img src=\"".$rrow['adIMGU']."\" border=\"0\" width=\"468\" height=\"60\"></a>";
    }
}
?>

והשגיאות שהוא מביא לי:
HTML קוד:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/ohed/domains/ohed.cigler.net/public_html/vladi/opertives/adver.php on line 7

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/ohed/domains/ohed.cigler.net/public_html/vladi/opertives/adver.php on line 8


-VladK- 03-06-06 06:45

זהו הסתדרתי...אפשר לנעול!

meshuga 03-06-06 11:12

ננעל.


כל הזמנים הם GMT +2. הזמן כעת הוא 23:11.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ