Im Having Trouble With A MySpace Clone Script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AlwaysLost
    New Member
    • Nov 2008
    • 1

    Im Having Trouble With A MySpace Clone Script

    Error on the Home Page Above The Header:
    Warning: mysql_num_rows( ): supplied argument is not a valid MySQL result resource in /home/content/s/k/e/skeem/html/space4me/functions.php on line 42

    Warning: mysql_num_rows( ): supplied argument is not a valid MySQL result resource in /home/content/s/k/e/skeem/html/space4me/functions.php on line 50

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/k/e/skeem/html/space4me/functions.php:4 2) in /home/content/s/k/e/skeem/html/space4me/index.php on line 73

    Warning: mysql_num_rows( ): supplied argument is not a valid MySQL result resource in /home/content/s/k/e/skeem/html/space4me/functions.php on line 76

    Warning: mysql_num_rows( ): supplied argument is not a valid MySQL result resource in /home/content/s/k/e/skeem/html/space4me/functions.php on line 77
    Here is the error before the footer:
    Warning: mysql_num_rows( ): supplied argument is not a valid MySQL result resource in /home/content/s/k/e/skeem/html/space4me/functions.php on line 130

    Warning: mysql_num_rows( ): supplied argument is not a valid MySQL result resource in /home/content/s/k/e/skeem/html/space4me/functions.php on line 131

    Here is the code they refer to, it seems to be the same call or function for each error:

    This is lines 38 to 50
    [PHP]
    function sql_execute($sq l_query,$wtr){
    global $conn_id;
    $sql_res=mysql_ query($sql_quer y,$conn_id);
    if($wtr=='get') {
    if(mysql_num_ro ws($sql_res)){ <====PROBLEM LINE
    return mysql_fetch_obj ect($sql_res);
    }
    else {
    return '';
    }
    }
    elseif($wtr=='n um'){
    return mysql_num_rows( $sql_res); <====PROBLEM LINE
    [/PHP]

    Here are lines 72 to 78:

    [PHP]$sql="select * from banners where b_blk='N' and b_typ='H' and b_exp='N'";
    $res=mysql_quer y($sql); <====PROBLEM LINE
    $dis=array();
    $dis_id=array() ;
    $num=mysql_num_ rows($res); <=====PROBLEM LINE
    if(mysql_num_ro ws($res)) { <=====PROBLEM LINE
    while($row=mysq l_fetch_object( $res)) {

    Here are lines 130 and 131:

    $num=mysql_num_ rows($res);
    if(mysql_num_ro ws($res)) {[/PHP]


    To me it seems to be the same problem over and over again, but Im new to all of this. Any help would be appreciated.

    Thanks in advance.
    Matt
    Last edited by Atli; Nov 13 '08, 12:45 PM. Reason: Added [code] and [quote] tags.
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Make sure the query is valid and running properly
    [CODE=mysql]select * from banners where b_blk='N' and b_typ='H' and b_exp='N'[/CODE]
    Use mysql_error() to know the error if any in this way
    [PHP]$res=mysql_quer y($sql) or die("Error in query: ". mysql_error());[/PHP]

    Comment

    Working...