title: Using switch statements with Mysql and php PDO
body: <p>So I can read two tables by using the following sql statement</p>
  
  <pre><code>$result = $dbc-&gt;query("SELECT table1.*, table2.* FROM table1 INNER JOIN table2 WHERE table1.column_name = 'variable' AND table2.column_name = 'variable2'") 
  </code></pre>
  
  <p>Now I want to use a switch statement to  read from each row determined by the variable in the columns. so for example</p>
  
  <pre><code>$q = $result-&gt;fetch();
  
  switch ($q['column_name']) {
  
  case "i":
   echo ///results
   break;
  
  case "e":
  echo // different results
  break;
  default:
  //whatever code
  }
  </code></pre>
  
  <p>I'm trying to echo two types of images from the two different tables based on the string under the column_name. But the switch method doesn't echo anything so I must not be calling be reading string from the column_name, any help?</p>
  
  <p>Here is the var_dump that I'm getting:</p>
  
  <p>array(46) { ["ad_id"]=> string(1) "1" [0]=> string(1) "1" ["user_id"]=> string(1) "0" [1]=> string(1) "0" ["global"]=> string(0) "" [2]=> string(0) "" ["title"]=> string(7) "Testing" [3]=> string(7) "Testing" ["categories"]=> string(15) "music altnindie" [4]=> string(4) "blog" ["location"]=> string(9) "australia" [5]=> string(7) "austria" ["description"]=> string(16) "New King in town" [6]=> string(8) "A new ad" ["link"]=> string(12) "www.link.com" [7]=> string(12) "www.link.com" ["link_clicks"]=> string(1) "0" [8]=> string(1) "0" ["image_file_path"]=> string(43) "******** 2015-03-07 00.48.33.png" [9]=> string(59) "adimages/11014891_660400880771405_6666691584554052971_n.jpg" ["thumb_file_path"]=> string(52) "********* 2015-03-07 00.48.33.png" [10]=> string(68) "*******-11014891_660400880771405_6666691584554052971_n.jpg" ["date_post"]=> string(19) "2015-05-15 11:14:32" [11]=> string(19) "2015-05-15 12:36:05" ["share_count"]=> string(1) "0" [12]=> string(1) "0" ["type"]=> string(5) "audio" [13]=> string(5) "image" [14]=> string(1) "1" [15]=> string(1) "0" [16]=> string(0) "" [17]=> string(7) "Testing" [18]=> string(15) "music altnindie" [19]=> string(9) "australia" [20]=> string(16) "New King in town" ["plays"]=> string(1) "0" [21]=> string(1) "0" [22]=> string(12) "www.link.com" [23]=> string(1) "0" ["audio_file_path"]=> string(50) "*******/audioI0n7Dr" [24]=> string(50) "*****/audioI0n7Dr" [25]=> string(43) "**** 2015-03-07 00.48.33.png" [26]=> string(52) "***** 2015-03-07 00.48.33.png" [27]=> string(19) "2015-05-15 11:14:32" [28]=> string(1) "0" [29]=> string(5) "audio" }</p>