Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2005
    Location
    UK, London
    Posts
    762

    php script (help need for debuggin it)

    hey everyone,

    this is a simple script i made to pull the details from a mysql database. I keep getting random errors with it, e.g.

    Parse error: parse error in root\htdocs\members\admin.php on line 4
    this is my code which the error is comming from

    PHP Code:
    <?php

    $host
    ="localhost"
    $user="*******"
    $pass="********"
    $database="********"

    mysql_connect($host,$user,$pass);
    @
    mysql_select_db($database) or die("Unable to select databasse");

    $query="SELECT * FROM users";
    $result=mysql_query($query);

    $num=mysql_numrows($result);

    mysql_close();

    echo 
    "<b>Member List</b><br><br>";

    $i=0;
    while (
    $i $num){

    $user=mysql_result($result,$i,"username");
    $pass=mysql_result($result,$i,"password");
    $date=mysql_result($result,$i,"regdate");
    $email=mysql_result($result,$i,"email");
    $site="mysql_result($result,$i,"website");
    $location="mysql_result($result,$i,"location");
    $show="mysql_result($result,$i,"show_email");
    $last="mysql_result($result,$i,"last_login");

    echo 
    "<b>User Name : $user</b><br><b>Passowrd : $pass</b><br><br>Registered On : $date<br>E-Mail Address : $mail<br>
    Website : 
    $site<br>Location : $location<br>Show E-Mail : $show<br>Last Login : $last<br><br>";

    $i++;

    }

    ?>
    can anyone help me debug it plz.

    thanks in advance for any help.
    tc everyone

  2. #2
    Join Date
    Oct 2003
    Location
    Tas, Australia
    Posts
    2,488
    Code:
    $host="localhost" ;
    $user="*******" ;
    $pass="********"; 
    $database="********";
    You missed the semi colons for that...
    New site: www.talkutas.com

  3. #3
    Join Date
    Oct 2002
    Location
    EU - east side
    Posts
    21,913

  4. #4
    Join Date
    Jan 2005
    Location
    UK, London
    Posts
    762
    haaaa hahaha hah h a

    stupid mistake

    let me try it.. hope it works.

  5. #5
    Join Date
    Jan 2005
    Location
    UK, London
    Posts
    762
    well, thanks alot freak, your suggestion worked nice.

    now i gotz a new error

    Parse error: parse error in root\htdocs\members\admin.php on line 27

  6. #6
    Join Date
    Jan 2005
    Location
    UK, London
    Posts
    762
    it appears, that this error:

    Parse error: parse error in root\htdocs\members\admin.php on line 27
    was produced because i addded this " after the = on the array/variable or what ever.

    e.g. $site="mysql_select

    anywayz. i fixed that bug

Posting Permissions

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