Developing a Dynamic Website 2014 – Part 9 – Using PHP to Display Data from MySQL

Posted on January 29, 2014, 1:55 am
28 secs



You can now get live and scheduled help from us at our NEW Google Helpouts listing! Go here to start a Helpout with Alan today! https://helpouts.google.com/102556382486578836793/ls/acbd5e096c73fe2e

For community help on Atom.CMS and this series go to out GitHub page here: https://github.com/thedigicraft/Atom.CMS/

13 Responses to: Developing a Dynamic Website 2014 – Part 9 – Using PHP to Display Data from MySQL

  1. June 16th, 2014

    How can i get the php code from database? For example i have a page and my body contains this line: <?php include('template/navigation.php'); ?>
    When i echo $page[''body'], i get only the html but the php isn't there. How do i get it?

    Reply
  2. July 21st, 2014

    Shalom! I seem to be getting this error, and I have inserted the code as you have above, though I am using Dreamweaver and not Aptana… 

    Error:  Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in C:xampphtdocsmissionaryenthome.php on line 7

    Any ideas… :)

    Reply
  3. August 9th, 2014

    These are extremely good videos – just what I was looking for. I like how you start out basic and edit things step-by-step to allow us learners to follow your logic. Bravo and thank you!

    Reply
  4. September 19th, 2014

    Use <?=$var?> instead of whole <?php echo $var ?>. It is a lot easier and makes code cleaner. ;)

    Reply
  5. October 7th, 2014

    Why use "<?php echo"  and not "<?="   ? Or will we get to that later?

    Reply
  6. October 26th, 2014

    Thanks so much for these incredible videos. Can I just ask if someone could break down what's happening with the following code please? Really only the second two lines. Thanks 

    $q = "SELECT * FROM pages WHERE id = 1";
    $r = mysqli_query($link, $q);
    $page = mysqli_fetch_assoc($r);

    Reply
  7. December 30th, 2014

    i have a problem :
    mysqli_query() expects parameter 1 to be string
    this the errorr msg i get it 

    Reply
  8. May 17th, 2015

    Just to share my experience on how I solved the bug that a lot of people occur to have.
    Basically, in this line
    $dbc = mysqli_connect('localhost', 'root', 'onako', 'lms') OR die('Could not connect because: '.mysqli_connect_error());
    I wanted to be smart and I put || instead of OR. Just put it back to OR and for me everything worked perfectly :)

    Reply
  9. August 10th, 2015

    my problem is $page['header'];
    it call:undefined variable !!!

    Reply
  10. January 23rd, 2016

    Really what I'm looking for!!! MANY THANKS!!

    Reply
  11. January 27th, 2016

    I am a senior in high school and just got a job for designing a web site from scratch for a memorial service and your videos have helped me out so much! Thanks :)

    Reply
  12. February 15th, 2016

    Hello I got ther error message:
    Warning: mysqli_connect(): (HY000/1045): Access denied for user 'username'@'localhost' (using password: YES) in C:xampphtdocsAtomCMSconfigsetup.php on line 7

    Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in C:xampphtdocsAtomCMSindex.php on line 7

    Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in C:xampphtdocsAtomCMSindex.php on line 9

    could you help me what could be the problem? Thanks in advance

    Reply
  13. March 18th, 2016

    Im getting an error

    Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in C:xampphtdocsAtomCMSindex.php on line 8

    ** EDIT **
    I fixed it.. I was actually calling to the database instead of the table :)

    Reply

Leave a Reply

  • (not be published)