The following query works fine in SQL but not as an SQL Query in PHP for some reason. The error message is as follows:
Incorrect integer value: 'SELECT id FROM colours WHERE colour = ' for column
databasename.numbers.col_idat row 1
$redID = "SELECT id FROM colours WHERE colour = $red";
$populate = "INSERT INTO numbers (col_id) VALUES ('$redID')";
$result=$conn->query($populate);