title: SQL query to save row value into php variable
body: <p>I see several questions relating to my problem, but I'm very new to programming and cant figure out half the responses. Below is the only thing I have gotten working for getting data out of my table, it is however doing way more than I need it to, and still giving me an undesired result.</p>
  
  <p>I simply want to take the string from the first row of my table and save into a php variable called <code>$news1</code>.</p>
  
  <pre><code>$connection = mysql_connect("localhost", "USERNAME", "PW");
  
  if(!$connection)
  {
      die("&lt;p&gt;no connection to database&lt;/p&gt;");   
  }
  
  if(!mysql_select_db("akron11_db", $connection))
  {
      die("&lt;p&gt;Kunne ikke finde databasen&lt;/p&gt;");
  }
  
  $result = mysql_query("SELECT news1 FROM TurenTilDannmark", $connection);   
  
  if(!$result)
  {
      die("&lt;p&gt;Efterspørgslen slog fejl " . mysql_error() . "&lt;/p&gt;");   
  }
  
  $rows = mysql_num_rows($result);
  
  for ($item = 0; $item &lt; $rows; $item++)
  {
      echo "&lt;li&gt;" . mysql_result($result, $item) . "&lt;/li&gt;";  
  } 
  
  echo "&lt;/p&gt;"; 
  </code></pre>