Last active
January 17, 2018 20:53
-
-
Save netwons/116240a2c1c905b66663c51cd4e1fd47 to your computer and use it in GitHub Desktop.
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 | |
function select(){ | |
global $connection; | |
$query = " SELECT * "; | |
$query .= " FROM m1 "; | |
$result = mysqli_query($connection,$query); | |
while($row=mysqli_fetch_assoc($result)){ | |
$output = $row["id"] ; | |
$output .= $row["name"] ; | |
$output .= $row["lastname"]; | |
$output .= "<a href=\"edit.php?id=<?php "; | |
$output .= $row["id"]; | |
$output .= "?>"; | |
$output .= "name=\"edit\">Edit</a>"; | |
$output .= "<br>"; | |
} | |
return $output; | |
} | |
?> |
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
function select(){ | |
$output=''; | |
global $connection; | |
$query = ' SELECT * '; | |
$query .= 'FROM m1 '; | |
$result = mysqli_query($connection,$query); | |
$output .= "<table><tr><th>ID</th><th>NAME</th><th>LASTNAME</th></tr></table>"; | |
if(mysqli_num_rows($result) > 0){ | |
while($row=mysqli_fetch_assoc($result)){ | |
$output .= "{$row['id']}"; | |
$output .= " "; | |
$output .= "{$row['name']}"; | |
$output .= " "; | |
$output .= "{$row['lastname']}"; | |
$output .= " "; | |
$output .= "<a href='edit.php?id={$row['id']}'>Edit </a>" ; | |
$output .= "<br>"; | |
} | |
return $output; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
selectupdateجواب میده