#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    17
    Rep Power
    0
    <?php
    $con=mysql_connect ('hostname', 'username', 'password');

    mysql_select_db('dbname',$con);

    $result = mysql_query ("SELECT Quote FROM Quotes by rand()",$con);

    $insertquote = mysql_fetch_row($result);

    print $Quote[0];
    ?>

    The row which starts with $insertquote is not working because its not a valid MySQL result resource. I don't know what that means though. ??
    Thanks for any help.
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    $insertquote = mysql_fetch_row($result);
    print $Quote[0];
    >>


    Cinela,
    It should be echo $insertquote["Quote"] or echo $insertquote[0];

    ----
    try this:


    <?php
    $con=mysql_connect ('hostname', 'username', 'password');
    mysql_select_db('dbname',$con);

    $result = mysql_query ("SELECT Quote FROM Quotes by rand()",$con);

    $insertquote = mysql_fetch_row($result);

    echo $insertquote["Quote"];
    //quote value from your query..
    //or echo $insertquote[0];
    ?>



    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    17
    Rep Power
    0
    Oh, I see...
    I should have actually known that though.
    I guess it was too late in the night for me!

    but Thank You very much!!

Similar Threads

  1. Warning: mysql_fetch_row(): ??
    By commodus in forum PHP Development
    Replies: 31
    Last Post: November 16th, 2005, 04:52 PM
  2. Replies: 1
    Last Post: January 30th, 2004, 11:46 AM
  3. parse error checked everything
    By reluxoflife in forum PHP Development
    Replies: 6
    Last Post: January 18th, 2004, 10:56 PM
  4. need help please
    By commodus in forum Beginner Programming
    Replies: 1
    Last Post: January 18th, 2004, 04:50 PM
  5. **mysql get result or mysql query question??
    By minemo in forum PHP Development
    Replies: 4
    Last Post: December 31st, 2003, 12:59 PM

IMN logo majestic logo threadwatch logo seochat tools logo