Answers for "fetch data from phpmyadmin"

PHP
0

fetch data from phpmyadmin

//use this for if statements
$sql = "SELECT * FROM table-name WHERE table-column='variable-in-code' "; //sql code 
$results = mysqli_query($connection-to-database-variable, $sql); //sends sql code

if(mysqli_num_rows($results) > 0){
  $row = mysqli_fetch_assoc($results);
  echo $row['column-name'];
}

//check if data is equal to something
if(mysqli_num_rows($results) == $type){
  echo text;
}


//use this for while loops
//this will display everything in that column
while($row = mysqli_fetch_array($results)){
	echo $row['column-name'];
}
Posted by: Guest on February-03-2021

Browse Popular Code Answers by Language