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.
I simply want to take the string from the first row of my table and save into a php variable called $news1.
$connection = mysql_connect("localhost", "USERNAME", "PW");
if(!$connection)
{
die("<p>no connection to database</p>");
}
if(!mysql_select_db("akron11_db", $connection))
{
die("<p>Kunne ikke finde databasen</p>");
}
$result = mysql_query("SELECT news1 FROM TurenTilDannmark", $connection);
if(!$result)
{
die("<p>Efterspørgslen slog fejl " . mysql_error() . "</p>");
}
$rows = mysql_num_rows($result);
for ($item = 0; $item < $rows; $item++)
{
echo "<li>" . mysql_result($result, $item) . "</li>";
}
echo "</p>";