Jump to content

quillspirit

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Posts posted by quillspirit

  1. Ok, so I have variable

     

    $x = "123.395";

     

    I use

     

    $x = round($x, 2);

    and come up with:

     

    123.4

    All is fine up to this point, except what I need to do is show that as a dollar value (for shopping cart)... so I want to show the missing placeholder 0 for 1/100ths.

     

    I don't want a comma for 1,000.00  and do not want a $ sign to display... so I don't think money_format() is what I need.

     

    The end result for $x needs to be:

    123.40

     

    Thanks. :)

     

  2. Have you tried passing it to the query as a variable?

     

    $test = '12345678901';

     

    INSERT INTO ValuesTemp ( CdId , InvId , CustomerId , CardPart , Month , Year, CreationDate ) VALUES (NULL , '3' , '' , '$test' , '07' , '2007', now() );

     

     

    Does it show up as that number no matter what value you try to Insert CardPart is?

  3. I have over 30,000 product descriptions that I need to import into my database. These descriptions are currently in individual .txt files (Named for the item_id) such as 10004.txt

     

    I managed to merge them all into one single .txt file - here is a sample: Note that all chars are represented in the descriptions: , " / - ; () [] {} | etc.

     

    23018 14K gold tubular hoop earrings, (3mm tube, 1 3/16" diameter).  Pair

    23019 14K gold tubular hoop earrings, (2mm tube, 3/4" diameter).  Pair

    23047 14K gold cultured pearl diamond ring. (6 x 10mm, 1.5 points TDW).

    23059 14K gold cultured pearl heart post earrings, (4.5-5 mm). Pair

    23064 14K gold Figaro necklace, (1mm).

    23065 14K gold 18" twisted serpentine necklace, (.5mm).

    23067 14K gold 18" box necklace, (.5mm).

    23069 14K gold serpentine necklace, (.75mm).

    23073 14K gold box necklace (.5mm) with hearts (6 x 6mm).

    23074 14K gold box necklace, (.5mm).

    23075 14K gold diamond cut Boston cable necklace, (.5 mm).

    23077 14K gold twisted Singapore necklace, (1 mm).

     

    How can I make this .txt file importable into MySQL database? I need to drop it into an empty column, between the rest of the data that is already in there. (MAKING SURE it matches up with the right item_num)

     

     

    item_num  item_page_num  item_name  item_description  item_units  item_price1 

    x                   x                     x                     ???                      x              x

     

     

    Right now, I have my scripting setup to include the needed .txt description to display with the other product info, but that just isn't very good. I want the descriptions to be searchable, and editable in the database.Another bonus would be if I could trim off the item ID numbers before each description, but some of them are alphanumeric or have a space. That is a project for another day.

     

    Thanks for any help!

     

     

  4. [quote author=Crayon Violent link=topic=107133.msg429418#msg429418 date=1157566730]
    you can also put your db.php in a directory below /public_html/ so it is not accessible by anybody but the server.
    [/quote]

    I've heard of that, but I'm not sure what the new path would be - I call db.php from my header.php, which is located at domain/dir/header.php - the db.php is currently at domain/dir/inc/db.php - so I am using

    [code]include('./inc/db.php');[/code]

    what would be my new path, if I moved it below /public_html/ ?

    ../../../../db.php ? I always get so confused when it comes to paths... how many dots and such. Thanks for your help.
×
×
  • 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.