![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
KevHopwood
-
Posts
28 -
Joined
-
Last visited
Posts posted by KevHopwood
-
-
Hi all..
I did use a video tutorial.
I used this one: http://www.youtube.com/watch?v=vM6_OCAoiFg
i watched all 7 and it worked perfectly.
What I then did is added a new table to my mysql called "apps" and I replaced all the column names which where column_??? to app_???. I just assumbed that as I have changed the little details then it must work the same.
so can no one tell me where I am going wrong?
-
Hi guys.
I am creating a cms for my own and am rather new to php and databases.
what i want is to simply display each item on my mysql database in a list and display each image with the title next to it.
I currentiy have this code on my index page:
<?php include_once('include/connection.php'); include_once('include/article.php'); $app = new article; $apps = $app->fetch_all(); ?> <html> <head> <title>App Donate</title> <link rel="stylesheet" href="style.css" /> </head> <body> <ol> <?php foreach ($apps as $app) { ?> <li><a href="article.php?id=<?php echo $apps['app_id']; ?>"> <img src="<?php echo $row_getdetails['app_img']; ?>" alt="Image from DB" /> <?php echo $apps['app_title']; ?> </a> <?php } ?> </li></ol> </div> </body> </html>
include/article.php
<?php class article { public function fetch_all(){ global $pdo; $query = $pdo->prepare("SELECT * FROM `apps`"); $query->execute(); return $query->fetchAll(); } public function fetch_data($app_id) { global $pdo; $query = $pdo->prepare("SELECT * FROM apps WHERE app_id = ?"); $query->bindValue(1, $app_id); $query->execute(); return $query->fetch(); } } ?>
my index page can be found HERE
as you can see it has seen that there is 2 posts in my databace but it just is not displaying the content.
please can someone help?
THANK YOU.
display database content
in PHP Coding Help
Posted · Edited by KevHopwood
ALSO
I do check my error_log actually. but it does not bring back any errors. So how can I know what the errors are?
I edit the file via cpannel.