Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 6 of 6

This is a discussion on Looking for some help... in the Shared & Semi-Dedicated forum
I am getting this error when I am attempting to test access to database I created is mysql... Parse error: parse error in /home/emeraldv/public_html/theroswellproject/mysql_up.php on ...

  1. #1
    JPC Member
    Join Date
    Apr 2003
    Posts
    6

    Looking for some help...

    I am getting this error when I am attempting to test access to database I created is mysql...


    Parse error: parse error in /home/emeraldv/public_html/theroswellproject/mysql_up.php on line 8


    the host may be wrong but the domain is as listed
    the database is named "roswell"
    the username is "roswell"
    the password is altered to protect the clueless.


    the test page looks like this...

    html>
    <head><title>Test MySQL</title></head>
    <body>
    <!--mysql_up.php -->
    <?php
    $host="emeraldvisions.net"
    $user="emeraldv_roswell"
    $password="the password"

    mysql_connect($host,$user,$password);
    $sql="show status";
    $result = mysql_query($sql);
    if ($result == 0)
    echo "<b>Error " . mysql_errno() . ": "
    . mysql_error() . "</b>";
    else
    {
    ?>
    <!-- Table that displays results -->
    <table border="1">
    <tr><td><b>Variable_name</b></td><td><b>Value</b>
    </td></tr>
    <?php
    for ($i = 0; $i < mysql_num_rows($result); $i++) {
    echo "<TR>";
    $row_array = mysql_fetch_row($result);
    for ($j = 0; $j <mysql_num_fields($result); $j++)
    {
    echo "<TD>" . $row_array[$j] . "</td>";
    }
    echo "</tr>";
    ?>
    </table>
    <?php } ?>
    </body></html



    Any ideas what could be wrong?

  2. #2
    JPC Addict randyriegel's Avatar
    Join Date
    Jan 2002
    Location
    Wintersville, OH
    Posts
    161
    You don't have semicolons after the lines setting $host, $user, and $password. Should be:

    $host="emeraldvisions.net";
    $user="emeraldv_roswell";
    $password="the password";

  3. #3
    JPC Member
    Join Date
    Apr 2003
    Posts
    6
    Thanks, I discovered that afterward, it still didn't work so I eneded up starting over from scratch. I appreciate the response.

  4. #4
    JPC Addict randyriegel's Avatar
    Join Date
    Jan 2002
    Location
    Wintersville, OH
    Posts
    161
    what is not working? Getting more errors?

    I see another thing I'm not sure about. You have:
    PHP Code:
    $host="emeraldvisions.net"
    I always use:
    PHP Code:
    $host="localhost"
    Randy

  5. #5
    JPC Member
    Join Date
    Apr 2003
    Posts
    6
    cleared that up as well, my test was sucessful. Now comes the fun part the first attempt at actually useing the PHP/MySQL to create a table to push and pull data.

  6. #6
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    95% of the time it is easier to use phpMyAdmin (in CPanel) to create your tables. Since you'll usually just create tables once it is far easier to use the GUI that phpMyAdmin offers to create them and then just write code to select/insert/update your data.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

Bookmarks

Posting Permissions

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