danielkraus Posted September 21, 2008 Share Posted September 21, 2008 I have a home test server set up with WAMP. Do I need to learn the basics of php before I start with SQL and MySQL. I am building my first site and have a ton of content that can be categorized in many different ways, and is in most cases. I first looked at XML but I was advised that MySQL would be better suited to my needs. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
Ruud Hermans Posted September 22, 2008 Share Posted September 22, 2008 No, you do not need to learn PHP first.I'm learning SQL now to from www.w3schools.com tutorials. You can also run queries in PHPMyAdmin ore sqlitemanager if you use WAMP. Link to comment Share on other sites More sharing options...
danielkraus Posted September 22, 2008 Author Share Posted September 22, 2008 Thanx! I looked for the phpAdmin in hte server files but could not locate it. Am I missing something? Link to comment Share on other sites More sharing options...
Ruud Hermans Posted September 23, 2008 Share Posted September 23, 2008 Thanx! I looked for the phpAdmin in hte server files but could not locate it. Am I missing something?You are running WAMPSERVER I presume.Then you can go to localhost and link from the index page of your www folder.Ore click on the icon on the right bottom of your screen (next to the clock) and it will be listed there. Link to comment Share on other sites More sharing options...
smartalco Posted September 24, 2008 Share Posted September 24, 2008 although learning php to use mySQL in a website isn't required, you are going to need some way to put/retrieve info from the SQL database, and php would definitely not be a bad choice for that Link to comment Share on other sites More sharing options...
Ruud Hermans Posted September 24, 2008 Share Posted September 24, 2008 although learning php to use mySQL in a website isn't required, you are going to need some way to put/retrieve info from the SQL database, and php would definitely not be a bad choice for thatDepends, maby he wants to use it fo home use only to make a adressbook form example. Btw. if MySQL is installed you should also have access to the console. Link to comment Share on other sites More sharing options...
h4xnoodle Posted September 25, 2008 Share Posted September 25, 2008 If you're using WAMP/LAMP just typehttp://localhost/phpmyadminand you should get to the right place.You will need to learn PHP or ASP to interact with the database later to retrieve and store information. Link to comment Share on other sites More sharing options...
danielkraus Posted September 27, 2008 Author Share Posted September 27, 2008 Thanx everyone. I got it now. I am now trying to figure the best or most efficient way of handling my data. I have about 300 companies that will be categorized. But each company can and will be in multiple categories. each comapny will have a URL, name, location(as in physical), a blog address if applicable, and 2 descriptions, one long and one short.My thoughts were to set up relational tables via a key. The first table would contain all of the data but the category. Then uasing the key, have a second table containing all of the possible categories for each company, leaving category fields empty if the category does not apply. Then use JOIN to get the data I need to be presented on the XHTML page.This seems like the most logical way of doing this, at least to me. Any suggestions would be greatly appreciated. Link to comment Share on other sites More sharing options...
jlhaslip Posted September 27, 2008 Share Posted September 27, 2008 One table for companies.One table for Categories.And, since there are many companies which could be in multiple categories, one table for company/categories would be recommended as a "connection" between the various possible combinations. Use the primary keys of the first two tables as foreign keys in the co/cat table. Link to comment Share on other sites More sharing options...
danielkraus Posted September 27, 2008 Author Share Posted September 27, 2008 Are you saying I should put the companies and their respective info into one Table and the categories in another? Basically, should I put all of the other data, the blog, and descriptions etc, into the "company" table and only the categories in another? I will need to study a bit more on "foreign keys" and how to connect the tables. Thanx. Link to comment Share on other sites More sharing options...
jlhaslip Posted September 27, 2008 Share Posted September 27, 2008 -- phpMyAdmin SQL Dump-- version 2.11.4-- http://www.phpmyadmin.net---- Host: localhost-- Generation Time: Sep 27, 2008 at 02:47 PM-- Server version: 5.0.51-- PHP Version: 5.2.5SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";---- Database: `content`---- ------------------------------------------------------------ Table structure for table `urls`--DROP TABLE IF EXISTS `urls`;CREATE TABLE IF NOT EXISTS `urls` ( `url_id` smallint(4) unsigned NOT NULL auto_increment, `url` varchar(60) NOT NULL, `title` varchar(60) NOT NULL, `description` tinytext NOT NULL, PRIMARY KEY (`url_id`), UNIQUE KEY `url` (`url`), FULLTEXT KEY `description` (`description`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5;---- Dumping data for table `urls`--INSERT INTO `urls` (`url_id`, `url`, `title`, `description`) VALUES(1, 'www.php.net', 'PHP: Hypertext Preprocessor', 'The home page of PHP...'),(2, 'www.mysql.com', 'MySQL: The World''s Most Popular Open Source Database', 'The home page of MySQL...'),(3, 'www.w3.org', 'World Wide Web Consortium', 'The home page of the W3C...'),(4, 'www.Zend.com', 'Zend', 'The home page of Zend...');-- ------------------------------------------------------------ Table structure for table `url_associations`--DROP TABLE IF EXISTS `url_associations`;CREATE TABLE IF NOT EXISTS `url_associations` ( `ua_id` smallint(4) unsigned NOT NULL auto_increment, `url_id` smallint(4) unsigned NOT NULL, `url_category_id` tinyint(3) unsigned NOT NULL, `date_submitted` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `approved` char(1) NOT NULL default 'N', PRIMARY KEY (`ua_id`), KEY `url_id` (`url_id`), KEY `url_category_id` (`url_category_id`), KEY `date_submitted` (`date_submitted`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9;---- Dumping data for table `url_associations`--INSERT INTO `url_associations` (`ua_id`, `url_id`, `url_category_id`, `date_submitted`, `approved`) VALUES(1, 1, 1, '2008-09-27 14:42:32', 'Y'),(2, 1, 4, '2008-09-27 14:42:32', 'Y'),(3, 1, 2, '2008-09-27 14:42:32', 'Y'),(4, 2, 5, '2008-09-27 14:42:32', 'Y'),(5, 2, 2, '2008-09-27 14:42:32', 'Y'),(6, 3, 2, '2008-09-27 14:42:32', 'Y'),(7, 4, 1, '2008-09-27 14:42:32', 'Y'),(8, 4, 3, '2008-09-27 14:42:32', 'Y');-- ------------------------------------------------------------ Table structure for table `url_categories`--DROP TABLE IF EXISTS `url_categories`;CREATE TABLE IF NOT EXISTS `url_categories` ( `url_category_id` tinyint(3) unsigned NOT NULL auto_increment, `category` varchar(20) NOT NULL, PRIMARY KEY (`url_category_id`), UNIQUE KEY `category` (`category`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7;---- Dumping data for table `url_categories`--INSERT INTO `url_categories` (`url_category_id`, `category`) VALUES(1, 'General PHP'),(2, 'Web Development'),(3, 'Code Libraries'),(4, 'Programming'),(5, 'General MySQL'),(6, 'General Database'); this may help.Notice how the url-associations table is a collection of keys from the other two tables (and the date_submitted for use as a search index). Link to comment Share on other sites More sharing options...
danielkraus Posted September 28, 2008 Author Share Posted September 28, 2008 Thank you, it makes a bit more sense now, but I really need to study more on MySQL and coding for it. I am still a newbie :)I understand the structure and how it functions together, I just need to figure out the code. Thanx again, I know what I will be doing this week! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.