[Help] fix error PHP

05/05/2011 07:43 insteadof#1
Notice: Undefined index: in C:\xampp\htdocs\website\top1rb.php on line 8

Notice: Undefined index: in C:\xampp\htdocs\website\top1rb.php on line 11
how to fix this error help me pls !:confused::confused:
05/05/2011 07:52 =Warmonger=#2
Quote:
Originally Posted by insteadof View Post
Notice: Undefined index: in C:\xampp\htdocs\website\top1rb.php on line 8

Notice: Undefined index: in C:\xampp\htdocs\website\top1rb.php on line 11
how to fix this error help me pls !:confused::confused:
Tip #1: [Only registered and activated users can see links. Click Here To Register...].
Tip #2: Delete Xampp as it will cause your server to be hacked.
05/05/2011 08:18 insteadof#3
PHP Code:
<?php
    $msconnect 
mssql_connect("localhost","sa","761989512");
    
$msdb mssql_select_db("character"$msconnect);
    
$plist "SELECT character_name, Reborn FROM [user_character] WHERE Reborn > '0'order by Reborn desc";
    
$pplist mssql_query($plist);

    while(
$list mssql_fetch_array($pplist)){
    if(
$list[''] == "0"){
    
$char "";
    }
    elseif(
$list[''] == "1"){
    
$char "";
    }
    else
    
$char "";
    echo 
$list['character_name'];
    }
?>
help me :(

can someone help me php code show reborn Top list and number reborn
05/05/2011 11:49 lagoni#4
First of all i hope that the password and username in the php script is real.
And then do you have a table in user_character called reborn?
05/05/2011 11:54 TehDauni#5
Its not important. This is a Notice which caused because you use a(or in this case two) variables which aren't declared. Your Script should still work fine. If you want to remove the Notice, just write "error_reporting(0);" in the first Line.

And maybe write echo mysql_error(); after $pplist = mysql_query($plist); than you could see the MYSQL Errors.
05/05/2011 11:58 lagoni#6
Well i am not an expert i just read.
This is from the original php file.
PHP Code:
<?php
//--------------------------------------
//      Written by Janvier123
//      Made for DK servers
//--------------------------------------
// THIS ONLY WORKS IF THERE IS A TABLE IN "USER_CHARACTER" CALLED "REBORN"



    
$msconnect mssql_connect("localhost","sa","pass");
    
$msdb mssql_select_db("character"$msconnect);
    
$plist "SELECT TOP 1 character_name, Reborn FROM [user_character] WHERE Reborn > '0'order by Reborn desc";
    
$pplist mssql_query($plist);

    while(
$list mssql_fetch_array($pplist)){
    if(
$list[''] == "0"){
    
$char "";
    }
    elseif(
$list[''] == "1"){
    
$char "";
    }
    else
    
$char "";
    echo 
$list['character_name'];
    }
?>