Question: ```
function connect(){
$db = new mysqli(localhost, bludevel_PMI, password1, bludevel_PMIForm);
if ($db->connect_errno) {
        echo json_encode(array($mysqli->connect_error));
    return false;
        exit();
}}

function disConnect(){
mysqli_close($db);
}

function downloadData(){
if ($_POST['cmd'] == "downloadData"){

$result = $db->query("SELECT * FROM Jobs");//error on this line
if($result){

    while ($row = $result->fetch_array()){
    $jobs[$row['PMINumber']] = $row['Address'];
    }
    //$result->close();
        //$db->next_result();
}

$result = $db->query("SELECT * FROM Installers ORDER BY `Order` ASC");
if($result){

    while ($row = $result->fetch_array()){
    $installers[] = $row['Names'];
    }
    //$result->close();
        //$db->next_result();
}
echo json_encode(array($jobs, $installers));
return true;

}}

```

I get the error `PHP Fatal error: Call to a member function query() on a non-object`
when i run this script. $db is indeed an object and i've used it successfully in other
functions, so the problem must lie within the function itself. I'm new to php so any 
help is much appreciated.

Answer: 
Yes, VARCHAR is the preferred datatype to store strings.

Storing multiple values in the same field is not preferred, however. A multivalued attribute is usually implemented as a table in the database design.
VARCHAR will work for you. But it does not mean that this is the right way to do it.

You should consider creating schema that stores each sub-string in separate row or column. This way data will be easier to read, write and, most importantly, search.