0

Here is the database structure:

database structure

How can I find these columns: userId, firstName, lastName, path, file, type, content, size?

I am trying this query now, but it's not working.

SELECT t.userId, t.firstName, t.lastName, p.postId, p.content, p.file, p.type, p.path FROM tbl_users t JOIN post p ON p.userId = t.userId where t.userId = 'er.sharmauttam@gmail.com5a51e9ed426f8';
Mika Sundland
  • 18,120
  • 16
  • 38
  • 50
uttam sharma
  • 5
  • 1
  • 4

1 Answers1

1

if there is a table called tbl_users and post and both of them have userId then this query should help you.and i hope $userId is a variable/parameter

    'SELECT t.userId, t.firstName, t.lastName, p.postId, 
p.content, p.file, p.type, p.path FROM tbl_users t 
INNER JOIN post p ON p.userId = t.userId where t.userId = ' . $userId;
Marvin Collins
  • 379
  • 6
  • 14