Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    2

    Unhappy Unanswered: connection to mysql - i want to cry

    hello, im a newbie, i have a snipit of code which "should" let me view the contents of a selected table in my database.

    i uploaded and when i viewed, i got nothing but a blank page!!!

    can anyone help me, or does anyone know an easier way to create a register / login databse so people can gain access ect...
    please help, im losing my hair.

    <?php
    // connect to the database

    $connection = mysql_connect("local host","mysqlUserName,"MysqlPassWord");

    // choose database
    $db = mysql_select_db("test", $connection);

    $SQL = "SELECT url FROM site01_favwebsites";

    $websitesURLs = mysql_query($SQL);
    ?>

    <table border="1">
    <?php
    for ($i = 1; $i <= $numRows; $i++)
    {

    // get results

    $rowOfResults = mysql_fetch_array ($websiteurls);
    ?>
    <tr>
    <td><?php echo $rowOfResults['url'] ?></td>
    <tr>
    <?php
    }
    ?>
    </table>

  2. #2
    Join Date
    May 2004
    Location
    Northern California
    Posts
    10
    Oh boy, I'm about to have to do a project like this soon (PhP/MySQL with login access). More opportunities to learn new stuffs.
    Tuan M. -- Database Developer Newbie, dot NET generation
    If you want cheap-shit web hosting, check out www.websaic.com
    For all your custom test socket needs, check out Gold Technologies, Inc.
    Oh yeah, last but not least, GO BAR-Honda!

  3. #3
    Join Date
    Mar 2004
    Location
    Illinois
    Posts
    5
    I don't know if the code is correct or not, but you're missing the closing double quote on mysqlUserName.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •