need help for query code export from 2table (by php) in mysql

24
April 16, 2019, at 02:10 AM

i need code for export favs in table. i make 2 table in mysql one : tbl_post two : tbl_markshow . in tbl_post : id,masterid,note and in tbl_markshow : id,masterid,studentid . I need only to display the records that masteruser has registered for the student ! Table mark show Table post Approach

i make code but don't work

$result = $conn->query("Select * From tbl_markshow,tbl_post Where tbl_post.masteruser=tbl_markshow.masteruser AS tbl_markshow.studentuser='943167348' order by id desc");
Answer 1

Final query:

$result = $conn->query("SELECT *
FROM tbl_post
WHERE masteruser IN
    (SELECT masterid
     FROM tbl_markshow
     WHERE studentuser = $studentuser)
ORDER BY id DESC");

Just need this code:

tbl_post where masteruser in(select masterid from tbl_markshow where studentuser = $studentuser)
READ ALSO
Implementing Auto-Bidding Functionality with JSP/MySQL

Implementing Auto-Bidding Functionality with JSP/MySQL

Currently working on a project and could use some advice for how to approach implementing an Auto-Bidding system for a web application similar to Ebay

18
Calculate duration for bookings in a period between two time slots

Calculate duration for bookings in a period between two time slots

In a booking system I want to calculate the sum of hours a resource has been booked between two dates (2019-01-01 to 2019-01-02) from 8am to 4pm

13
MYSQL: Copy all data and structure if not exist

MYSQL: Copy all data and structure if not exist

i have two database new and old database

17
Mysql Select find third week and day of week from table date

Mysql Select find third week and day of week from table date

I have a MySQL select query that I am trying to get the third Thursday from a date in my table here is what I have for the query any help would be greatly appreciated

21