Jump to content

Recommended Posts

hello Php Freaks,

 

i have manage to make a search box and view the student name listed on the database with a link VIEW, EDIT, DELETE on the left side. 

My problem is i wanted that when i click the VIEW it must direct to a specific student which name appeared on the right side.

 

This is my ajax.php code.

$display_string = "<table border='1' cellpadding='10' cellspacing='1' align='center'>";
$display_string .= "<tr align='center'>";
$display_string .= "<th>LR Number</th>";
$display_string .= "<th>F i r s t   N a m e</th>";
$display_string .= "<th>L a s t   N a m e</th>";
$display_string .= "<th>Grade</th>";
$display_string .= "<th>Section</th>";    
$display_string .= "<th>View</th>";  
$display_string .= "<th>Update</th>";
$display_string .= "<th>Delete</th>";
$display_string .= "</tr>";

// Insert a new row in the table for each person returned
while($row = mysql_fetch_array($qry_result)){
 $display_string .= "<tr>";
 $display_string .= "<td>$row[LRN]</td>";
 $display_string .= "<td>$row[first_name]</td>";
 $display_string .= "<td>$row[last_name]</td>";
 $display_string .= "<td>$row[grade]</td>";
 $display_string .= "<td>$row[section]</td>";
 $display_string .= "<td><a href='View_Profile.php?userID=$row[student_id]'>View</a> </td>";
$display_string .= "<td><a href='Admin_Edit_Student_Info.php?userID=$row[student_id]''>Update</a></td>";
$display_string .= "<td><a href='Admin_Delete_Student.php?userID=$row[student_id]''>Delete</a></td>";
 $display_string .= "</tr>"; 

and this is the Student_home.php

            <p align="left"> </p>
            <p align="left"><span class="stylebig">LEARNERS INFORMATION</span></p>
          </blockquote>
        <table width="85%"  align="center">
          <tr class="stylesmall">
            <td height="50" align="left" valign="middle" class="style3 style8"> LRN</td>
            <td align="left" valign="middle" class="style8"> </td>
            <td align="left" valign="middle" class="style8"> </td>
            <td class="style8"> </td>
          </tr>
          
          <tr class="stylesmall">
            <td width="142" height="50" align="left" valign="middle" class="style8">First Name</td>
            <td width="177" align="left" valign="middle" class="style8"> </td>
            <td width="151" align="left" valign="middle" class="style8">Last Name</td>
            <td width="159" class="style8"> </td>
          </tr>
          <tr class="stylesmall">
            <td width="142" height="50" align="left" valign="middle" class="style8">Gender</td>
            <td align="left" valign="middle" class="style8"> </td>
            <td align="left" valign="middle" class="style8">Date Of Birth</td>
            <td class="style8"> </td>
          </tr>
          <tr class="stylesmall">
            <td width="142" height="50" align="left" valign="middle" class="style8">Grade</td>
            <td align="left" valign="middle" class="style8">        
            <td align="left" valign="middle" class="style8">Contact No</td>
            <td class="style8"> </td>
          </tr>

          <tr class="stylesmall">
            <td width="142" height="50" align="left" valign="middle" class="style8">Primary Email</td>
            <td align="left" valign="middle" class="style8"> </td>
            <td align="left" valign="middle" class="style8">Secondary Email</td>
            <td class="style8"> </td>
          </tr>
          <tr align="left" valign="middle" class="stylesmall">
            <td width="142" height="50" class="style8">Address</td>
            <td class="style8">        
          <tr align="left" valign="middle" class="stylesmall">
            <td width="142" height="50" class="style8">Description</td>
            <td class="style8">        
            <td class="style8"></td
        >
          </tr
    
  >
        </table>
      </div>

i think i miss some lines of codes in the target page (Student_home.php).

Please i am a newly practicing php coder. Help me clarify lines which i have mistaken and how to replace/correct/insert on the proper place.

God bless everyone,

Link to comment
https://forums.phpfreaks.com/topic/288277-search-with-view-edit-delete-function/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.