Foros del Web » Programando para Internet » PHP »

[SOLUCIONADO] variable a product_array indefinida

Estas en el tema de variable a product_array indefinida en el foro de PHP en Foros del Web. Hola, tengo un problema como puedo reemplazar esto @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código PHP: Ver original $product_array = array (   "100" => array ( 'product_id' => ...
  #1 (permalink)  
Antiguo 20/11/2016, 22:08
 
Fecha de Ingreso: abril-2016
Mensajes: 44
Antigüedad: 8 años
Puntos: 0
Pregunta variable a product_array indefinida

Hola, tengo un problema como puedo reemplazar esto

Código PHP:
Ver original
  1. $product_array = array(
  2.   "100" =>array('product_id'=>'100', 'product_name'=>'Apple MacBook Pro MA464LL/A 15.4" Notebook PC','product_desc'=>'The Intel Core Duo powering MacBook Pro is actually two
  3. processors built into a single chip.', 'product_price'=>'2299.99', 'product_img'=>'products/product1.jpg'),
  4.   "101" =>array('product_id'=>'101', 'product_name'=>'Sony VAIO 11.1" Notebook PC','product_desc'=>'Weighing in at just an amazing 2.84 pounds and offering a sleek, durable
  5. carbon-fiber case in charcoal black. And with 4 to 10 hours of standard battery life, it has the stamina to power you through your most demanding applications.', 'product_price'=>'2699.99', 'product_img'=>'products/product6.jpg'),
  6.   "102" =>array('product_id'=>'102', 'product_name'=>'Canon Digital Rebel XT 8MP Digital SLR Camera','product_desc'=>'Canon EOS Digital Rebel XT SLR adds resolution, speed,
  7. extra creative control, and enhanced comfort in the hand to one of the smallest and lightest digital cameras in its class.', 'product_price'=>'550.00', 'product_img'=>'products/product3.jpg'),
  8.   "103" =>array('product_id'=>'103', 'product_name'=>'HTC Touch Diamond','product_desc'=>'Re-defining the perception of advanced mobile phones… the HTC Touch Diamond™ signals
  9. a giant leap forward in combining hi-tech prowess with intuitive usability and exhilarating design.', 'product_price'=>'750.00', 'product_img'=>'products/product4.jpg'),
  10.   "104" =>array('product_id'=>'104', 'product_name'=>'Apple iMac G5 Desktop','product_desc'=>'IMAC G5/1.8 256MB 160GB SD 20IN OS10.3', 'product_price'=>'1600.00',
  11. 'product_img'=>'products/product2.jpg'),
  12.   "105" =>array('product_id'=>'105', 'product_name'=>'Blackberry 8900','product_desc'=>'', 'product_price'=>'1150.00', 'product_img'=>'products/product5.jpg'),
  13.   "106" =>array('product_id'=>'106', 'product_name'=>'Headphone with mic','product_desc'=>'', 'product_price'=>'148.85', 'product_img'=>'products/product8.jpg')

por esto pero sin quitarle el array
Código PHP:
Ver original
  1. <input type="hidden" pimage="<?php echo $row['img']; ?>" pprice="<?php echo $row['price']; ?>" pdesc="<?php echo $row['description']; ?>" pname="<?php echo $row['name']; ?>">
  #2 (permalink)  
Antiguo 21/11/2016, 19:40
 
Fecha de Ingreso: abril-2012
Mensajes: 124
Antigüedad: 12 años
Puntos: 3
Respuesta: variable a product_array indefinida

No entiendo bien lo que quieres reempalzar.
Quieres crear un input para cada elemento del array? o un formulario?
__________________
Mi web de programación en PHP en construcción, claro. Un dia de esos pongo algo.
  #3 (permalink)  
Antiguo 22/11/2016, 00:28
Avatar de AngelKrak  
Fecha de Ingreso: noviembre-2014
Mensajes: 917
Antigüedad: 9 años, 4 meses
Puntos: 91
Respuesta: variable a product_array indefinida

ya se lo solucione por inbox

Código PHP:
Ver original
  1. $product_array = array(
  2.   $row['id'] =>array('product_id'=>$row['id'], 'product_name'=>$row['name'],'product_desc'=>$row['description'], 'product_price'=>$row["price"], 'product_img'=>$row['img'])
  3. );

Etiquetas: variable
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:15.