Last active
August 29, 2015 14:02
-
-
Save sebbdk/3b9f43850a1f10b0a459 to your computer and use it in GitHub Desktop.
Henrik code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foreach ($artikler as $row) { | |
| $link = htmlspecialchars($row['link']); | |
| $titel = $row['title']; | |
| $date = $row['date']; | |
| $author = $row['rss_title']; | |
| $findlinkQry = "SELECT * FROM rss_artikler WHERE link = '$link'"; | |
| $result = mysql_query($findlinkQry) or die(mysql_error()); | |
| if(mysql_num_rows($result) === 0) {//if the link does not exist, add it, then find it | |
| $saveQuery = "INSERT INTO rss_artikler VALUES($titel', '$date', '$author', '$link', 1)"; | |
| $saveSuccess mysql_query($saveQuery); | |
| var_dump($saveQuery); | |
| $result = mysql_query($findlinkQry) or die(mysql_error()); | |
| } | |
| var_dump($result); | |
| $rows = mysql_fetch_array($result); | |
| echo '<article>'; | |
| $id = $rows['id']; | |
| echo "<a href='updatecount.php?id=$id'>"; | |
| echo '<h4>' . $row['title'] . ' '; | |
| echo '<span class="color3"> (' . date('H:i', strtotime($row['date'])) . ')</span><span class="color2"> ' . $row['rss_title'] . '</span></h4></a>'; | |
| echo '<hr>'; | |
| echo '</article>'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment