Skip to content

Instantly share code, notes, and snippets.

@netwons
Last active January 17, 2018 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netwons/116240a2c1c905b66663c51cd4e1fd47 to your computer and use it in GitHub Desktop.
Save netwons/116240a2c1c905b66663c51cd4e1fd47 to your computer and use it in GitHub Desktop.
<?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;
}
?>
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 .= "&nbsp";
$output .= "{$row['name']}";
$output .= "&nbsp";
$output .= "{$row['lastname']}";
$output .= "&nbsp";
$output .= "<a href='edit.php?id={$row['id']}'>Edit </a>" ;
$output .= "<br>";
}
return $output;
}
}
@netwons
Copy link
Author

netwons commented Jan 17, 2018

selectupdateجواب میده

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment