yes, you would need to join the two tables on primary / foreign key. Also, you can introduce filtering by adding conditional statements after the join.
example:
Select a.user_id, a.user_name, b.writing_stats
from T_TABLE_1 as a
join T_TABLE_2 as b on b.user_id = a.user_id
Rich, I am not getting an error, but I am also not getting a return, Here is the code:
$con = mysqli_connect(“localhost”,“UserName”,“Password”,“DatabaseNamel”) or die(“Not connected.”);
$sql = ‘Select a.user_id, a.user_name, b.writing_stats from users as a join writing_stats as b on b.user_id = a.user_id WHERE writing_date = CURRENT_DATE ORDER BY word_count DESC’;
$result = mysqli_query($con,$sql);
The sql inside your $sql variable does not require the apostrophes, and they look like the wrong type of apostrophes as well. Try removing them and run again. There also appears to be a stray semicolon at the end.