There is NOT mentioned a database only a table and where to put all the code and what should this file be called? I just copied all the code and pasted it in a index.php file but then what to do?
Have you made this tutorial Olaf?
Global Moderator
Internet Junkie
Gender:
Posts: 1807
9006 credits Members referred : 6
« Reply #7 on: Jun 18, 2007, 09:39:40 PM »
The tutorial mentions it is 'powered by PHP and MySQL' MySQL = database, and the table would be the database table that is used to store the menu items in.
the
Code:
CREATE TABLE `dyn_menu` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `label` VARCHAR(50) NOT NULL DEFAULT '', `link_url` VARCHAR(100) NOT NULL DEFAULT '#', `parent_id` INT(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) TYPE=MyISAM;
part is the MySQL command to create the database table.
« Last Edit: Jun 18, 2007, 09:41:32 PM by Mind_nl »
Atari ST fan
Posts: 7
46 credits Members referred : 0
« Reply #10 on: Jun 19, 2007, 03:52:27 PM »
I have got some help from a danish forum and my testsite can now be seen here http://www.tinemuller.dk/2level_tutorial/ but he say that I need a connections to mysql but as being a beginner and not told in the tutorial it's not so easy, sorry.:-(
It could also be told a little more clear how and what to write in the database for it to work.
I think you should write this two things in the tutorial so other beginners don't have to waste so much time as I had.
Now I have to figure out how to make the connection?
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6277
38488 credits Members referred : 374
I have got some help from a danish forum and my testsite can now be seen here http://www.tinemuller.dk/2level_tutorial/ but he say that I need a connections to mysql but as being a beginner and not told in the tutorial it's not so easy, sorry.:-(
It could also be told a little more clear how and what to write in the database for it to work.
I think you should write this two things in the tutorial so other beginners don't have to waste so much time as I had.
Now I have to figure out how to make the connection?
do you checked the PHP manual? (never said that this tutorial is for beginners )
or try to search the net for some php/mysql beginner tutorial
Global Moderator
Internet Junkie
Gender:
Posts: 1807
9006 credits Members referred : 6
« Reply #12 on: Jun 19, 2007, 04:18:37 PM »
After setting up your database and creating your table you should know how to connect to it, this is very basic stuff and not part of many tutorials. Here's one way of connecting:
Code:
<?php // database connection details $db_host = "localhost";// hostname of your MySQL server. You most likely don't have to change this $db_name = "yourDBname";// database name $db_user = "yourDBusername";// database user $db_pass = "yourDBpassword";// database password
// Lets open up a connection to the database $db = mysql_connect($db_host,$db_user,$db_pass); mysql_select_db ($db_name) or die ("Cannot connect to database");