SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Apr 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Undefined Index Issue

    i am doing project in php and mySqll i am getting error like Undefined index: route in C:\wamp\www\new22\list.php on line 222.
    my code is as follows
    PHP Code:
    <?php
    $url 
    $_POST["route"];
    $user_name "root";
        
    $password "";
        
    $database "locations";
        
    $server "127.0.0.1";

    $db_handle mysql_connect($server$user_name$password);
    $db_found mysql_select_db($database$db_handle) or die(mysql_error);

    if (
    $db_found) {

    $SQL "select * from notes where route='$url'";
    $result mysql_query($SQL) or die(mysql_error);
    echo 
    "<table border=1>";
    echo 
    "<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name</td>
    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ADDRESS</td><td>ROUTE</td></tr>"
    ;

    while (
    $db_field mysql_fetch_assoc($result)) {
    echo 
    "<tr>";
    echo 
    "<td>".$db_field['name'] . "</td>";
    echo 
    "<td>".$db_field['address'] . "</td>";
    echo 
    "<td>".$db_field['route'] . "</td>";
    echo 
    "</tr>";
    }

    echo 
    "</table>";
    mysql_close($db_handle);

    }
    else {

    print 
    "Database NOT Found ";
    mysql_close($db_handle);
    }



    ?> 
    </td></tr>    
            
    </table>

        </div>


    please tell me how i can resolve this problem.
    thanku
    Last edited by cpradio; Apr 22, 2013 at 07:38.


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
  •