Firdaus Archive

Blog pribadi untuk curhat, share tentang script, software, kuliah, project IT dan seputar IT.

Cara Crawl / Index Site ke Google

Tidak ada komentar

Kunjungi alamat https://search.google.com/search-console

Klik Menu dibawah ini lalu pilih add properties 

Lalu isikan alamatnya


Lalu verifikasi melalui DNS management add TXT record seperti dibawah ini


Jika sudah klik verify jika berhasil lanjut ke step selanjutnya

Isikan alamatnya seperti gambar di bawah ini



jika sudah tunggu proses maka muncul page di bawah ini



setelah itu Klik Request Indexing

MySQL Pelajari Penting

Tidak ada komentar

 - Limit ... Offset...

- Group_Concat

- Self Join (https://www.educba.com/mysql-self-join/)

MySQL LAST_INSERT_ID() how it works at multi-users environment

Tidak ada komentar

 Untuk mengambil data id yang terakhir di insertkan bisa memakai fungsi berikut

LAST_INSERT_ID()

LAST_INSERT_ID() gives you the last autogenerated id on the connection you execute it on, it does not return the last insert id globally produced by the MySQL server.


sauce : https://stackoverflow.com/questions/5835677/last-insert-id-how-it-works-at-multi-users-environment

MySQL Stored Procedure : Create a procedure to insert and update table header and details in mysql

Tidak ada komentar
Stack Overflow answer powered by AI 
To create a stored procedure in MySQL that can be used to insert and update table header and details, you can follow this example:

DELIMITER //

CREATE PROCEDURE insert_update_table (IN p_header_value VARCHAR(50), IN p_detail_value VARCHAR(50))
BEGIN
    -- Check if the header already exists in the table
    IF EXISTS (SELECT * FROM your_table WHERE header_column = p_header_value) THEN
        -- Update the existing record
        UPDATE your_table SET detail_column = p_detail_value WHERE header_column = p_header_value;
    ELSE
        -- Insert a new record
        INSERT INTO your_table (header_column, detail_column) VALUES (p_header_value, p_detail_value);
    END IF;
END //

DELIMITER ;


In this example, replace your_table with the actual name of your table, header_column with the name of the column where you want to store the header value, and detail_column with the name of the column where you want to store the detail value. To use the procedure, you can call it like this: 

CALL insert_update_table('Header Value', 'Detail Value'); 

 This will either update the existing record with the provided header value and detail value if the header value already exists, or insert a new record with the provided values if the header value doesn't exist in the table.

Displaying URL parameter values as text in an element on webpage

Tidak ada komentar

 source https://stackoverflow.com/questions/71727647/displaying-url-parameter-values-as-text-in-an-element-on-webpage-question-from


<!-- example url https://exampleurl.com/?birthdate=22091977&pdflink=yourlink123.pdf-->


<html>

    <body>

        <span id="birthdate"></span>

</br>

<span id="pdflink"></span>

    </body>

</html>


<script>

    const queryString = window.location.search;

    const urlParams = new URLSearchParams(queryString);

    const birthdate = urlParams.get('birthdate');

    const pdflink = urlParams.get('pdflink');

    document.getElementById("birthdate").innerHTML = birthdate;

document.getElementById("pdflink").innerHTML = pdflink;

</script>