• 0
Sign in to follow this  
Joao Emilio

Comanda Eletronica


Galera por favor ..eu preciso mostrar nesse foreach somente os produtos cuja categoria seja PIZZAS e não to conseguindo .

Ta dando o seguinte errro:"Parse error: syntax error, unexpected 'Where' (T_STRING), expecting ')' in C:\wamp64\www\ComandaNova\pizza.php on line 21"

vou mandar a foto do meu banco pra ver se ajuda >>

 <?php foreach($products  as $product Where $product['categoria'] == 'Pizzas'):?> 	
			            <div class="col-sm-6 col-md-4">
							<div class="thumbnail">							    
							    <div class="caption text-center">							      
					   			    <img src="imagens/<?php echo $product['imagens']; ?>" alt="<?php echo $product['nome']; ?>">								   				   
								    <h3><?php echo $product['nome']?></h3>
							  	    R$ <?php echo number_format($product['preço'], 2, ',', '.')?>
							<p><a href="carrinho.php?acao=add&id=<?php echo $product['id']?>" class="btn btn-primary" role="button">Comprar</a> </p>
			        <?php endforeach;?>


Captura de Tela (4).png

Share this post

Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this