SHOW:
|
|
- or go back to the newest paste.
1 | - | $youtubeQuery = mysqli_query($conn, "INSERT INTO youtubePosts (id_user, title, description, link) VALUES ('$_SESSION[id_user]', '$ytTitle', '$ytDescription', '$description')"); |
1 | + | <?php |
2 | - | $youtubePostQuery = mysqli_query($conn, "SELECT * FROM post WHERE id_user='$_SESSION[id_user]' AND description='$description'"); |
2 | + | |
3 | - | $ytPostRetrieve = mysqli_fetch_assoc($ytPostRetrieve); |
3 | + | $id_user = $_SESSION[id_user]; |
4 | - | $ytid_post = $youtubePostRetrieve['id_user']; |
4 | + | |
5 | - | $youtube2Query = mysqli_query($conn, "UPDATE youtubePosts SET id_post='$ytid_post' WHERE id_user='$_SESSION[id_user]' AND link='$description'"); |
5 | + | $youtubeQuery = mysqli_query($conn, "INSERT INTO youtubePosts (id_user, title, description, link) VALUES ({$id_user}, '$ytTitle', '$ytDescription', '$description')"); |
6 | ||
7 | // make some comment here | |
8 | $youtubePostQuery = mysqli_query($conn, "SELECT * FROM post WHERE id_user={$id_user} AND description='$description'"); | |
9 | ||
10 | // make some comment here | |
11 | $ytPostRetrieve = mysqli_fetch_assoc($ytPostRetrieve); | |
12 | ||
13 | // make some comment here | |
14 | $ytid_post = $youtubePostRetrieve['id_user']; | |
15 | ||
16 | // make some comment here | |
17 | $youtube2Query = mysqli_query($conn, "UPDATE youtubePosts SET id_post='$ytid_post' WHERE id_user={$id_user} AND link='$description'"); |