SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast dannbkk's Avatar
    Join Date
    Jan 2007
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Correct Strings?

    I am fairly new to strings and am not sure if they are the right ones to use from biz_name down;

    and if i have set the right string names in mysql?

    PHP Code:
    $category $_POST['category'];
    $industry $_POST['industry'];
    $countries $_POST['countries'];
    $price $_POST['price'];
    $reference ereg_replace("[^a-zA-Z0-9]"""$_POST['reference']);
    $country $_POST['country'];
    $state $_POST['state'];
    $city $_POST['city'];
    $biz_type mysql_real_escape_string($_POST['biz_type']);
    $biz_started ereg_replace("[^0-9]"""$_POST['biz_started']);
    $employees ereg_replace("[^0-9]"""$_POST['employees']);
    $revenue ereg_replace("[^0-9]"""$_POST['revenue']);
    $benefit ereg_replace("[^0-9]"""$_POST['benefit']);
    $investment ereg_replace("[^0-9]"""$_POST['investment']);
    $total_investment ereg_replace("[^0-9]"""$_POST['total_investment']);
    $initial_cash ereg_replace("[^0-9]"""$_POST['initial_cash']);
    $inventory ereg_replace("[^0-9]"""$_POST['inventory']);
    $reason nl2br($_POST['reason']);
    $description nl2br($_POST['description']);
    $biz_name $_POST['biz_name'];
    $dba ereg_replace("[^a-zA-Z0-9]"""$_POST['dba']);
    $listing_source $_POST['listing_source'];
    $proprietary_id $_POST['proprietary_id'];
    $licences $_POST['licences'];
    $date_signed mysql_real_escape_string($_POST['date_signed']);
    $date_expires ereg_replace("[^0-9]"""$_POST['date_expires']);
    $hours_open ereg_replace("[^0-9]"""$_POST['hours_open']);
    $days_open ereg_replace("[^0-9]"""$_POST['days_open']);
    $seller_name ereg_replace("[^0-9]"""$_POST['seller_name']);
    $seller_street ereg_replace("[^0-9]"""$_POST['seller_street']);
    $seller_city ereg_replace("[^0-9]"""$_POST['seller_city']);
    $seller_country ereg_replace("[^0-9]"""$_POST['seller_country']);
    $seller_zip ereg_replace("[^0-9]"""$_POST['seller_zip']);
    $seller_phone nl2br($_POST['seller_phone']);
    $seller_finance nl2br($_POST['seller_finance']);
    $seller_commission ereg_replace("[^0-9]"""$_POST['seller_commission']);
    $seller_deposit ereg_replace("[^0-9]"""$_POST['seller_deposit']);
    $year_acquired ereg_replace("[^0-9]"""$_POST['year_acquired']);
    $property_street ereg_replace("[^0-9]"""$_POST['property_street']);
    $property_city ereg_replace("[^0-9]"""$_POST['property_city']);
    $property_state ereg_replace("[^0-9]"""$_POST['property_state']);
    $property_zip ereg_replace("[^0-9]"""$_POST['property_zip']);
    $property_phone ereg_replace("[^0-9]"""$_POST['property_phone']);
    $property_size ereg_replace("[^0-9]"""$_POST['property_size']);
    $seats ereg_replace("[^0-9]"""$_POST['seats']);
    $parking ereg_replace("[^0-9]"""$_POST['parking']);
    $terms ereg_replace("[^0-9]"""$_POST['terms']);
    $additional_terms ereg_replace("[^0-9]"""$_POST['additional_terms']);
    $misc_info ereg_replace("[^0-9]"""$_POST['misc_info']);
    $realty_available ereg_replace("[^0-9]"""$_POST['realty']);
    $realty_included ereg_replace("[^0-9]"""$_POST['realty_included']);
    $realty_value ereg_replace("[^0-9]"""$_POST['realty_value']);
    $realty_asking ereg_replace("[^0-9]"""$_POST['realty_asking']);
    $monthly_rent ereg_replace("[^0-9]"""$_POST['monthly_rent']);
    $security_lease ereg_replace("[^0-9]"""$_POST['security_lease']);
    $lease_expiration ereg_replace("[^0-9]"""$_POST['lease_expiration']);
    $option_lease ereg_replace("[^0-9]"""$_POST['option_lease']);
    $landlord_name ereg_replace("[^0-9]"""$_POST['landlord_name']);
    $landlord_phone ereg_replace("[^0-9]"""$_POST['landlord_phone']);
    $asking_price ereg_replace("[^0-9]"""$_POST['asking_price']);
    $annual_receipts ereg_replace("[^0-9]"""$_POST['annual_receipts']);
    $annual_cash ereg_replace("[^0-9]"""$_POST['annual_cash']);
    $downpayment ereg_replace("[^0-9]"""$_POST['downpayment']);
    $monthly_payroll ereg_replace("[^0-9]"""$_POST['monthly_payroll']);
    $ffe_included ereg_replace("[^0-9]"""$_POST['ffe_included']);
    $ffe_asking ereg_replace("[^0-9]"""$_POST['ffe_asking']);
    $inventory_asking ereg_replace("[^0-9]"""$_POST['inventory_asking']);
    $liens ereg_replace("[^0-9]"""$_POST['liens']);
    $buyer_backround ereg_replace("[^0-9]"""$_POST['buyer_backround']);
    $comments ereg_replace("[^0-9]"""$_POST['comments']); 
    mysql names;

    PHP Code:
    `biz_idtinyint(8NOT NULL auto_increment,
      `
    categorytinyint(8NOT NULL default '0',
      `
    industrytinyint(8NOT NULL default '0',
      `
    countriestinyint(8NOT NULL default '0',
      `
    pricetinyint(8NOT NULL default '0',
      `
    referencetext NOT NULL,
      `
    countrytext NOT NULL,
      `
    statetext NOT NULL,
      `
    citytext NOT NULL,
      `
    biz_typetext NOT NULL,
      `
    biz_startedtinyint(4NOT NULL default '0',
      `
    employeesint(11NOT NULL default '0',
      `
    revenueint(11NOT NULL default '0',
      `
    benefitint(11NOT NULL default '0',
      `
    investmentint(11NOT NULL default '0',
      `
    total_investmentint(11NOT NULL default '0',
      `
    initial_cashint(11NOT NULL default '0',
      `
    inventoryint(11NOT NULL default '0',
      `
    reasontext NOT NULL,
      `
    descriptiontext NOT NULL,
      `
    biz_nametext NOT NULL,
      `
    dbatext NOT NULL,
      `
    listing_sourcetext NOT NULL,
      `
    proprietary_idtext NOT NULL,
      `
    licencestext NOT NULL,
      `
    date_signeddate NOT NULL default '0000-00-00',
      `
    date_expiresdate NOT NULL default '0000-00-00',
      `
    hours_opentext NOT NULL,
      `
    days_opentext NOT NULL,
      `
    seller_nametext NOT NULL,
      `
    seller_streettext NOT NULL,
      `
    seller_citytext NOT NULL,
      `
    seller_countrytext NOT NULL,
      `
    seller_ziptinyint(4NOT NULL default '0',
      `
    seller_phoneint(11NOT NULL default '0',
      `
    seller_financeint(11NOT NULL default '0',
      `
    seller_commissionint(11NOT NULL default '0',
      `
    seller_depositint(11NOT NULL default '0',
      `
    year_acquiredtinyint(4NOT NULL default '0',
      `
    property_streettext NOT NULL,
      `
    property_citytext NOT NULL,
      `
    property_statetext NOT NULL,
      `
    property_ziptinyint(4NOT NULL default '0',
      `
    property_phoneint(11NOT NULL default '0',
      `
    property_sizeint(11NOT NULL default '0',
      `
    seatstinyint(4NOT NULL default '0',
      `
    parkingtinyint(4NOT NULL default '0',
      `
    termstext NOT NULL,
      `
    additional_termstext NOT NULL,
      `
    misc_infotext NOT NULL,
      `
    realty_availabletext NOT NULL,
      `
    realty_includedtext NOT NULL,
      `
    realty_valueint(11NOT NULL default '0',
      `
    realty_askingint(11NOT NULL default '0',
      `
    monthly_rentint(11NOT NULL default '0',
      `
    security_leaseint(11NOT NULL default '0',
      `
    lease_expirationtinyint(4NOT NULL default '0',
      `
    option_leasetext NOT NULL,
      `
    landlord_nametext NOT NULL,
      `
    landlord_phonetext NOT NULL,
      `
    asking_priceint(11NOT NULL default '0',
      `
    annual_receiptsint(11NOT NULL default '0',
      `
    annual_cashint(11NOT NULL default '0',
      `
    downpaymentint(11NOT NULL default '0',
      `
    monthly_payrollint(11NOT NULL default '0',
      `
    ffe_includedtext NOT NULL,
      `
    ffe_askingint(11NOT NULL default '0',
      `
    inventory_askingint(11NOT NULL default '0',
      `
    liensint(11NOT NULL default '0',
      `
    buyer_backroundtext NOT NULL,
      `
    commentstext NOT NULL
    Learn SEO - Join the community at GSEO.net
    SEO Book - SEO Revenge eBook
    Make Money Programs - No Fluff!
    Make Money Online

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Not to be a prude or anything but you need some database rethinking. That is one huge mess needing a lot of data reconstruction.

    I would break the table into groups separating the data into there own tables life for instance. I'll give
    seller_* its own table, property_* another table, etc.

    What you need to look for is Normalizing You Database.
    http://databases.about.com/od/specif...ase_Design.htm
    http://www.google.com/search?q=database+design
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Enthusiast dannbkk's Avatar
    Join Date
    Jan 2007
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The database is working fine, i just want correct strings.
    Learn SEO - Join the community at GSEO.net
    SEO Book - SEO Revenge eBook
    Make Money Programs - No Fluff!
    Make Money Online


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
  •