hello, I am having issues inserting comma separated values to my database, this is what I have:
$invoiceProducts = "14:12,"; // eventualy the 14:12, will multiply to other values 43:2,34:1,45:1, etc $invoiceProducts = addslashes($invoiceProducts); //stripslashes() to remove the slashes tried with and without stripslashes. $stmt = $conn->prepare("INSERT INTO invoices (invoiceActive, invoiceProducts) VALUES (?, ?)"); $stmt->bind_param("is", 1, $invoiceProducts); $stmt->execute();
Fatal error: Cannot pass parameter 2 by reference
is this the best way to create this row of data? is there a better way?
why wont this work?