Jump to content

Marlon06

New Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Marlon06

  1. Like this?

     

    <?php
    // Create connection
     
    $con=mysql_connect("localhost:3306","root","") or die( mysql_error());
     
    if(!mysql_select_db("db1", $con));
     
    $result=mysql_query("SELECT * FROM tblstudent where studentid='" . $txtstudentid . "'");
     
    echo "<table border=1>
    <tr>
    <td colspan=3 align=center> Student Records </td>
    </tr>
    <tr>
    <td> Student ID </td>
    <td> Firstname </td>
    <td> Lastname </td>
    </td>
    ";
    while($row=mysql_fetch_array($result))
    {
    $studnum=$row['studentid'];
    $fname=$row['firstname'];
    $lname=$row['lastname'];
     
    echo "<tr>
    <td> $studnum </td>
    <td> $fname </td>
    <td> $lname </td>
    </tr>";
    }
    echo "</table>";
     
    ?>
     
    Still Error
  2. <?php

    // Create connection

    $txtstudentid;

     

    $con=mysql_connect("localhost:3306","root","") or die( mysql_error());

     

    if(!mysql_select_db("db1", $con));

     

    $result=mysql_query("SELECT * FROM tblstudent where studentid='". $_txtstudentid ."'");

     

    echo "<table border=1>

    <tr>

    <td colspan=3 align=center> Student Records </td>

    </tr>

    <tr>

    <td> Student ID </td>

    <td> Firstname </td>

    <td> Lastname </td>

    </td>

    ";

    while($row=mysql_fetch_array($result))

    {

    $studnum=$row['studentid'];

    $fname=$row['firstname'];

    $lname=$row['lastname'];

     

    echo "<tr>

    <td> $studnum </td>

    <td> $fname </td>

    <td> $lname </td>

    </tr>";

    }

    echo "</table>";

     

    ?>

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.