kier kier
kier kier

Reputation: 21

how to make a link from the records in mysql?

I have here the code for displaying the records form database..what i want is that i want to make the username a link,and when i click the link username it will open a new window..can somebody please help me with it..because i tried to search from the internet but it not working..

heres the code

 public function dataview($query)
 {

 $stmt = $this->db->prepare($query);
 $stmt->execute();

 if($stmt->rowCount()>0)
 {
 while($row=$stmt->fetch(PDO::FETCH_ASSOC)) {
 echo "<tr>";
 echo "<td> ".$row['user_id']." </td>";
 echo "<td> ".$row['username']." </td>";

 echo "<td> ".$row['password']." </td>";
 echo '<td><a style="float:left"  href="VIEWSAMPLE.PHP?user_id=' .  $row["user_id"] . '>'.$row["username"].'"<input name="image" type="image" value="edit"><image src="image/EDIT.png" class="img-responsive" width="25px"></a>
  <a style="float:left" href="delete.php?user_id=' . $row["user_id"] . '>" <input name="image" type="image" value="delete" onclick="return confirm(\'are you sure?\')"><image src="image/DELETE.png" class="img-responsive" width="25px"> </a></td>';
   echo "</tr>";
   }
 }
 else
 {
 echo "<tr>";
        "<td>Nothing here...</td>";
        "</tr>";
  }
 }
}
?>

here is the code for pop_up(this)

function pop_up(url){ window.open(url,'win2','status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=800,height=600,directories=no,location=no') }

Upvotes: 0

Views: 179

Answers (1)

Vinoth Sd
Vinoth Sd

Reputation: 112

Please post the Javascript code for

pop_up(this)

If any codes written for new window under js method then remove

target="_blank"

in anchor tag.

Upvotes: 1

Related Questions