Last active
January 25, 2018 10:19
-
-
Save arif98741/7467fa59738f1e7426e42183b738b010 to your computer and use it in GitHub Desktop.
Passing data from database in href
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$con = new mysqli("localhost", "root", "", "test"); | |
$sql = "select * from userdata"; //userdata is a table | |
$stmt = $con->query($sql); | |
if($stmt){ | |
if($stmt->num_rows>0){ | |
$row = $stmt->fetch_assoc();?> | |
<a href="something.php?userid=<?php echo $row['userid']; ?>">Go To Something Page</a> | |
<?php } | |
} | |
//follow this process in same way | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment