why it is not working

Discussion in 'PHP' started by anchitjindal07, Sep 26, 2009.

  1. anchitjindal07

    anchitjindal07 New Member

    Joined:
    Jul 13, 2009
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    $selct="SELECT * FROM stu_info";

    $result=mysql_query($selct,$status);
    while($row = mysql_fetch_array('$result',MYSQL_BOTH))
    {
    echo $row['Name'],$row['Father s Name'],$row['Address'],$row['Date of birth'],$row['Course'],$row['Branch'],$row['Batch'],$row['Roll No.'],$row['Univ. Reg. No.'],$row['Gender'];
    echo "<br />";
    }

    Above code is giving following Warning:

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\EasyPHP 3.0\www\process.php on line 44

    Plz help
     
  2. nimesh

    nimesh New Member

    Joined:
    Apr 13, 2009
    Messages:
    769
    Likes Received:
    20
    Trophy Points:
    0
    Occupation:
    Oracle Apps Admin
    Location:
    Mumbai
    Home Page:
    http://techiethakkar.blogspot.com
  3. anchitjindal07

    anchitjindal07 New Member

    Joined:
    Jul 13, 2009
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    But the same warning is still there
     
  4. nimesh

    nimesh New Member

    Joined:
    Apr 13, 2009
    Messages:
    769
    Likes Received:
    20
    Trophy Points:
    0
    Occupation:
    Oracle Apps Admin
    Location:
    Mumbai
    Home Page:
    http://techiethakkar.blogspot.com
    Sorry, I don't know php, so can't help much

    Maybe some expert would be able to help you.

    Shabbir: Can you check this one?
     
  5. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    $result is a variable which is passed in quotes for the function. Try removing the single quotes and see what happens.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice