TCPDF - GET ID
Posted: 2023-01-24 22:36
Hello !
I'm really desperate now and I don't know what to do.
I am trying to implement a PDF generation function in my project - using the TCPDF library.
I can't get ID to copy the variables to my PDF from the table data.
Do you know how I can get the ID from "dv"?
Here I am posting the current code to get the ID - which is not working
Thanks for any advice!
I'm really desperate now and I don't know what to do.
I am trying to implement a PDF generation function in my project - using the TCPDF library.
I can't get ID to copy the variables to my PDF from the table data.
Do you know how I can get the ID from "dv"?
Here I am posting the current code to get the ID - which is not working
Thanks for any advice!
Code: Select all
// Include the main TCPDF library (search for installation path).
require_once '/www/login/vendor/tecnickcom/tcpdf/tcpdf.php';
//1) Připojenà k databázi
$mysqli = new mysqli("localhost", "username", "pass", "db");
//3) NaÄtenà ID z POST nebo GET metody
$pk = $_POST['id'] ?? $_GET['id'] ?? $data['selectedID'];
//4) NaÄtenà promÄ›nných z aktuálnÃho záznamu
$query = "SELECT * FROM objednavky WHERE id = '$pk'";
$result = $mysqli->query($query);
$row = $result->fetch_assoc();
$firma = $row['firma'];
$kontaktni_osoba = $row['kontaktni_osoba'];
$email = $row['email'];
$platce_ico = $row['platce_ico'];
$email = $row['cena_hod'];