Insert a Multidimensional Array into a MYSQL Database
<p>I have an array which is multidimensional. The array is similar to the one below:</p>

<pre><code>  Array =&gt; [link] =&gt; http://www.theqlick.com
  =&gt; [title] =&gt; The Qlick
  =&gt; [description] A great way to connect to the Internet
  =&gt; [keywords] Search Engine, The Qlick, Noah Smith
</code></pre>

<p>and </p>

<pre><code>  Array =&gt; [link] =&gt; http://www.google.com

  =&gt; [title] =&gt; Google
  =&gt; [description] A great search engine
  =&gt; [keywords] Google, the web, search engine
</code></pre>

<p>And for each array similar to the two above, i want it to be 1 row. I have a title, keywords, descriptions and url fields for them to be inputted. But they don't seem to be inputted into the database. Any ideas??</p>

<pre><code>$data = array();
foreach ($links as $link) {
    $output = array(
        "title"       =&gt; Titles($link), 
        "link"        =&gt; $link,
        "description" =&gt; getMetas($link),
        "keywords" =&gt; getKeywords($link) 
    );

    if (empty($output["description"])){ 
        $output["description"] = getWord($link);
    }
    $data[] = $output;
}

print_r($data);  

mysql_query("INSERT INTO scan (title, url, description, keywords) VALUES ('".implode("'),('",$data)."')");

if (!mysql_query()) {
    echo "woops";
}

mysql_close($connect);
</code></pre>
