Help for a newbie

Discussion in 'PHP' started by thr3146, Dec 27, 2009.

  1. #1
    Hi all, I've been playing around with this script I have for a video site and am running into this error, could someone please explain in newbie talk how to fix this error...

    Warning: extract() [function.extract]: First argument should be an array in /home/blahblah/public_html/scripts/thisfolder/my_media.php on line 17

    Here is the code...

    for($i = 0; $i < $numrow; $i++) {
    $row = mysql_fetch_array($result);
    (this is line 17) extract($row);
    $titlenew = htmlentities ($row['title']);
    if($i % $columns == 0) {
    echo "<tr>\n";
    }

    I've searched google for solutions and read somewhere that extract is not the right syntax or something...(it's all greek to me) and I do have content in the database.

    Any help would be greatly appreciated with some green points:)
     
    Last edited: Dec 27, 2009
    thr3146, Dec 27, 2009 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There must be something wrong with the database. Either you aren't connected or the query is incorrect

    before the for loop put
    echo '<div>'.mysql_error().'</div>';
    and paste the error here
    It may also be worth checking that your database name is the correct one, that all the column and table names are the same as the ones in the query
     
    JAY6390, Dec 27, 2009 IP
  3. gaven

    gaven Peon

    Messages:
    46
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I think that $result is returning nothing
    may be "no rows matching" or sql error in query formation.

    My first guess.
     
    gaven, Dec 27, 2009 IP
  4. HuggyStudios

    HuggyStudios Well-Known Member

    Messages:
    724
    Likes Received:
    20
    Best Answers:
    26
    Trophy Points:
    165
    #4
    Ditto ^^, can we see the MySQL query?
     
    HuggyStudios, Dec 27, 2009 IP