Jump to content

seveneleven

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

seveneleven's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi thank you for your help. The database column that I am calling has 4 entries. How do I get it to display all 4 and not just the first? Here is more code I have tried where I use the query inside the php tags. Results are parse errors, and I cant find what it is. select name="event" onChange="autoSubmit();"> <option value="null"></option> <option value=" <?PHP $sql="SELECT events.event_id, events.event_no FROM events WHERE events.event_date >= current_date"; $event = mysql_query($sql,$conn); echo $row_event['event_id']; if($event == $row_event['event_id']) echo {"selected"};> echo "{$row_event['event_no']}; </option>"?> </select>
  2. Hi, I am trying to build a cascading select menu. I have it working except for this part. The very first menu should list 4 different events. When I test the page it only displays the first one. The code I am using is below. <select name="event" onChange="autoSubmit();"> <option value="null"></option> <option value=" echo $row_events['event_id']; ?>" <?php if($event == $row_events['event_id']) echo " selected"; ?>><?php echo $row_events['event_no']; ?></option> </select> Any help is appreciated. Thank you
  3. Thanks, do you recommend that I use, VARCHAR instead?
  4. Hi With some great help I have come up with a partial solution to a DB I am trying to create. Its for a hockey team that I would like to track statistics for. Things like, win/loss record, players goals, assists and penalty minutes, as well as team totals. Typical sports stat stuff. Anyway, I am not sure on creating the foreign keys. Here is what I have created in DBdesigner4, I look forward to any suggestions. [code] CREATE TABLE Assists (   Stat_ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,   Goals_Stat_ID INTEGER UNSIGNED NOT NULL,   Games_Game_ID INTEGER UNSIGNED NOT NULL,   Players_Player_ID INTEGER UNSIGNED NOT NULL,   Time TIME NULL,   PRIMARY KEY(Stat_ID),   INDEX Assists_FKIndex1(Players_Player_ID),   INDEX Assists_FKIndex2(Games_Game_ID),   INDEX Assists_FKIndex3(Goals_Stat_ID) ); CREATE TABLE Games (   Game_ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,   Assists_Stat_ID INTEGER UNSIGNED NOT NULL,   PIM_stat_id INTEGER UNSIGNED NOT NULL,   Players_Player_ID INTEGER UNSIGNED NOT NULL,   Goals_Stat_ID INTEGER UNSIGNED NOT NULL,   Teams_Team_ID INTEGER UNSIGNED NOT NULL,   Home_team TEXT NULL,   Away_team TEXT NULL,   GF INTEGER UNSIGNED NULL,   GA INTEGER UNSIGNED NULL,   Date DATE NULL,   Time TIME NULL,   PRIMARY KEY(Game_ID),   INDEX Games_FKIndex1(Teams_Team_ID),   INDEX Games_FKIndex2(Goals_Stat_ID),   INDEX Games_FKIndex3(Players_Player_ID),   INDEX Games_FKIndex4(PIM_stat_id),   INDEX Games_FKIndex5(Assists_Stat_ID) ); CREATE TABLE Goals (   Stat_ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,   Games_Game_ID INTEGER UNSIGNED NOT NULL,   Players_Player_ID INTEGER UNSIGNED NOT NULL,   Time TIME NULL,   PRIMARY KEY(Stat_ID),   INDEX Goals_FKIndex1(Players_Player_ID),   INDEX Goals_FKIndex2(Games_Game_ID) ); CREATE TABLE PIM (   stat_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,   Games_Game_ID INTEGER UNSIGNED NOT NULL,   Players_Player_ID INTEGER UNSIGNED NOT NULL,   Minutes INTEGER UNSIGNED NULL,   Infraction TEXT NULL,   PRIMARY KEY(stat_id),   INDEX PIM_FKIndex1(Players_Player_ID),   INDEX PIM_FKIndex2(Games_Game_ID) ); CREATE TABLE Players (   Player_ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,   Name TEXT NULL,   Number INTEGER UNSIGNED NULL,   Email TEXT NULL,   Position TEXT NULL,   PRIMARY KEY(Player_ID) ); CREATE TABLE Season (   Season_ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,   PRIMARY KEY(Season_ID) ); CREATE TABLE Season_has_games (   SeasonID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,   GameID INTEGER UNSIGNED NOT NULL,   Games_Game_ID INTEGER UNSIGNED NOT NULL,   Season_ID INTEGER UNSIGNED NOT NULL,   PRIMARY KEY(SeasonID, GameID),   INDEX Season_has_games_FKIndex1(Season_ID),   INDEX Season_has_games_FKIndex2(Games_Game_ID) ); CREATE TABLE Teams (   Team_ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,   Team_Name TEXT NULL,   PRIMARY KEY(Team_ID) ); [\code] Thanks for looking[/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.