title: Putting mySQL Database Information into a JavaScript Array
body: <p>What I'm trying to do is create a slideshow by grabbing database information and putting it into a javascript array. I am currently using the jquery ajax function to call information from a separate php file. Here is my php code:</p>
  
  <pre><code>mysql_connect('x', 'x', 'x') or die('Not Connecting');
  mysql_select_db('x') or die ('No Database Selected');
  
  $i = 0;
  $sql = mysql_query("SELECT comicname FROM comics ORDER BY upldate ASC");
  
  while($row = mysql_fetch_array($sql, MYSQL_ASSOC)) {
  echo "comics[" .$i. "]='comics/" .$row['comicname']. "';";
  $i++;
  }
  </code></pre>
  
  <p>What I want is to create the array in php from the mysql query and then be able to reference it with javascript in order to build a simple slideshow script. Please let me know if you have any questions or suggestions.</p>