Jump to content
php.lv forumi

Tabula nav sākumā...


reiniger

Recommended Posts

Man pec šitā koda tabla ir nobidijusies aptuveni 10 rindas zemak...

 

<?php
include("include/mysql_connect.php");

$query = "SELECT id, vards, uzvards, per_kods, zvans, zvans_bool, next_zvans, tiksanas_bool, tiksanas_datums,  komentari
	  FROM user_data";
$result = mysql_query($query) or die('Error, query failed');



echo '<table border="1" width="2500"><tr>
<td>ID</td><td>Vārds</td><td>Uzvārds</td><td>Personas kods</td><td>Zvans</td><td>Zv izp.</td>
<td>Nākošais zvans</td><td>Tiks izp.</td><td>Tikšanas datums</td><td>Komentāri</td></tr>';
while(list($id, $vards, $uzvards, $per_kods,
$zvans,$zvans_bool,$next_zvans,$tiksanas_bool,$tiksanas,$komentari) = mysql_fetch_array($result))
{
echo "<tr><td>$id</td><td>$vards</td><td>$uzvards</td><td>$per_kods</td><td>$zvans</td><td>"?>

 <input type="checkbox" name="<? $zvans_bool;?>" value="" <?php if ($zvans_bool==1) { echo "checked";}?> /> 

 <?php echo "</td><td>$next_zvans</td><td> "?>

  <input type="checkbox" name="<? $tiksanas_bool;?>" value="" <?php if ($tiksanas_bool==1) { echo "checked";}?> /> 

<?php echo "</td><td>$tiksanas</td><td>$komentari</td>
<td><a href='edit.php?id=$id'>Edit</a></td><td><a href='delete.php?id=$id'>delete</a></td><br/>";
}
echo '</table>';

mysql_close($connection);
?>

 

Kas jāpamaina lai tabula būtu sākumā?

Edited by reiniger
Link to comment
Share on other sites

jap jap, ne to ko gribeju uzrakstiju :) nu es skatos tev parak liels width stav, bet nav align un valign ... tapec manuprat tur varetu ta vaina slepties

Edited by 777
Link to comment
Share on other sites

pie tam skaties kads tev kods

 

<?php echo "</td><td>$next_zvans</td><td> "?>

 

kur tad pazuda ";"

 

</td>
<?php echo "<td>$next_zvans</td> "; ?>
<td>

Edited by 777
Link to comment
Share on other sites

<?php
include("include/mysql_connect.php");

$query = "SELECT id, vards, uzvards, per_kods, zvans, zvans_bool, next_zvans, tiksanas_bool, tiksanas_datums,  komentari
	  FROM user_data";
$result = mysql_query($query) or die('Error, query failed');

 

<?php
include("include/mysql_connect.php");

$query = mysql_query("SELECT id, vards, uzvards, per_kods, zvans, zvans_bool, next_zvans, tiksanas_bool, tiksanas_datums,  komentari
	  FROM user_data") or die('Error, query failed');
$result = mysql_fetch_array($query);

 

un pec tam raksti $result[id], $result[vards], $result[per_kods] ....

Edited by 777
Link to comment
Share on other sites

×
×
  • Create New...