Note that there are some explanatory texts on larger screens.

plurals
  1. POCant display text from database
    primarykey
    data
    text
    <p>I have like a news feed on my site. You can post news on a post.php site, and when you post a news the news come up on this news.php. The code looks like this:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang='en'&gt; &lt;head&gt; &lt;style type="text/css"&gt; element { color: black; } body { -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-attachment: fixed; background-image: url(bgn1.png); background-repeat: no-repeat; background-position: center top; } .news { font-family: Rough_Typewriter; font-size: 36px; } &lt;/style&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;iWrite&lt;/title&gt; &lt;meta name="view" content="width-device-width, initial-scale=1.0"&gt; &lt;meta name="description" content=""&gt; &lt;meta name="keywords" content=""&gt; &lt;link href="css/bootstrap.css" rel="stylesheet"&gt; &lt;/head&gt; &lt;h1 class="news"&gt;iWrite&lt;/h1&gt; &lt;p&gt; &lt;hr&gt; &lt;p&gt; &lt;p&gt; &lt;p&gt; &lt;p&gt; &lt;p&gt; &lt;p&gt; &lt;p&gt; &lt;p&gt; &lt;p&gt; &lt;a href='post.php'&gt;Want to post a text?&lt;/a&gt; &lt;?php //connect mysql_connect("myserver","username","password") or die(mysql_error()); mysql_select_db("databasename") or die(mysql_error()); //query the database $getnews = mysql_query("SELECT * FROM news ORDER BY id DESC") or die(mysql_query()); while ($row = mysql_fetch_assoc($getnews)) { //get data $id = $row['id']; $title = $row['title']; $body = $row['body']; $date = $row['date']; echo " &lt;b&gt;$title posted on $date&lt;/b&gt;&lt;br&gt; "; echo nl2br($body); echo "&lt;hr&gt; "; } ?&gt; </code></pre> <p></p> <p>But when it displays it on the index.html site it just echo out $title posted on $date.... Please help me!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload