Jump to content

dootch

Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dootch's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have 2 tables from different sources they both have 3 field's in common (man_id, prod_id, price)  what i want to do is compare the tables if the prod_id matches,  output to another table the man_id, prod_id and price of the one with the lowest price.  I am trying to figure out what would be the best way to accomplish this task. Any help would be appreciated. 
  2. I am using ftpget to get a price list and using LOAD DATA INFILE to upload it to a mysql db via a script problem is when the price is over 999.99 the price list's it as 1,000.00 with a comma in it. So all products over 1k load into the db as price 1.1 the column is set to decimal 15,2 I have tried to set it as varchar same thing any idea's. I would like this to be automated via a cron job
  3. Thanks Solved [code]UPDATE products SET image = CONCAT(product_sku, '.jpg ')[/code]
  4. I forgot to add an image column to my db I just want it to be vendor_id.jpg I figure its something close to this but I cant get it. [code]UPDATE `products` SET `image` = vendor_id,'.jpg' [/code] Help please
  5. html mime mail [a href=\"http://www.phpguru.org/static/mime.mail.html\" target=\"_blank\"]http://www.phpguru.org/static/mime.mail.html[/a] download and check out examples I got it to work no problem [!--quoteo(post=355494:date=Mar 15 2006, 02:53 PM:name=pshankland)--][div class=\'quotetop\']QUOTE(pshankland @ Mar 15 2006, 02:53 PM) [snapback]355494[/snapback][/div][div class=\'quotemain\'][!--quotec--] I have got the following VERY basic script: [code]<?php $to = 'somone@somewhere.com'; $subject = 'Some Subject'; $message = 'Some Message'; mail($to, $subject, $message, '', '-fsomeoneelse@domain.com'); ?>[/code] This works but I need to be able to send a *.sql file as an attachment and although there is lots of help on the net I am a bit stuck. Anyone give me a simple addon to this script for me to mail the attachment? I have looked and can't use the phpmailer class as don't have the ability edit the php.ini file on my hosted server. Also, I would like to have the current date within the subject, how can I do this? Thanks. [/quote]
  6. I have condensed my code a bit to get anything to work this bit shows the individual order_id's but no product info It is not passing the variable. Still trying but I don't really know enough to get it to work. Please help.[code]<? include("dbinfo.inc.php"); mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="select distinct order_id from orders "; $result=mysql_query($query); $num=mysql_numrows($result); $query1="select sku, quantity_purchased, product_name from orders where order_id= " .$result. ""; $result1=mysql_query($query1); $num1=mysql_numrows($result1); $i=0; while ($i < $num) { $order=mysql_result($result,$i,"order_id"); $qty=mysql_result($result1,$i,"quantity_purchased"); $sku= mysql_result($result1,$i,"sku"); $product= mysql_result($result1,$i,"product_name"); ?> <table > <tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$order"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$qty $sku $product"; ?></font></td> </tr> <P CLASS="breakhere"> <? ++$i; } echo "</table>"; ?>[/code]
  7. OK I am totally lost here I am trying to add the inner loop but its wont work here is what I have. Any idea's?[code] <? include("dbinfo.inc.php"); mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM orders"; $result=mysql_query($query); $num=mysql_numrows($result); // set up query to get all products ordered: $query2="select sku, quantity_purchased, products_name from orders where order_id_id=".$order; $result2=mysql_query($query2);// inner loop result set while($inner_row = mysql_fetch_assoc($result2); $i=0; while ($i < $num) { $name=mysql_result($result,$i,"recipient_name"); $address1=mysql_result($result,$i,"ship_address_1"); $address2=mysql_result($result,$i,"ship_address_2"); $city=mysql_result($result,$i,"ship_city"); $state=mysql_result($result,$i,"ship_state"); $zip=mysql_result($result,$i,"ship_postal_code"); $order=mysql_result($result,$i,"order_id"); $email=mysql_result($result,$i,"buyer_email"); $qty= $inner_row ['quantity_purchased']; $sku= $inner_row ['sku']; $product= $inner_row ['product_name']; ?> <table > <tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$name"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$address1"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$address2"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$city, $state $zip"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$order"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$email"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$qty $sku $product"; ?></font></td> </tr> <? ++$i; } echo "</table>"; ?>[/code]
  8. I currrently dump an orders .txt file of data to a table and want to output them to view in a browser I have that part. My problem is that the if an order has multiple line items is puts it on a different row in the table ex order_id 123456, sku 1234, buyer John Doe order_id 123456, sku 5678, buyer John Doe So when I output the data it displays it as two records: John Doe Order #123456 sku 1234 John Doe Order#123456 sku 5678 where I only want it to be one with the two parts listed John Doe Order#123456 sku 1234 sku 5678 I am thinking I need a loop within a loop or something to that effect. Any idea's?? Here's a snippet of the code so far [code]$i=0; while ($i < $num) { $name=mysql_result($result,$i,"recipient_name"); $address1=mysql_result($result,$i,"ship_address_1"); $address2=mysql_result($result,$i,"ship_address_2"); $city=mysql_result($result,$i,"ship_city"); $state=mysql_result($result,$i,"ship_state"); $zip=mysql_result($result,$i,"ship_postal_code"); $order=mysql_result($result,$i,"order_id"); $email=mysql_result($result,$i,"buyer_email"); $qty=mysql_result($result,$i,"quantity_purchased"); $sku=mysql_result($result,$i,"sku"); $product=mysql_result($result,$i,"product_name"); ?> <table > <tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$name"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$address1"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$address2"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$city, $state $zip"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$order"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$email"; ?></font></td> </tr><tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$qty $sku $product"; ?></font></td> </tr> [/code]
×
×
  • 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.