How to create a CMS with PHP // Part 2 – Getting rows from our database

August 22nd, 2010 by admin

In this series I’ll show you how to make a CMS with PHP using modern techniques using Classes and Functions to get the best result on your page.

Duration : 0:10:37


, , , , , , , , , , , , , , , , , , , ,

25 Responses to “How to create a CMS with PHP // Part 2 – Getting rows from our database”

  1. yawnx2 Says:

    i get this error:

    i get this error:
    Parse error: syntax error, unexpected T_VARIABLE in [---my directory---] on line 9

  2. darkknightgaury Says:

    Your way is fine …
    Your way is fine however, create a constructor that takes username,password, database name and host. Once you instantiate the class $obj=new ModernCMS(“username”,”password”,”host”,”dbName”);
    In the constructor you can set the var at the top and call the function connect();

    Your example is bleeding from the class. You want to try to encapsulate.
    In another note Good job !

  3. fungames2 Says:

    Did you take a …
    Did you take a summer class or go to school to learn some of this?

  4. jelco222 Says:

    @jorgerko15 tyvm!
    @jorgerko15 tyvm!

  5. jorgerko15 Says:

    @G15BT add echo …
    @G15BT add echo between <?php (here) $obj

  6. fallendown2005 Says:

    @ivolol if they …
    @ivolol if they can’t understand this then MVC will really lose them…lol

  7. javarnanda Says:

    Thank u so much for …
    Thank u so much for this great tutorial…but now im stuck!
    me too …I have followed this video,and in my index.php i visualize:
    get_content()”) ?>

    what’s the problem?
    i read the comments below…and i realize that im not the first one with this problem.
    If you can help me, i really apprecciated! greetings from italy!

  8. G15BT Says:

    I have followed …
    I have followed this, all i get in my index.php is:

    get_content()”) ?>

    Any solutions?
    Thanks

  9. zacharney1 Says:

    hey, when i add the …
    hey, when i add the code $obj->host the -> part stops the code and it wont work

  10. Kiajw Says:

    I think that this …
    I think that this is a great series. The only thing is that prefacing the examples you say that you aren’t going to go into great detail, because people can ask around. I think that the purpose of doing a tutorial is to explain, and go into detail. Otherwise why do it. For example, tutvid does GREAT tutorials on all types of things, and he goes into great detail, which is why so many people watch his stuff. If he did CMS I would be there. People want to learn.

  11. wankshit Says:

    p.s, the part im at …
    p.s, the part im at is around 6.30, when i try to test the connection i get the aformentioned error

  12. wankshit Says:

    Hey, i’m stuck …
    Hey, i’m stuck roughly half way through this video. I’ve finished the first complete part of cms_class.php and have everything down to a T, ive checked every piece of punctuation against the lines in the video and still i get:
    “Parse error: syntax error, unexpected ‘)’ in /Applications/XAMPP/xamppfiles/htdocs/tensai_cms/_class/cms_class.php on line 13″
    I know roughly what this error means and have checked over all brackets etc and its exactly the same! What am I doing wrong?

  13. backbreaker95 Says:

    is there anyone …
    is there anyone here that can help me with a database that can support 10000 people and there login info. and points they can earn points and redeem them for prizes anyone who can help me and wants to get in to this website with me message me! plz

  14. ScoobyDooobyD00 Says:

    I logged into my …
    I logged into my other account, sorry if there was any confusion.

  15. LDDCreations Says:

    MVCs are great but …
    MVCs are great but it is fairly difficult to build a good MVC from scratch. One of the reasons for making this series was to introduce classes in PHP so I could create another series on building an MVC similar to Code Igniter. My problem was trying to link a database class and pull results in my view file from the controller.

  16. ivolol Says:

    This still isn’t …
    This still isn’t really modern… most new stuff is following the MVC model these days.

  17. mine070 Says:

    I have a online …
    I have a online payed for Linux server.

  18. emadmoussa Says:

    check your database …
    check your database password or privileges. or restart apache. If this problem continues, try to remove and reinstall xampp or wamp.
    you can save the tables you already created by using ”export” and then once xampp is reinstalled, create a new database and ”import” the tables back into it…and bingo fresh start.

  19. mine070 Says:

    I get this :

    I get this :
    Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘root’@'localhost’ (using password: NO) in /home/simplit/public_html/tester/_class/cms_class.php on line 11
    Access denied for user ‘root’@'localhost’ (using password: NO)

  20. GreenyFool Says:

    Great series mate, …
    Great series mate, really helping me start off in PHP. (Y)

  21. FireDartOnline Says:

    Hey great series, I …
    Hey great series, I am having a problem. I get this:
    get_content()?>

    where it should display the content from the database.

    Got any idea?
    -FireDart

  22. CamiloSanchez1979 Says:

    nicely done doggie
    nicely done doggie

  23. zeckdude Says:

    This CMS series is …
    This CMS series is excellent! I am learning alot very quickly! You should consider getting some of your work on Nettuts, you have good quality tuts!

  24. Kj3k53 Says:

    Great!
    Great!

  25. crazymanny00 Says:

    excellent vid, …
    excellent vid, thanks for recommending this to me. i learnt a lot. : D

RSS Feed