Changeset 25 for trunk


Ignore:
Timestamp:
Dec 26, 2018, 11:13:00 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Keep Age, Height and Weight values in database as int type.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Meet.php

    r24 r25  
    350350    if ($DbResult->num_rows == 0)
    351351    {
     352      if ($this->Age == '') $Age = null;
     353        else $Age = $this->Age;
     354      if ($this->Height == '') $Height = null;
     355        else $Height = $this->Height;
     356      if ($this->Weight == '') $Weight = null;
     357        else $Weight = $this->Weight;
    352358      $this->Database->insert('MeetItem', array(
    353359        'Message' => $this->Message,
    354360        'Date' => TimeToMysqlDate($this->Date),
    355361        'Gender' => $this->Gender,
    356         'Age' => $this->Age,
     362        'Age' => $Age,
    357363        'Email' => $this->Email,
    358364        'Phone' => $this->Phone,
    359365        'Name' => $this->Name,
    360         'Height' => $this->Height,
    361         'Weight' => $this->Weight,
     366        'Height' => $Height,
     367        'Weight' => $Weight,
    362368        'Location' => $this->Location,
    363369        'Source' => $this->Source,
  • trunk/SQL/Update.php

    r10 r25  
    11ALTER TABLE `MeetItem` ADD `Link` VARCHAR(255) NOT NULL AFTER `Location`;
    22
     3ALTER TABLE `MeetItem` CHANGE `Age` `Age` INT NULL DEFAULT NULL;
     4UPDATE `MeetItem` SET `Age`=NULL WHERE `Age`=0;
     5ALTER TABLE `MeetItem` CHANGE `Height` `Height` INT NULL DEFAULT NULL;
     6UPDATE `MeetItem` SET `Height`=NULL WHERE `Height`=0;
     7ALTER TABLE `MeetItem` CHANGE `Weight` `Weight` INT NULL DEFAULT NULL;
     8UPDATE `MeetItem` SET `Weight`=NULL WHERE `Weight`=0;
Note: See TracChangeset for help on using the changeset viewer.