Jump to content

bubblegum.anarchy

Members
  • Posts

    526
  • Joined

  • Last visited

    Never

Posts posted by bubblegum.anarchy

  1. With the code block of data from your original post opened in vim (a text editor) and the following regular expression command

     

    :%s/^\([0-9]*\)\s\(.*\)/'\1','\2'/g

     

    will result in each line quoted as so:

     

    '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).'

     

    You may need to run a quick regular expression to addslashes to single quotes before wrapping the id and description in quotes.

     

    EDIT: the regular expression is playing havoc with the bbcode

  2. oh - ok... Clicking the [update Link] button on the link provided produced the following page

    ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'special2 = '' WHERE id =' at line 1 UPDATE products SET title = '', description = '', retail = '', special = '' special2 = '' WHERE id = 
    

     

    $id does not appear to be set anywhere.

     

  3. Finding a ready made script for something so specific will be difficult... so many variables - how do you define what two records should be compared?

     

    Maybe there is something out there that will plot a graph for a single sorted field for all records in a table, even writing something that does the graphing may not be a difficult task but once, not only conditional comparisons but also conditional records is introduced, the result is a complicated script that is unlikely to exist.

  4. ? the above code block looks exactly like what I posted... are your tables named the same as my hypotheticals?

     

    anyway.. I don't know what getArray() does.

     

    For:

    ID    SERVICES    OTHER_SERV

    ---------------------------------------

    1      A,B,C,E,F      B,D,E,G

    2      B,D,E            E,G,H

     

    you should get two rows

     

    SERVICES    GROUP_CONCAT RESULT EACH ITEM SEPERATED BY A NEWLINE CHARACTER

    ---------------------------------------

    A,B,C,E,F      Apples Ball Car Egg Fly

    B,D,E            Ball Dog Egg

     

  5. Allowing null values means that a field can have NULL as a value and the NULL value is set as the value of the particular field when an inserting a new record and not providing a value for the particular field, on the other hand a NOT NULL setting for the same insert would produce an error message similar to `field can not be null`- NOT NULL pretty much means that a field must have some sort of value besides NULL when a new record is inserted.

  6. This is all straight out of the MySQL manual:

     

    DATETIME

     

    A date and time combination. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. MySQL displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format, but allows you to assign values to DATETIME columns using either strings or numbers.

     

    TIMESTAMP[(M)]

     

    A timestamp. The range is '1970-01-01 00:00:00' to partway through the year 2037.

     

    A TIMESTAMP column is useful for recording the date and time of an INSERT or UPDATE operation. The first TIMESTAMP column in a table is automatically set to the date and time of the most recent operation if you don't assign it a value yourself. You can also set any TIMESTAMP column to the current date and time by assigning it a NULL value.

     

    A TIMESTAMP value is returned as a string in the format 'YYYY-MM-DD HH:MM:SS'whose display width is fixed at 19 characters. If you want to obtain the value as a number, you should add +0 to the timestamp column.

     

    Note: The TIMESTAMP format that was used prior to MySQL 4.1 is not supported in MySQL 5.1; see MySQL 4.1 Reference Manual for information regarding the old format.

     

×
×
  • 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.