Jump to content

dannybrazil

Members
  • Posts

    178
  • Joined

  • Last visited

Everything posted by dannybrazil

  1. This is the command (again it is NOT mine I just copied it) /** * @return the items/products list in this payment request */ public function getItems() { return $this->items; } /** * Sets the items/products list in this payment request * @param array $items */ public function setItems(Array $items) { if (is_array($items)) { $i = Array(); foreach ($items as $key => $item) { if ($item instanceof PagSeguroItem) { $i[$key] = $item; } else if (is_array($item)) { $i[$key] = new PagSeguroItem($item); } } $this->items = $i; } } /** * Adds a new product/item in this payment request * * @param String $id * @param String $description * @param String $quantity * @param String $amount * @param String $weight * @param String $shippingCost */ public function addItem($id, $description = null, $quantity = null, $amount = null, $weight = null, $shippingCost = null) { $param = $id; if ($this->items == null) { $this->items = Array(); } if (is_array($param)) { array_push($this->items, new PagSeguroItem($param)); } else if ($param instanceof PagSeguroItem) { array_push($this->items, $param); } else { $item = new PagSeguroItem(); $item->setId($param); $item->setDescription($description); $item->setQuantity($quantity); $item->setAmount($amount); $item->setWeight($weight); $item->setShippingCost($shippingCost); array_push($this->items, $item); } } example they gave - as it is // Add another item for this payment request $paymentRequest->addItem('0002', 'Notebook rosa', 2,560.00); what I want to do it getting the variables from my DB and with a WHILE loop adding the products. hope it is easier to understand now. the thing is that when I am in the WHILE loop it seems that the ($id) 0001...0002...000n is not being passed correctly in the while loop cus I am getting an error. when I just try to do it manually it is working so I guess something is wrong with the ECHO in the WHILE loop/
  2. I t is getting $productName and $price from $row_3. But it seems when I echo it , something goes wrong regarding this command (which is NOT mine I just copies it to use a shopping cart) $query_3=mysql_query("SELECT * FROM client_order WHERE Client_id = $cid AND order_number = $order_number ");[/font][/color] [color=#282828][font=helvetica, arial, sans-serif]while ($row_3=mysql_fetch_assoc($query_3)){[/font][/color] [color=#282828][font=helvetica, arial, sans-serif]$productName = $row_3['name']; $price = $row_3['price'];[/font][/color] [color=#282828][font=helvetica, arial, sans-serif]echo '$paymentRequest->addItem("'.$start_number.'", "'.$productName.'", '.$price.')';[/font][/color] [color=#282828][font=helvetica, arial, sans-serif]$start_number++; } I guess it has to be something with the echo or with the quotations or something. btw...I was trying to look for this online but couldn't : -> : what this mean...where can I find the manual for this operator (->)
  3. Hello, I have a WHILE loop that works fine, BUT when I add this to it I get an error. I guess my way is NOT how you suppose to do it My regular while: $query_3=mysql_query("SELECT * FROM client_order WHERE Client_id = $cid AND order_number = $order_number "); while ($row_3=mysql_fetch_assoc($query_3)){ echo 'smt....smt'; } I need to add: $paymentRequest->addItem('0001', 'Notebook prata', 2,430.00); // --- 0001 is increasing if I have more than 1 product 0002...000n The new one: $query_3=mysql_query("SELECT * FROM client_order WHERE Client_id = $cid AND order_number = $order_number "); while ($row_3=mysql_fetch_assoc($query_3)){ echo '$paymentRequest->addItem("'.$start_number.'", "'.$productName.'", '.$price.')'; $start_number++; } How to I write the code in a correct way that if I have lets say 3 products is will "print" 3 parts like this: $paymentRequest->addItem('1', 'Notebook prata', 2,430.00); $paymentRequest->addItem('2', 'Notebook red', 2,430.00); $paymentRequest->addItem('3', 'Notebook yello', 2,430.00); Thanks
  4. Hello I have a DB table which contains a col with information [code_of_product - quantity]: Example: 12345 - 12 , 6789 - 8 , 54321 - 3. Now as they are all in ONE CELL I wanted to know if there is a way to SEPARATE them according to the "," and "-" Like this: Product 12345 - Quantity 12 (<br>) Product 6789 - Quantity 8 . . . etc any help?
  5. Hello, I have noticed, in the last few days after uploading via DW one of my pages keeps adding ">" sign after the closing HTML. Example: </html>>>>> Lets say I delete it....and after again it appears, sometimes more ">" </html>>>>>>>>>>>> The things is that it is NOT in the middle of the code, so I didn't forget to "close" some TAGS. any idea about what it is? Danny.
  6. The part called "collation" in the DB, should be UTF8, you mean? ok I have a list of 20+ utf8_ there is no utf8_portuguese . should I choose. utf8_unicode_ci ??
  7. Hello My site is in PORTUGUESE (charset=iso-8859-1"). so a users name could be, for example: Marcus Marcos M?rcos Marc?s ?,?,?, ?, ?, etc.... I have an option that allows to search users on my page. I use %LIKE% in my code, but it is not working correctly. If the user name is Marcus and someone is looking for M?rcus it doesn't return anything Is there a way to disregard ACCENTS while SQL searching? just letters, pure? Danny.
×
×
  • 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.