info from MySQL DB

I want to provide a way to retreive information from a MySQL database without requiring them to login. I found a premade script but when I used it and tested it I got this error message:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/wjchorus/public_html/auctinfofind.php on line 61

line 61 reads: while ($tablerows = mysql_fetch_row($sql))

i didn't change this. I felt that this tutorial was missing a few paragraphs at the end explaining what we would see and how to set up a retrival form.

Comments

  • martian2k4martian2k4 Llama Hunter Moderator
    Retriving info from a mysql db is simple

    [PHP]<?
    mysql_connect(localhost,usename,password);
    mysql_select_db(db_username);

    $query = mysql_query("SELECT * FROM `table` ORDER BY ID");
    while($=mysql_fetch_array($query)){

    $variable = $r["variable"];

    echo $variable;
    }
    ?>[/PHP]

    This will display the info from `table` and display the row called `variable`. So you need to change the connect info and change the table info. Hope this helped :D
    Free MySpace Layouts- Coming soon
    Photoshop Tutorials- Coming soon
    Premium PHP Scripts- Coming soon

    Haha i should really do some work so i can remove all the coming soon's
  • utinaeniduutinaenidu Beginner Link Clerk
    i didn't use your script exactly but you helped me to see my problem. Thank you very much.
  • martian2k4martian2k4 Llama Hunter Moderator
    No problem just glad i could help :D
    Free MySpace Layouts- Coming soon
    Photoshop Tutorials- Coming soon
    Premium PHP Scripts- Coming soon

    Haha i should really do some work so i can remove all the coming soon's
  • PythonPython Forum Leader The Royal RAM
    yet another happy member :) just the way i like it

    The Royal Ram

  • martian2k4martian2k4 Llama Hunter Moderator
    Lmao but will he carry on posting? :p
    Free MySpace Layouts- Coming soon
    Photoshop Tutorials- Coming soon
    Premium PHP Scripts- Coming soon

    Haha i should really do some work so i can remove all the coming soon's
Sign In or Register to comment.