Jump to content

mongoose00318

Members
  • Posts

    253
  • Joined

  • Last visited

Everything posted by mongoose00318

  1. My goal is to find those tags with a class of .ht_nestingParent and then add a blank table row above the .ht_nestingParent and then a blank row under the last of it's children rows; which are the rows below that lack the .ht_nestingParent class. Here is my HTML <tbody> <tr> <th class="ht_nestingLevels ht_nestingParent"><div class="relative"><span class="rowHeader">1</span> <div class="ht_nestingButton ht_nestingCollapse"></div> </div></th> <td class="">7-ELEVEN</td> <td class="">22971161</td> <td class=""></td> <td class=""></td> <td class=""></td> <td class=""></td> <td class=""></td> </tr> <tr> <th class="ht_nestingLevels ht__highlight"><div class="relative"><span class="ht_nestingLevel_empty"></span><span class="rowHeader">2</span></div></th> <td class="current highlight"></td> <td class=""></td> <td class="">A</td> <td class="">SOUTH MOD 67 ID FACE||7-11 OKLAHOMA COLORS||95-5/8 X 96-3/4||DWG: SO1067RF.OK (102138)||</td> <td class="">4</td> <td class="">2020-02-20</td> <td class="">2020-01-24</td> </tr> <tr> <th class="ht_nestingLevels ht_nestingParent"><div class="relative"><span class="rowHeader">3</span> <div class="ht_nestingButton ht_nestingCollapse"></div> </div></th> <td class="">7-ELEVEN</td> <td class="">22983321</td> <td class=""></td> <td class=""></td> <td class=""></td> <td class=""></td> <td class=""></td> </tr> </tbody> I'm so new to complex jQuery..or what seems complex to me. Here's a function I was trying to write using the .each method. $(document).ready(function() { $('.htCore tbody tr th.ht_nestingParent').each(function (i) { $val = $(this).html; alert($val); }); }); I don't think my function is right...it's not doing anything. But, isn't there a way to use selectors more thoroughly than I currently am to find the <th> with .ht_nestingParent and the subsequent children below it until it finds the next <th> with .ht_nestingParent?
  2. Haha yea...I thought it was super up-to-date. I was disappointed to find out it's from '09...thanks
  3. Okay...turns out that function is depreciated. Using addBack() fixed the problem. Can I mark this as the answer to my question? Or should I just delete the post?
  4. Hi, I am trying to get refreshed on jQuery so I bought O'Reillys jQuery cookbook. I'm having trouble with the exercise on using andSelf() to manipulate the parent of the selected element; though my code is exactly like the books. <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <div> <p>Paragraph</p> <p>Paragraph</p> </div> <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"> </script> <script> $('div').find('p').andSelf().css('border', '1px solid #993300'); </script> </body> </html> From my understanding my jQuery should add a border to the <div> but it doesn't. When I remove andSelf() it does add a border to the 2 <p> tags though. Am I doing something wrong?
  5. About the PHPEnthusiast article you recommended...what would the dummy API look like? The one he says returns a random number. Is it something you would have several functions in it and call using a _GET request or something?
  6. That did it...https://pastebin.com/KwH5VUdB Now, the only problem is when a parent doesn't have more than 1 child. Like in the pastebin example...it isn't listing the one child it has. I think it has to do with my if() else() statement because when I do this: //output data into spreadsheet view while($row = $stmt->fetch(PDO::FETCH_BOUND)) { if ($checkJob == $job_number) { print "<b>checkJob: " . $checkJob . " | " . "currentJob: " . $job_number . "</b><br>"; } else { $checkJob = $job_number; print "checkJob: " . $checkJob . " | " . "currentJob: " . $job_number . "<br>"; } } Even though the first lines match, it never makes them bold. It comes out like this: checkJob: 22359501 | currentJob: 22359501 checkJob: 22359501 | currentJob: 22359501 checkJob: 22359501 | currentJob: 22359501 checkJob: 22564841 | currentJob: 22564841 checkJob: 22564841 | currentJob: 22564841 checkJob: 22564841 | currentJob: 22564841 checkJob: 22564841 | currentJob: 22564841
  7. That did it...https://pastebin.com/KwH5VUdB Now, the only problem is when a parent doesn't have more than 1 child. Like in the pastebin example...it isn't listing the one child it has. I think it has to do with my if() else() statement because when I do this: //output data into spreadsheet view while($row = $stmt->fetch(PDO::FETCH_BOUND)) { if ($checkJob == $job_number) { print "<b>checkJob: " . $checkJob . " | " . "currentJob: " . $job_number . "</b><br>"; } else { $checkJob = $job_number; print "checkJob: " . $checkJob . " | " . "currentJob: " . $job_number . "<br>"; } } Even though the first lines match, it never makes them bold. It comes out like this: checkJob: 22359501 | currentJob: 22359501 checkJob: 22359501 | currentJob: 22359501 checkJob: 22359501 | currentJob: 22359501 checkJob: 22564841 | currentJob: 22564841 checkJob: 22564841 | currentJob: 22564841 checkJob: 22564841 | currentJob: 22564841 checkJob: 22564841 | currentJob: 22564841
  8. When I change my line to that...the JSON goes crazy... //output data into spreadsheet view while($row = $stmt->fetch(PDO::FETCH_BOUND)) { if ($checkJob == $job_number) { //print "<b>checkJob: " . $checkJob . " | " . "currentJob: " . $job_number . "</b><br>"; $json['__children'][] = array( 'LN #' => $line_item, 'Description' => $description, 'Qty' => $qty, 'AS400 Ship Date' => $as400_ship_date, 'Date Showed on Report' => $date_showed_on_report, 'Days to Manufacture' => "5", 'Notes' => $notes, 'Date Shown Completed' => $date_shown_complete, 'Actual Ship Date' => $actual_ship_date, 'Qty Shipped' => $qty_shipped ); } else { $checkJob = $job_number; //print "checkJob: " . $checkJob . " | " . "currentJob: " . $job_number . "<br>"; $json[] = array( 'Job Number' => $job_number, 'LN #' => null, 'Description' => null, 'Qty' => null, 'AS400 Ship Date' => null, 'Date Showed on Report' => null, 'Days to Manufacture' => null, 'Notes' => null, 'Date Shown Completed' => null, 'Actual Ship Date' => null, 'Qty Shipped' => null, ); } } It just starts putting a bunch of children with parents that those children aren't related to: { "0": { "Job Number": "22359501", "LN #": null, "Description": null, "Qty": null, "AS400 Ship Date": null, "Date Showed on Report": null, "Days to Manufacture": null, "Notes": null, "Date Shown Completed": null, "Actual Ship Date": null, "Qty Shipped": null }, "_children": [ { "LN #": "A", "Description": "SHELL GLOBAL 6x6 ID DF TP SGN (SH RVI)||ENG: SE1066RF_SH; RTE: 66SHID||5 ROWS SIGNBOX 2 LEDS||", "Qty": "1", "AS400 Ship Date": "2020-01-17", "Date Showed on Report": "2019-12-28", "Days to Manufacture": "5", "Notes": "", "Date Shown Completed": "2020-01-17", "Actual Ship Date": "2020-02-27", "Qty Shipped": "1" }, { "LN #": "D", "Description": "SHELL GLOBAL 6' 1X FUEL REWARDS CHARGE||", "Qty": "2", "AS400 Ship Date": "2020-01-17", "Date Showed on Report": "2019-12-28", "Days to Manufacture": "5", "Notes": "", "Date Shown Completed": "2020-02-27", "Actual Ship Date": "2020-02-27", "Qty Shipped": "2" }, That example above has 500 something children now when in reality it only has 4 children...am I doing something different than you suggested?
  9. That's an interesting idea...I want to look into that more. At some point I will be using AJAX at the very least to update records with this. If you have any good reads you can suggest...I'd like to take a look at them if you don't mind. Okay, well....I got it working! At least somewhat... Here is my current code: $checkJob = ''; //output data into spreadsheet view while($row = $stmt->fetch(PDO::FETCH_BOUND)) { if ($checkJob == $job_number) { //print "<b>checkJob: " . $checkJob . " | " . "currentJob: " . $job_number . "</b><br>"; $json[][] = array( 'LN #' => $line_item, 'Description' => $description, 'Qty' => $qty, 'AS400 Ship Date' => $as400_ship_date, 'Date Showed on Report' => $date_showed_on_report, 'Days to Manufacture' => "5", 'Notes' => $notes, 'Date Shown Completed' => $date_shown_complete, 'Actual Ship Date' => $actual_ship_date, 'Qty Shipped' => $qty_shipped ); } else { $checkJob = $job_number; //print "checkJob: " . $checkJob . " | " . "currentJob: " . $job_number . "<br>"; $json[] = array( 'Job Number' => $job_number, 'LN #' => null, 'Description' => null, 'Qty' => null, 'AS400 Ship Date' => null, 'Date Showed on Report' => null, 'Days to Manufacture' => null, 'Notes' => null, 'Date Shown Completed' => null, 'Actual Ship Date' => null, 'Qty Shipped' => null, ); } //$json[] = array($description, $qty, $line_item, $job_number, $as400_ship_date, $date_showed_on_report, "5", $notes, $date_shown_complete, $actual_ship_date, $qty_shipped); } My only problem is how the JSON is coming out...it's structured like this right now: [ { "Job Number": "22359501", "LN #": null, "Description": null, "Qty": null, "AS400 Ship Date": null, "Date Showed on Report": null, "Days to Manufacture": null, "Notes": null, "Date Shown Completed": null, "Actual Ship Date": null, "Qty Shipped": null }, [ { "LN #": "A", "Description": "SHELL GLOBAL 6x6 ID DF TP SGN (SH RVI)||ENG: SE1066RF_SH; RTE: 66SHID||5 ROWS SIGNBOX 2 LEDS||", "Qty": "1", "AS400 Ship Date": "2020-01-17", "Date Showed on Report": "2019-12-28", "Days to Manufacture": "5", "Notes": "", "Date Shown Completed": "2020-01-17", "Actual Ship Date": "2020-02-27", "Qty Shipped": "1" } ], ] I need it to be like this though... [ { 'Job Number': '22983321', 'LN #': null, 'Description': null, 'Qty': null, 'AS400 Ship Date': null, 'Date Showed on Report': null, 'Days to Manufacture': null, 'Notes': null, 'Date Shown Completed': null, 'Actual Ship Date': null, 'Qty Shipped': null, __children: [ { 'LN #': 'A', 'Description': 'Text for description goes here..', 'Qty': 1, 'AS400 Ship Date': '2020-03-13', 'Date Showed on Report': '2020-02-25', 'Days to Manufacture': 5, 'Notes': 'Text for notes here..', 'Date Shown Completed': '2020-03-17', 'Actual Ship Date': '2020-03-17', 'Qty Shipped': 1, }, { 'LN #': '3', 'Description': 'Text for description goes here..', 'Qty': 1, 'AS400 Ship Date': '2020-03-13', 'Date Showed on Report': '2020-02-25', 'Days to Manufacture': 5, 'Notes': 'Text for notes here..', 'Date Shown Completed': '2020-03-17', 'Actual Ship Date': '2020-03-17', 'Qty Shipped': 1, }, ], ] It's the part that says __children: [ ] that I am missing...not sure where to go from here..but I know I'm getting close
  10. I sort of have it working though I don't know if this is the right way to go about it... $checkJob = ''; //output data into spreadsheet view while($row = $stmt->fetch(PDO::FETCH_BOUND)) { if ($checkJob == $job_number) { print "<b>checkJob: " . $checkJob . " | " . "currentJob: " . $job_number . "</b><br>"; } else { $checkJob = $job_number; print "checkJob: " . $checkJob . " | " . "currentJob: " . $job_number . "<br>"; } $json[] = array($description, $qty, $line_item, $job_number, $as400_ship_date, $date_showed_on_report, "5", $notes, $date_shown_complete, $actual_ship_date, $qty_shipped); }
  11. I have a table which stores job numbers…each job number can have multiple “line items”…here is a screenshot of example data: https://imgur.com/qSaiJMD I am trying to use another feature of handsontable called nestedRows which makes it look like this: https://imgur.com/lRE6mbq In that example I have setup the JSON with hardcoded data. I am trying to integrate it into my PHP now. I have to make the JSON go from this: https://imgur.com/7hHQvC9 To something like this: https://imgur.com/7bSdl1O I can’t figure out how I can compare the current value in “job_number” to the last row’s “job_number” value so that I can tell the code for example… if($previousRow_job_number == $currentRow_job_number) { //then structure JSON data as a child (line item) of this job number } else { //structure JSON data as a parent job number } This is my current code I am trying to modify: <script type="text/javascript"> /* JSON Construction */ const data = <?php //setup query $sql = 'SELECT * FROM production_data'; //execute SQL transaction try { //prepare SQL statement & execute $stmt = $pdo->prepare($sql); $stmt->execute(); //bind column names to variables $stmt->bindColumn('id', $id); $stmt->bindColumn('job_number', $job_number); $stmt->bindColumn('enterprise', $enterprise); $stmt->bindColumn('part_number', $part_number); $stmt->bindColumn('description', $description); $stmt->bindColumn('qty', $qty); $stmt->bindColumn('line_item', $line_item); $stmt->bindColumn('as400_ship_date', $as400_ship_date); $stmt->bindColumn('date_showed_on_report', $date_showed_on_report); $stmt->bindColumn('shipping_method', $shipping_method); $stmt->bindColumn('notes', $notes); $stmt->bindColumn('date_shown_complete', $date_shown_complete); $stmt->bindColumn('actual_ship_date', $actual_ship_date); $stmt->bindColumn('qty_shipped', $qty_shipped); //output data into spreadsheet view while($row = $stmt->fetch(PDO::FETCH_BOUND)) { //construct array with data $json = array(); while($row = $stmt->fetch(PDO::FETCH_BOUND)) { //$json[] = array($description, $qty, $line_item, $job_number, $as400_ship_date, $date_showed_on_report, "5", $notes, $date_shown_complete, $actual_ship_date, $qty_shipped); $json[] = array($job_number, $line_item, $description, $qty, $as400_ship_date, $date_showed_on_report, "5", $notes, $date_shown_complete, $actual_ship_date, $qty_shipped); } //encode for JSON and output to screen print(json_encode($json)); } } //failed to execute SQL transaction catch (PDOException $e) { print $e->getMessage(); } ?> /* End JSON Construction */ const container = document.getElementById('productionLogTable'); const hot = new Handsontable(container, { data: data, //colHeaders: ['Description', 'Qty', 'LN #', 'Order Number', 'AS400 Ship Date', 'Date Showed on Report', 'Days to Manufacture', 'Notes', 'Date Shown Completed', 'Actual Ship Date', 'Qty Shipped'], colHeaders: ['Job Number', 'LN #', 'Description', 'Qty', 'AS400 Ship Date', 'Date Showed on Report', 'Days to Manufacture', 'Notes', 'Date Shown Completed', 'Actual Ship Date', 'Qty Shipped'], //colWidths: [300, 70, 70, 110, 110, 90, 90, 300, 90, 90], colWidths: [110, 70, 300, 70, 110, 90, 90, 300, 90, 90], rowHeaders: true, headerTooltips: { columns: true, onlyTrimmed: true }, filters: true, dropdownMenu: true, }); </script> I hope I’ve provided enough detail…
  12. Thanks alot mac_gyver! That did it! I can't believe I overlooked that. But, thanks a lot!!! mongoose
  13. Hello Everyone! Can anyone see what the issue is on this page? BTW, I know it's terrible coding with the nested tables etc. It's not my code. I have tried to pretty up and organize the code as best as possible and I have also narrowed down where the problem is I think but I am still having issues tracking the error down. Here is the link: http://pastebin.com/0VZM41A1 Problem is in lines 424-446...At least I'm pretty sure thats where it is. The error is: Any and all help is MUCH appreciated!!! Thank you all! Mongoose
  14. Im trying to figure out why my installation of xcart, when I go to the /admin directory, it redirects to my live admin login page. I have a development (http://development.website.com) and a live (http://website.com) installation. When I go to http://development.website.com/admin it redirects me to http://website.com/admin. I'm trying to output the PHP code from the page after executing. Isn't there someway to do something like echo __FILE_CONTENTS__; or something like that? If you have any input about my main problem any advice will be appreciated! Mongoose
  15. Yea that was a great help with the 2nd issue. Thanks so much! Do you think you may be able to point me in the right direction to find a solution for the 1st issue? I posted in the Jquery forums and a few others so we will see what happens with that. If you have any other suggestions they will be more than welcome lol!
  16. Hey All! Well, here I am at PHP Freaks mercy again lol. I love this website and everyone here is always so helpful so let's get to my most recent issue. I am developing a pretty simple event registration form, which would be pretty easy in most respects. It will have the following pretty standard fields. [*]Number of people attending: (drop down with 1-10) [*]Name [*]Address [*]City [*]State [*]Zip [*]Email [*]Phone [*]Alternate Phone There will be a few other fields but they aren't relevant. Basically the first field "Number of people attending (drop down 1-10)" will have to create a section with the following fields above for each person's information. If there are 3 people attending then it will need to have 3 sections of all those fields for each person. Making the page dynamically generate those sections on-the-fly when the user selects "3" for example is the first issue I am having. The other issue I am having is how would I handle the information dynamically within the PHP. If there was just one person it would be easy because I could just reference those fields. One solution I have for the second problem that I have some experience with is naming the fields name[] for example. But I still don't have a complete grasp on how to make that fix my problem. I've tried googling for hours but have had no luck, which may be because I'm not sure how to phrase the problem maybe. Any help!
  17. Hey All, I've been a member of PHPFreaks for a while now and I would say that I've been coding in PHP for about 4 or 5 years now. I don't really know OOP, my coding is more structural (I think this is the right term...or procedural). Most of the time I am coding a website for a client and their needs are completely unique as far as the type of data they want to collect, how they want to manipulate it, etc. But, there is one thing I notice each project has in common...Whether it's users, projects, recent news, etc. etc. they want to be able to add/edit/delete the data for that particular feature. So I spend most of my time making the same type of forms and scripts for each project. Please tell me if I am not making sense so I can try to explain it another way. Now, I don't know anything about frameworks, other than they are supposed to help with RAD. If someone could maybe discuss this topic with me, I might be able to learn something new and fascinating about PHP which has eluded me for quite a while. Thanks, /\/\ongoose
  18. I even changed the POST vars to just static information and the query didnt do anything. But if I removed the single quotes from around the POST vars I get a mysql error. It just doesn't make any sense because I have another page that is really similar that is working fine. EDIT** Your print statement worked also. Heres the result. About to set country_id to USA2 for country_id hello
  19. Ok I know what you mean now. I added a echo "hello"; under the query and that showed up fine. Here is the code. <?php $value = $_POST['update_value']; include('dbconfig.php'); //edit department if($_GET['mode'] != "delete") { //get requested departments information from database $exist_query = mysql_query("SELECT * FROM countries WHERE {$_GET['mode']}='{$_POST['update_value']}'") or die(mysql_error()); //edit department name //if $exist_query = 0 or $exist_query = 1 and $_GET['mode'] = name if(mysql_num_rows($exist_query) == 0) { if($_GET['mode'] == "country_name") { mysql_query("UPDATE countries SET country_name = '{$_POST['update_value']}' WHERE country_name = '{$_POST['element_id']}'") or die(mysql_error()); echo $_POST['update_value']; //echo $_POST['element_id']; } //edit department description //if $exist_query = 0 or $exist_query = 1 and $_GET['mode'] = description elseif($_GET['mode'] == "country_id") { mysql_query("UPDATE countries SET country_id = '{$_POST['update_value']}' WHERE country_id = '{$_POST['original_html']}'") or die(mysql_error()); echo "hello"; die(); /* //search for users that have state that was being edited and change it to the new value $get_users = mysql_query("SELECT * FROM users WHERE country = '{$_POST['original_html']}'") or die(mysql_query()); //check to see that the users state is set to the old state value, if it is replace it with the new state value while($row = mysql_fetch_array($get_users)) { if($row['country'] == $_POST['original_html']) { mysql_query("UPDATE users SET country = '{$_POST['update_value']}' WHERE user_id = '{$row['user_id']}'") or die(mysql_error()); } } //update the states country id field mysql_query("UPDATE states SET country_id = '{$_POST['update_value']}' WHERE country_id = '{$_POST['original_html']}'") or die(mysql_query()); */ echo $_POST['update_value']; } } //the update value the user tried to enter already exists in the database else { //alert the user of the problem echo "The entry already exists"; } } //delete department elseif($_GET['mode'] == "delete") { //delete the department mysql_query("DELETE FROM countries WHERE country_id = '".$_GET['country_id']."'"); //redirect user header("Location: ../admin_manage_countries.php"); } ?> Look at this part. elseif($_GET['mode'] == "country_id") { mysql_query("UPDATE countries SET country_id = '{$_POST['update_value']}' WHERE country_id = '{$_POST['original_html']}'") or die(mysql_error()); echo "hello"; die(); The "hello" is showing up, and the $_POST vars are showing up. What else can I provide to help you?
  20. Can I provide more info to help? Maybe the whole script?
  21. Do you mean are those post values set and have value? I have checked that and they both show up if I print or echo them. Thats why I'm so frustrated.
  22. Ok, I'm going start off simple. If I have to provide more code I will. I am doing an update on a table called countries. Yet my query just will not update the db. Is there anything wrong with this query? mysql_query("UPDATE countries SET country_id = '{$_POST['update_value']}' WHERE country_id = '{$_POST['original_html']}'") or die(mysql_error());
  23. I figured out how to fix the query. I had some fields in there that were wrong. Does anyone have any suggestions on how to do the 2nd problem? :/ I cant get anywhere with this.
  24. Hello, Alright I am having a few issues here. Let me explain what I am doing...this is a script that allows a customer to split an order..he can split certain items out of one order and it will create another order with the items he split added to this order, and then subtracting the items from the old order. The products are stored in one field called products, they are stored in a delimited list like this qty, product name, price each, product id | qty, product name, price each, product id |etc. Now, before you say why are you storing your products like that?? The reason I have to store my products like so is because the customer does not want the products stored in the order table to be dependent off the products table like they were before. In that case if he modified a product it would modify all of the orders with that product stored in them. Make sense? I am aware a delimited list probably wasn't the best way to do this but it was the best way I could think of. Ok here is my list of issues. 1) Everytime you split an order, it is not creating a new order to store the items that were split into. It created an order the first time I did it, and now all it does is it keeps updating the products field in that order, rather than creating a new order. 2) Next I do not know how I can update the old products (stored in the $prod array). It needs to update the products qtys after the order was split, and then if all of the qty for that product were moved to the new order it just needs to remove that product from the $prod array rather than updating the quantity. The code is below. Please let me know if I can provide any more information to help! Thanks everyone! // Get Old Order $get_order = @mysql_query("SELECT * FROM orders WHERE order_id = {$_POST['order_id']}"); $order = @mysql_fetch_assoc($get_order); // Get Old Order Items $products = $order['products']; //breaking products text down for display $prod = array(); $_products = explode('|', $products); foreach ($_products AS $p) $prod[] = explode(',', $p); /* $get_items = @mysql_query("SELECT product_id, qty FROM order_items WHERE order_id = {$order['order_id']}"); $items = array(); while(($row = @mysql_fetch_assoc($get_items)) !== false) { $items[] = $row; } */ if(empty($prod)) { header("Location: tracking.php"); die(); } // Create New Order mysql_query("INSERT INTO orders SET customer_id = {$order['customer_id']}, order_status = {$order['order_status']}, order_date = '{$order['order_date']}', order_date_paid = '{$order['order_date_paid']}', order_shipping = '{$order['order_shipping']}', order_shipping_fee = '{$order['order_shipping_fee']}', order_insurance = '{$order['order_insurance']}', order_insurance_fee = '{$order['order_insurance_fee']}', order_insurance_total = '{$order['order_insurance_total']}', order_grand_total = '{$order['order_grand_total']}', order_date = '{$order['order_date']}', order_filled = '{$order['order_filled']}', order_ship_date = '{$order['ship_date']}'"); $get_new_order = @mysql_query("SELECT MAX(order_id) AS order_id FROM orders") or die(mysql_error()); $new_order_id = @mysql_result($get_new_order, 'order_id', 0); // Add Items to New Order & Remove Items from Old Order $new_items = array(); $_new_items = ''; foreach($prod as $p2) { for($i = 0; $i < $p2[0]; $i++) { if(!empty($_POST[trim($p2[3]).'_'.$i])) { $new_items[trim($p2[3])]++; } } } //construct new static products list foreach($new_items as $id=>$qty) { $get_product = mysql_query("SELECT name, price FROM products WHERE product_id = '{$id}'"); $got_product = mysql_fetch_assoc($get_product); $_new_items .= $qty.','.$got_product['name'].','.$got_product['price'].','.$id.'|'; //echo $id.' - '.$qty.'<br>'; } //remove last character in products text before going into DB $_new_items = substr_replace($_new_items ,"",-1); //update products field in new order mysql_query("UPDATE orders SET products = '{$_new_items}' WHERE order_id = '{$new_order_id}'");
×
×
  • 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.