As in the loop display random values?

There are 2 databases:
1)Names
id | names |
1 | Manele |
2 | valera |
3 | vladislav |

etc., say 1 thousand names

2)Locations
id | locations
1 | Ukraine |
2 | Island |
3 | Spain |

etc. let's say 300 locations

so, how do I output through a loop for example 100 random names and through the gap next to the names of 100 random locations?
April 7th 20 at 10:59
2 answers
April 7th 20 at 11:01
To write SQL to select from the database a random string
https://habr.com/ru/post/207096/
April 7th 20 at 11:03
$sql = R::getAll( 'SELECT * FROM users, locations ORDER BY rand() LIMIT 3' );

foreach ($sql as $sq) {
 echo $sq['names']." ".$sq['locations']."<br/>";
}
Do not forget that RAND() in Mysqlslow speed - Drew_Conn commented on April 7th 20 at 11:06

Find more questions by tags PHP