Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

select randomly from mysqli php

<?php
	require'conn.php';
 
	$query=mysqli_query($conn, "SELECT * FROM `person` ORDER BY rand() LIMIT 6") or die(mysqli_error());
	while($fetch=mysqli_fetch_array($query)){
		echo"<tr>";	
		echo"<td>".$fetch['p_id']."</td>";
		echo"<td>".$fetch['firstname']."</td>";
		echo"<td>".$fetch['lastname']."</td>";
		echo"</tr>";
	}
?>
Source by www.sourcecodester.com #
 
PREVIOUS NEXT
Tagged: #select #randomly #mysqli #php
ADD COMMENT
Topic
Name
3+7 =