Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6670469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:16:22+00:00 2026-05-26T03:16:22+00:00

I was trying to make a VERY simple CMS for a website for a

  • 0

I was trying to make a VERY simple CMS for a website for a personal project. It’s my first time using MySQL, and one of my first using PHP, so it’s kind of a learning experience. According to everybody I’ve asked, though, this should work. However, all it outputs is the <h1></h1>. I’ve checked everything on my database and table, the column names are right. I’m not trying to make anything to add to the database just yet. I just want to be able to read, and even a simple proof-of-concept isn’t working.

If it matters, I’m using 000webhost for my web hosting.

<?php
$mysql_host = "****";
$mysql_database = "****";
$mysql_user = "sql_blog";
$mysql_password = "*****";

$link = mysql_connect($mysql_host, $mysql_user, $mysql_password);

if (!mysql_select_db($mysql_database, $link)) {
echo 'Database error';
exit;
}

$sql_statement = ('SELECT * FROM Blog_Entries');
$result = mysql_query($sql_statement);
while ($curr_row = mysql_fetch_assoc($result)) {
  echo '<h1>' . $result['Title'] . '</h1>';
}
mysql_free_result($result);
?>

Most of that code is copied from http://guy-lecky-thompson.suite101.com/build-a-blog-or-cms-with-php-a55246 but like I said, it looks like it should work…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:16:22+00:00Added an answer on May 26, 2026 at 3:16 am

    You have an error in your while loop.

     echo '<h1>' . $result['Title'] . '</h1>';
    

    Should be

     echo '<h1>' . $curr_row['Title'] . '</h1>';
    

    When you iterate through the rows you need to use the row, not the pointer to the resultset.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just playing around and trying to make a very simple CMS. Right
Trying to make a call and retrieve a very simple, one line, JSON file.
I have a very simple problem. I'm trying to make an ajax call using
I'm trying to make a very simple iphone app that displays the real-time camera
I'm trying to make a very simple query: $.ajax({ url: ajaxfunc.php, dataType: 'json', success:
Hey i'm trying to make a very simple GUI using SFML, and i want
I am trying to make a very simple object rotate around a fixed point
I am trying to make a very simple web-service which does the following: The
I am trying to make a (very) simple Data Binding test, but it doesn't
Basically what I'm trying to do is make a very simple vertical bullet projectile

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.