Skip to content

Instantly share code, notes, and snippets.

@netwons
Last active January 17, 2018 20:53
Show Gist options
  • Select an option

  • Save netwons/116240a2c1c905b66663c51cd4e1fd47 to your computer and use it in GitHub Desktop.

Select an option

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

netwons commented Jan 17, 2018

Copy link
Copy Markdown
Author

selectupdateجواب میده

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