What are some potential pitfalls of storing multiple items in a single text field in PHP?

Storing multiple items in a single text field in PHP can make it difficult to query or manipulate the data efficiently. It can also lead to issues with data integrity and make it harder to extract individual items from the field. To solve this issue, it's better to store each item in a separate field or use a relational database structure.

// Example of storing multiple items in separate fields
$item1 = "item1";
$item2 = "item2";
$item3 = "item3";

// Inserting into database
$sql = "INSERT INTO items_table (item) VALUES ('$item1')";
$result = mysqli_query($conn, $sql);

$sql = "INSERT INTO items_table (item) VALUES ('$item2')";
$result = mysqli_query($conn, $sql);

$sql = "INSERT INTO items_table (item) VALUES ('$item3')";
$result = mysqli_query($conn, $sql);