Jump to content

sulkhanz

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sulkhanz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks, so, should i replace $Firstname with $_POST['Firstname'] ? in my get1.php?
  2. Urgent help needed. i am a newbie, and starting to have a headache with this problem, i am using form to enter firstname so that all the details of that person can be pulled. where am i doing it wrong? its showing me the headings of firstname, lastname, and age but no data in it. when data is actually available in database. databasename=testdb table name = persons1 please check both of my files below. 1) Pullform.html <html> <body> <form action="get1.php" method="post"> <strong>last:</strong> <input type="text" name="Firstname" /> <input type="submit" name="submit" value="Check employee" /> </form> </body> </html> 2) get1.php <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("testdb", $con); // by just adding ORDER By, i could fetch info in alphabetical order. $sql = ("SELECT * FROM persons1 WHERE Firstname='$Firstname'"); $result = mysql_query($sql); echo "<table border='1'> <tr> <th>Firstname</th> <th>Lastname</th> <th>Age</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['Firstname'] . "</td>"; echo "<td>" . $row['Lastname'] . "</td>"; echo "<td>" . $row['Age'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?>
×
×
  • 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.