Close

Results 1 to 2 of 2
  1. #1
    DF VIP Member tam9's Avatar
    Join Date
    Apr 2002
    Location
    The city of R
    Posts
    3,855
    Thanks
    2
    Thanked:        1
    Karma Level
    637

    Help PHP & MySQL help

    hi guys, I need some help with this if anyone is patient enough to check this out I'd be very grateful.

    Basically, I have a MySQL schema that I want to update with info via a php form and display the results also on a PHP form, but obviously first off I need to setup a script to enter the data and then I can get onto the results part and maybe do that myself.

    Here is the schema that I am currently working with:
    Code:
    -- MySQL dump 10.10
    --
    -- Host: localhost    Database: football
    -- ------------------------------------------------------
    -- Server version	5.0.24a-Debian_9-log
    
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='+00:00' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    
    --
    -- Table structure for table `competition`
    --
    
    DROP TABLE IF EXISTS `competition`;
    CREATE TABLE `competition` (
      `guid` int(4) NOT NULL auto_increment,
      `competition_name` varchar(64) NOT NULL default '',
      PRIMARY KEY  (`guid`)
    ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
    
    --
    -- Table structure for table `game`
    --
    
    DROP TABLE IF EXISTS `game`;
    CREATE TABLE `game` (
      `guid` int(6) NOT NULL auto_increment,
      `opponent_uid` int(4) NOT NULL default '0',
      `venue_uid` int(4) NOT NULL default '0',
      `competition_uid` int(2) NOT NULL default '0',
      `round` varchar(64) default NULL,
      `date` date default NULL,
      `han` enum('h','a','n') default NULL,
      `goals_for` int(2) default NULL,
      `goals_against` int(2) default NULL,
      `attendance` int(6) default NULL,
      `notes` text,
      PRIMARY KEY  (`guid`)
    ) ENGINE=MyISAM AUTO_INCREMENT=4767 DEFAULT CHARSET=latin1;
    
    --
    -- Table structure for table `opponent`
    --
    
    DROP TABLE IF EXISTS `opponent`;
    CREATE TABLE `opponent` (
      `guid` int(4) NOT NULL auto_increment,
      `opponent_name` varchar(64) NOT NULL default '',
      `nation_id` int(3) default NULL,
      PRIMARY KEY  (`guid`)
    ) ENGINE=MyISAM AUTO_INCREMENT=167 DEFAULT CHARSET=latin1;
    
    --
    -- Table structure for table `opponent_nation`
    --
    
    DROP TABLE IF EXISTS `opponent_nation`;
    CREATE TABLE `opponent_nation` (
      `guid` int(4) NOT NULL auto_increment,
      `nation` varchar(64) NOT NULL default '',
      PRIMARY KEY  (`guid`)
    ) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=latin1;
    
    --
    -- Table structure for table `player`
    --
    
    DROP TABLE IF EXISTS `player`;
    CREATE TABLE `player` (
      `guid` int(4) NOT NULL auto_increment,
      `surname` varchar(32) default NULL,
      `firstname` varchar(32) default NULL,
      `commonname` varchar(32) default NULL,
      `DOB` date default NULL,
      `died` date default NULL,
      `notes` text,
      PRIMARY KEY  (`guid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    
    --
    -- Table structure for table `scorers`
    --
    
    DROP TABLE IF EXISTS `scorers`;
    CREATE TABLE `scorers` (
      `guid` int(4) NOT NULL auto_increment,
      `player_uid` int(6) NOT NULL default '0',
      `game_uid` int(6) NOT NULL default '0',
      `goals` int(2) default NULL,
      PRIMARY KEY  (`guid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    
    --
    -- Table structure for table `signing`
    --
    
    DROP TABLE IF EXISTS `signing`;
    CREATE TABLE `signing` (
      `guid` int(4) NOT NULL auto_increment,
      `player_uid` int(6) NOT NULL default '0',
      `signing_date` date default NULL,
      `leaving_date` date default NULL,
      PRIMARY KEY  (`guid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    
    --
    -- Table structure for table `team`
    --
    
    DROP TABLE IF EXISTS `team`;
    CREATE TABLE `team` (
      `guid` int(4) NOT NULL auto_increment,
      `game_uid` int(6) NOT NULL default '0',
      `player_uid` int(6) NOT NULL default '0',
      PRIMARY KEY  (`guid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    
    --
    -- Table structure for table `tiebreak`
    --
    
    DROP TABLE IF EXISTS `tiebreak`;
    CREATE TABLE `tiebreak` (
      `guid` int(4) NOT NULL auto_increment,
      `game_uid` int(6) NOT NULL default '0',
      `ffor` int(6) default NULL,
      `against` int(6) default NULL,
      `break_method_uid` int(2) NOT NULL default '0',
      PRIMARY KEY  (`guid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    
    --
    -- Table structure for table `tiebreak_method`
    --
    
    DROP TABLE IF EXISTS `tiebreak_method`;
    CREATE TABLE `tiebreak_method` (
      `guid` int(2) NOT NULL auto_increment,
      `tiebreak_method_name` varchar(64) NOT NULL default '',
      PRIMARY KEY  (`guid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    
    --
    -- Table structure for table `venue`
    --
    
    DROP TABLE IF EXISTS `venue`;
    CREATE TABLE `venue` (
      `guid` int(4) NOT NULL auto_increment,
      `venue_name` varchar(64) NOT NULL default '',
      PRIMARY KEY  (`guid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
    
    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
    /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
    /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
    /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
    /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
    Now if someone with php experience could help me (or point me in the right direction, no spoon feeds pls )build a small front end so I can manually at present enter some data in so that I can test the DB out and then I can go on and build it in a better fashion.

    Cheers for lookin lads

    **edit** I guess what I need to do is build an INSERT based on the tables, but I'm not sure how I would join them up :/
    Last edited by tam9; 3rd January 2007 at 11:10 PM.

  2. #2
    DF VIP Member tam9's Avatar
    Join Date
    Apr 2002
    Location
    The city of R
    Posts
    3,855
    Thanks
    2
    Thanked:        1
    Karma Level
    637

    Default Re: PHP & MySQL help

    Right I've figured out that if I do single INSERT into tables 1 at a time how would I go about joining them up when I go to do a query in my PHP code?

    C'mon someone must know!

Similar Threads

  1. PHP & MySQL Hosting Required
    By Stig in forum Web Hosting & Domain Names
    Replies: 2
    Last Post: 12th March 2003, 12:28 PM
  2. Looking for PHP (no mysql) script!
    By itschris in forum Website Coding & Graphics
    Replies: 3
    Last Post: 5th March 2003, 11:47 AM
  3. PHP & MySQL
    By g1bbo in forum Website Coding & Graphics
    Replies: 6
    Last Post: 20th December 2002, 05:34 PM
  4. Small question on MS SQL, MySql and MS ACCESS
    By H@z in forum The Dog and Duck
    Replies: 1
    Last Post: 7th October 2002, 12:45 PM

Social Networking Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •