Bu yüzden uni için bir eTicaret sitesi yapıyorum ve aslında siteyi kromda görüntülemeye çalışana kadar her şey yolundaydı. Esasen uni'de MySQL malzemelerinden bir tablo oluşturuyorum. Sahip olduğum problem, masanın üzerinde olması gereken yer. Kodun dağınık olması için özür dilerim. Bir şeyler eklemek arasındayım. PHP echo sorunları, yanlış görüntüleniyor
Kod çalıştırırsanız
<?php $command='select * from products' ; $runCommand=m ysqli_query($connection, $command); if (mysqli_num_rows($runCommand)>0){ echo "
<form id=\ "shoppingcart\" action=\ "cart.php\" method=\ "post\">"; echo "
<table>"; echo "
<thead>"; echo "
<tr>"; echo "
<th scope=\ "col\">Image</th>"; echo "
<th scope=\ "col\">Item</th>"; echo "
<th scope=\ "col\">Qty</th>"; echo "
<th scope=\ "col\">UpdatedQty</th>"; echo "
<th scope=\ "col\">Price</th>"; echo "</tr>"; echo "</thead>"; while($ROWVARIABLE= mysqli_fetch_assoc($runCommand)) { //line BROKE goes here //need an if quantity=0 then don't print the bunch we have under here...// echo "
<tr>"; echo "
<td>
<img src='". $ROWVARIABLE["image"]. "' alt='". $ROWVARIABLE["decription"]. "' height='200' '</img></td>"; //this is still one line, don't flip shit. It 's the img with a hover over Decription
\t \t \t echo "<td>". $ROWVARIABLE["name"]. "</td>"; //Item
\t \t \t echo "<td>".newID[$ROWVARIABLE["ID"]]."</td>"; //Quantity
\t \t \t echo "<td><select name=\"updateQ\" id=\"updateQ\">"; //Updated Quantity
\t \t \t echo "<option selected=\"selected\">No change</option>";
\t \t \t echo "<option>1</option>";
\t \t \t echo "<option>2</option>";
\t \t \t echo "<option>3</option>";
\t \t \t echo "<option>4</option>";
\t \t \t echo "<option>5</option>";
\t \t \t echo "<option>6</option>";
\t \t \t echo "<option>7</option>";
\t \t \t echo "<option>8</option>";
\t \t \t echo "<option>9</option>";
\t \t \t echo "</select>";
\t \t \t echo "</td>";
\t \t \t //BROKE 2.0
\t \t \t // Gotta fix this ^^ line to display £Price of all units added(£Price of one unit)
\t \t \t
\t \t }
\t echo "</table>";
\t echo "</br>";
\t }
\t else{
\t \t echo "Table broken, pls stahp!";
\t }
\t ?>
.php
olarak kaydedilir ve dosyayı
<!DOCTYPE html>
ile başlatırım. Bu benim dosyamın en yakınının
<?php $connection = mysqli_connect(the stuff I need to connect.); ?>
ile ilgili olduğu düşünülmektedir. HTML bir sürü dışarı yankılanan zaman
https://gyazo.com/0dd6a3d7b025133c5b061e6af06f1091
Sadece soru kodundaki rengi vurgulamak, neyin yanlış gittiğine dair hızlı bir görsel ipucu verir. –
Ekran görüntüsü PHP'nin işlenmemiş gibi görünüyor. Buradaki kod yanlış biçimlendirilmiş görünüyor. – chris85
Notepad ++ ot NetBeans, hataların nerede olduğunu gösterecektir. – mitkosoft