PHP Programming/smarty/tutorials/simple
From Wikibooks, the open-content textbooks collection
< PHP Programming | smarty | tutorials
This tutorial is written by User:Wykis and may be used in any educational and non-commercial way. Please add comments in Talk:Programming:PHP:smarty:tutorials:simple and if you modify this tutorial, please add your name below:
- User:Wykis, Full tutorial
Please note that the script is not tested as i don't have a lot of time for this, so check for errors. Best place to ask on is [[irc://irc.freenode.org/php.
- index.tpl as necessary ( notice the $db in index.php, change it to your settings!
- Now, using y
== our MySQL Client ([[1]]/[[2]] or other tools), add new rows in your table, with content and it's title. Try it with three at the start.
- Now, go to your
== directory Web
[edit] site through your Web Browser ( you might need to upload it to your web server or set one up on your computer ) ;)
]] If you have any problems, go to ask on IRC [[3]] or contact me. I haven't tested this script yet so you might find some small mistakes.
- For the later versions of Mysql use the following code
CREATE TABLE `test_content` ( `content_id` INT(11) NOT NULL AUTO_INCREMENT, `content_title` VARCHAR(255) NOT NULL, `content_date` DATETIME NOT NULL, == `content_content` TEXT == NOT NULL, `content_position` INT(11) NOT NULL, PRIMARY KEY (`content_id`) ) TYPE = myisam;