The problem is that you are not saving the mysqli connection. Modify your connect to:
$aVar = mysqli_connect('localhost','tdoylex1_dork','dorkk','tdoylex1_dork');
And then add this in your query:
$query1 = mysqli_query($aVar, "SELECT name1 FROM users
ORDER BY RAND()
LIMIT 1");
$aName1 = mysqli_fetch_assoc($query1);
$name1 = $aName1['name1'];
Also, you have to enclose your connections variables as strings as I had done above. This is the reason that's causing the error but you are using the function wrong, mysqli_query returns a query object but to get the data out of this you need to use something like mysqli_fetch_assoc to actually get the data out into a variable as I have above.
Want to be a SQL expert? Come and join this SQL Certification by Intellipaat.
For more information visit :