i have 2 table and more but i want to use another table base on user name login in php mysql so this my table
content Table
kode_content | judul_content | kode_user | deskripsi | nama_lengkap
2 abc 1 tes1 john
3 efg 2 tes2 gerald
4 hij 1 tes3 john
user table
kode_user | username | password | nama_lengkap
1 user1 123 john
2 user2 234 gerald
and i want to display content table from session login username i dont know how to explain cause i newbie so When user login with username above and show judul_content, deskripsi, nama_lengkap base on user login nama_lengkap another judul_content don't show, for example user login with username above with name gerald and this output i want :
output
judul_content | deskripsi | nama_lengkap
efg tes2 gerald
function.php
function get_content($where = ""){
$koneksi = connection();
$data = mysql_query("select content.*, user.judul_content,user.nama_lengkap from content inner join user on content.kode_user = user.kode_user ") or die ("query error");
destroy_connection($koneksi);
return to_array($data);
}
i try to use content.kode_user = '$user'; but not work
Thanks