#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    1
    Rep Power
    0
    Hi all,

    I am trying to take the results from a query and place the results in another table.
    I want to take all the results from $row join them together. is this possible to do?
    And can the results be stored with the information from the print statement? (<br> from each row)

    <?php
    $result = mysql_db_query ("database","select * from table WHERE this = that");
    while ($row = mysql_fetch_array ($result)) {
    //echo $row["data"];
    print ("{$row["data"]} <br>n");

    mysql_free_result ($result);
    ?>

    Hope I explained this good enough.

    Larry
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Helden,Limburg,The Netherlands
    Posts
    33
    Rep Power
    16
    Hi,

    If I get it right you try to construct a new query string from the results of a query. This is of course no more difficicult than creating a string. Just remember to use single quotation marks around a variable value in the query string like:

    $query = "insert into TABLENAME values('$row[0]','$row[1]')"

    It is also no problem to put HTML code in the database as well.

    Good luck,
    Ramon.

    ------------------
    Ramon Litjens
    Boradoli Web Design
    (www.boradoli.nl)
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    1
    Rep Power
    0
    The problem I am having is that the information in the database is sent to me in 70 character limits for the product description. Some skus have 75 rows in its description. I want to select every row with the same sku order it by the 2nd field which is the line number. Then take the third field which is the product description and place that in another table.

    I want to make a new table with fewer rows.

    This is the way it is now:
    old_table over 3,000,000 rows
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    sku linenumber desription
    00001 1 this line in carried to the next row
    00001 2 this one to the next row
    00001 3 Last line of this description
    00004 1 this is new
    00004 2 this is second new
    00004 3 this is last new


    This is what I want:
    new_table less than 70,000 rows

    I need the data from column 1 and 3 to look like this
    So from the table above I need rows 1 to 3 in row 1 below
    and 4 to 6 in row 2 below.

    prodsku desc
    00001 this line in carried to the next row<br>this one to the next row<br>Last line of this description
    00004 this is new<br>this is second new<br>this is lastnew
    [/code]

    Larry

    [This message has been edited by Masters (edited October 02, 2000).]

IMN logo majestic logo threadwatch logo seochat tools logo