I want to make 3 tables with player rankings (I want to add a picture of the class and some other information there), but after taking the working tables and adding information from 1 database, I see that there is a lot of no needed code, which I don't know how to remove ...
I also have a problem, because under the tables I have a gray line that looks terribly ugly.
Thank you for all the help!
<?php include_once "settings.php";
//Ranking
//p1
$query0 = "
SELECT name, honor
FROM players
ORDER BY honor DESC
LIMIT 0,1
";
$result0 = mysqli_query($db, $query0);
$row0 = mysqli_fetch_row($result0);
//p2
$query1 = "
SELECT name, honor
FROM players
ORDER BY honor DESC
LIMIT 1,1
";
$result1 = mysqli_query($db, $query1);
$row1 = mysqli_fetch_row($result1);
//p3
$query2 = "
SELECT name, honor
FROM players
ORDER BY honor DESC
LIMIT 2,1
";
$result2 = mysqli_query($db, $query2);
$row2 = mysqli_fetch_row($result2);
//p4
$query3 = "
SELECT name, honor
FROM players
ORDER BY honor DESC
LIMIT 3,1
";
$result3 = mysqli_query($db, $query3);
$row3 = mysqli_fetch_row($result3);
//p5
$query4 = "
SELECT name, honor
FROM players
ORDER BY honor DESC
LIMIT 4,1
";
$result4 = mysqli_query($db, $query4);
$row4 = mysqli_fetch_row($result4);
//Strona
head("Ranking");
?>
<table style="width: 100%;" border="0">
<tbody>
<tr>
<td style="vertical-align: top; padding-left: 20px;">
<div class="btn_main">
<div class="btn_before"> </div>
<div class="btn_center"><span>Ranking graczy:</span></div>
<div class="btn_after"> </div>
</div>
<br>
<br>
<table align="center">
<tr>
<td>
<table>
<tr>
<td>
<div class="container">
<header>
<div class="btn_main">
<div class="btn_before"> </div>
<div class="btn_center"><span>Easy:</span></div>
<div class="btn_after"> </div>
</div>
</header>
<div class="wrapper">
<table align="center" class="tablea" border="1"
style="border-color:#343434" cellpadding="0"
cellspacing="1">
<thead>
<tr>
<th> P</th>
<th> Gracz</th>
<th> Cześć</th>
</tr>
</thead>
<tbody>
<tr>
<td class="poz">1</td>
<td class="Gracz"><?=$row0[0]?></td>
<td class="Cześć"><?=$row0[1]?></td>
</tr>
<tr>
<td class="poz">2</td>
<td class="Gracz"><?=$row1[0]?></td>
<td class="Cześć"><?=$row1[1]?></td>
</tr>
<tr>
<td class="poz">3</td>
<td class="Gracz"><?=$row2[0]?></td>
<td class="Cześć"><?=$row2[1]?></td>
</tr>
<tr>
<td class="poz">4</td>
<td class="Gracz"><?=$row3[0]?></td>
<td class="Cześć"><?=$row3[1]?></td>
</tr>
<tr>
<td class="poz">5</td>
<td class="Gracz"><?=$row4[0]?></td>
<td class="Cześć"><?=$row4[1]?></td>
</tr>
</tbody>
</table>
</div>
</div>
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>
<div class="container">
<header>
<div class="btn_main">
<div class="btn_before"> </div>
<div class="btn_center"><span>Medium:</span></div>
<div class="btn_after"> </div>
</div>
</header>
<div class="wrapper">
<table align="center" class="tablea" border="1"
style="border-color:#343434" cellpadding="0"
cellspacing="1">
<thead>
<tr>
<th> P</th>
<th> Gracz</th>
<th> Cześć</th>
</tr>
</thead>
<tbody>
<tr>
<td class="poz">1</td>
<td class="Gracz"><?=$row0[0]?></td>
<td class="Cześć"><?=$row0[1]?></td>
</tr>
<tr>
<td class="poz">2</td>
<td class="Gracz"><?=$row1[0]?></td>
<td class="Cześć"><?=$row1[1]?></td>
</tr>
<tr>
<td class="poz">3</td>
<td class="Gracz"><?=$row2[0]?></td>
<td class="Cześć"><?=$row2[1]?></td>
</tr>
<tr>
<td class="poz">4</td>
<td class="Gracz"><?=$row3[0]?></td>
<td class="Cześć"><?=$row3[1]?></td>
</tr>
<tr>
<td class="poz">5</td>
<td class="Gracz"><?=$row4[0]?></td>
<td class="Cześć"><?=$row4[1]?></td>
</tr>
</tbody>
</table>
</div>
</div>
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>
<div class="container">
<header>
<div class="btn_main">
<div class="btn_before"> </div>
<div class="btn_center"><span>Hard:</span></div>
<div class="btn_after"> </div>
</div>
</header>
<div class="wrapper">
<table align="center" class="tablea" border="1"
style="border-color:#343434" cellpadding="0"
cellspacing="1">
<thead>
<tr>
<th> P</th>
<th> Gracz</th>
<th> Cześć</th>
</tr>
</thead>
<tbody>
<tr>
<td class="poz">1</td>
<td class="Gracz"><?=$row0[0]?></td>
<td class="Cześć"><?=$row0[1]?></td>
</tr>
<tr>
<td class="poz">2</td>
<td class="Gracz"><?=$row1[0]?></td>
<td class="Cześć"><?=$row1[1]?></td>
</tr>
<tr>
<td class="poz">3</td>
<td class="Gracz"><?=$row2[0]?></td>
<td class="Cześć"><?=$row2[1]?></td>
</tr>
<tr>
<td class="poz">4</td>
<td class="Gracz"><?=$row3[0]?></td>
<td class="Cześć"><?=$row3[1]?></td>
</tr>
<tr>
<td class="poz">5</td>
<td class="Gracz"><?=$row4[0]?></td>
<td class="Cześć"><?=$row4[1]?></td>
</tr>
</tbody>
</table>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<BR>
<BR>
</td>
</tr>
</tbody>
</table>
<?php
foot()
?>
Do something like this:
$thisquery = "SELECT name, honor FROM players ORDER BY honor DESC LIMIT 0,4";
$query = mysqli_query($con,$thisquery);
while ($result = mysqli_fetch_array($query)) {
$resultArr[] = array($result["name"],$result["honor"]);
}
echo "<table id='mytable'>";
echo "<tr><td>Position</td><td>name</td><td>honor</td></tr>";
$i=0;
foreach($resultArr[] as $key => $value) {
$i++;
echo "<tr><td class=\"poz\">$i</td>
<td class=\"Gracz\"><?= $value[0] ?></td>
<td class=\"Cześć\"><?= $value[1] ?></td>
</tr>";
}
echo "</table>";
In your CSS you can style like this:
table #mytable td {
background: #eee;
}
(Code not tested, just typed, so beware of typo's.)
Related
first question here, my problem is this.
I've got 22 more or less values to print stored inside a table in a DB. Problem is some of this values gotta have HTML tags in it, mainly tags <s> .
<?php
$query = "SELECT * FROM teams";
$result = mysqli_query($db, $query);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
echo "
<div class='col-md-12'>
<div class='card strpied-tabled-with-hover'>
<div class='card-header '>
<h4 class='card-title'>".$row['name']." ".$row['surname']."</h4>
<p class='card-category'>".$row['team']."</p>
</div>
<div class='card-body table-full-width table-responsive'>
<table class='table table-hover table-striped'>
<thead>
<th>#</th>
<th>Player</th>
<th>Player Bonus</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td style='color:red; font-weight:bold'>".$row['c1']."</td>
<td>".$row['c1b']."</td>
</tr>
<tr>
<td>2</td>
<td>".$row['c2']."</td>
<td>".$row['c2b']."</td>
</tr>
<tr>
<td>3</td>
<td>".$row['c3']."</td>
<td>".$row['c3b']."</td>
</tr>
<tr>
<td>4</td>
<td>".$row['c4']."</td>
<td>".$row['c4b']."</td>
</tr>
<tr>
<td>5</td>
<td>".$row['c5']."</td>
<td>".$row['c5b']."</td>
</tr>
<tr>
<td>6</td>
<td>".$row['c6']."</td>
<td>".$row['c6b']."</td>
</tr>
<tr>
<td>7</td>
<td>".$row['c7']."</td>
<td>".$row['c7b']."</td>
</tr>
<tr>
<td>8</td>
<td>".$row['c8']."</td>
<td>".$row['c8b']."</td>
</tr>
<tr>
<td>9</td>
<td>".$row['c9']."</td>
<td>".$row['c9b']."</td>
</tr>
<tr>
<td>10</td>
<td>".$row['c10']."</td>
<td>".$row['c10b']."</td>
</tr>
<tr>
<td>11</td>
<td>".$row['c11']."</td>
<td>".$row['c11b']."</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>";} ?>
TL;DR: $row[c1] and so on have HTML tags stored as values like <s>stringvalue</s> but it just echo stringvalue. What can I do? Thanks and sorry for my inexperience.
EDIT: I mispelled the title in an horrific way.
I want to generate HTML table into PDF.
But I'm having trouble for gridding the table. I want to generate table like this:
I have this table from database:
Which is should fill this column:
and I have a second table from database like this:
which is should fill the rest of the columns except keterangan column.
I tried this code :
<table class="tbl" border="1" style="margin: 0 auto;">
<tr style="height: 50px;">
<th rowspan="2" style="width: 50%">Nomor</th>
<th colspan="4">Pemberian entertaiment dan sejenisnya</th>
<th colspan="4">Relasi usaha yang diberikan entertainment dan sejenisnya</th>
<th rowspan="2">Keterangan</th>
</tr>
<tr>
<th>Tanggal</th>
<th>Alamat</th>
<th>Jenis</th>
<th>Jumlah</th>
<th>Nama</th>
<th>Posisi</th>
<th>Nama Perusahaan</th>
<th>Jenis Usaha</th>
</tr>
<tr>
<td>
<?PHP echo $row->nomor?>
</td>
<td>
<?PHP echo $row->tanggal?>
</td>
<td>
<?php echo $row->alamat?>
</td>
<td>
<?PHP echo $row->jenis?>
</td>
<td>
<?PHP echo $row->jumlah?>
</td>
<?php
foreach ($list->result() as $data){
?>
<tr>
<td>
<?PHP echo $data->nama?>
</td>
<td>
<?PHP echo $data->posisi?>
</td>
<td>
<?PHP echo $data->nama_perusahan?>
</td>
<td>
<?PHP echo $data->jenis_usaha?>
</td>
</tr>
<?php
}
?>
<td>
<?PHP echo $row->keterangan?>
</td>
</tr>
but this is the result :
Try this:
<table class="tbl" border="1" style="margin: 0 auto;">
<tr style="height: 50px;">
<th rowspan="2" style="width: 50%">Nomor</th>
<th colspan="4">Pemberian entertaiment dan sejenisnya</th>
<th colspan="4">Relasi usaha yang diberikan entertainment dan sejenisnya</th>
<th rowspan="2">Keterangan</th>
</tr>
<tr>
<th>Tanggal</th>
<th>Alamat</th>
<th>Jenis</th>
<th>Jumlah</th>
<th>Nama</th>
<th>Posisi</th>
<th>Nama Perusahaan</th>
<th>Jenis Usaha</th>
</tr>
<tr>
<td>
<?PHP echo $row->nomor?>
</td>
<td>
<?PHP echo $row->tanggal?>
</td>
<td>
<?php echo $row->alamat?>
</td>
<td>
<?PHP echo $row->jenis?>
</td>
<td>
<?PHP echo $row->jumlah?>
</td>
<?php
foreach ($list->result() as $data){
?>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td>
<?PHP echo $data->nama?>
</td>
<td>
<?PHP echo $data->posisi?>
</td>
<td>
<?PHP echo $data->nama_perusahan?>
</td>
<td>
<?PHP echo $data->jenis_usaha?>
</td>
</tr>
<?php
}
?>
<td>
<?PHP echo $row->keterangan?>
</td>
</tr>
Note the extra columns are added inside the loop to enable it to line up with you headers.
Here is my php code
<?php
include "conn.php";
if(isset($_POST['submit'])){
$id_guru=htmlentities($_POST['id_guru']);
$id_pelajaran=htmlentities($_POST['id_pelajaran']);
$id_kelas=htmlentities($_POST['id_kelas']);
$query=mysql_query("insert into tbl_jadwal values('','$id_guru','$id_pelajaran','$id_kelas')");
if($query){
?><script language="javascript">document.location.href="?page=jadwal_pengajaran&status=1";</script><?php
}else{
?><script language="javascript">document.location.href="?page=jadwal_pengajaran&status=2";</script><?php
}
}else{
unset($_POST['submit']);
}
?>
<!-- start page-heading --><title>Sistem Informasi SMP YPPI</title>
<div id="page-heading">
<h1>Jadwal Pengajaran</h1>
</div>
<!-- end page-heading -->
<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
<tr>
<th rowspan="3" class="sized"><img src="images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
<th class="topleft"></th>
<td id="tbl-border-top"> </td>
<th class="topright"></th>
<th rowspan="3" class="sized"><img src="images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
</tr>
<tr>
<td id="tbl-border-left"></td>
<td>
<!-- start content-table-inner ...................................................................... START -->
<div id="content-table-inner">
<?php
if($_GET['status']=='1'){
?>
<div id="message-green">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="green-left">Data Tersimpan</td>
<td class="green-right"><a class="close-green"><img src="images/table/icon_close_green.gif" alt="" /></a></td>
</tr>
</table>
</div>
<?php
}
if($_GET['status']=='0'){
?>
<div id="message-red">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="red-left">Gagal Menyimpan</td>
<td class="red-right"><a class="close-red"><img src="images/table/icon_close_red.gif" alt="" /></a></td>
</tr>
</table>
</div>
<?php
}
?>
<form action="?page=jadwal_pengajaran" method="post">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td><!-- start step-holder -->
<!-- end step-holder -->
<!-- start id-form -->
<table border="0" cellpadding="0" cellspacing="0" id="id-form">
<tr>
<th valign="top">Guru</th>
<td><select name="id_guru" class="styledselect_form_1">
<?php
$guru=mysql_query("select * from data_guru order by nama_guru asc");
while($row1=mysql_fetch_array($guru)){
?>
<option value="<?php echo $row1['id_guru'];?>"><?php echo $row1['nama_guru'];?> [ <?php echo $row1['nip'];?> ] <option>
<?php
}
?>
</select>
</td>
<td></td>
</tr>
<tr>
<th valign="top">Pelajaran</th>
<td><select name="id_pelajaran" class="styledselect_form_1">
<?php
$pelajaran=mysql_query("select * from setup_pelajaran order by nama_pelajaran asc");
while($row2=mysql_fetch_array($pelajaran)){
?>
<option value="<?php echo $row2['id_pelajaran'];?>"><?php echo $row2['nama_pelajaran'];?></option>
<?php
}
?>
</select>
</td>
<td></td>
</tr>
<tr>
<th valign="top">Kelas</th>
<td><select name="id_kelas" class="styledselect_form_1">
<?php
$kelas=mysql_query("select * from setup_kelas order by nama_kelas asc");
while($row3=mysql_fetch_array($kelas)){
?>
<option value="<?php echo $row3['id_kelas'];?>"><?php echo $row3['nama_kelas'];?></option>
<?php
}
?>
</select>
</td>
<td></td>
</tr>
<tr>
<th> </th>
<td valign="top"><input type="submit" name="submit" class="form-submit" />
<input type="reset" class="form-reset" />
</td>
<td></td>
</tr>
</table>
<!-- end id-form -->
</td>
<td><!-- start related-activities -->
</td>
</tr>
<tr>
<td><img src="images/shared/blank.gif" width="695" height="1" alt="blank" /></td>
<td></td>
</tr>
</table>
</form>
<p><em>*Tidak boleh 1 Kelas, 1 Pelajaran di ajarkan oleh 2 Guru atau lebih<br /></em> </p>
<p> </p>
<!-- start product-table ..................................................................................... -->
<form id="mainform" action="">
<table border="0" width="71%" cellpadding="0" cellspacing="0" id="product-table">
<tr>
<th width="13%" class="table-header-repeat line-left minwidth-1">Nomor </th>
<th width="24%" class="table-header-repeat line-left minwidth-1">Nama Guru</th>
<th width="26%" class="table-header-repeat line-left minwidth-1">NIP</th>
<th width="24%" class="table-header-repeat line-left minwidth-1">Mata Pelajaran</th>
<th width="24%" class="table-header-repeat line-left minwidth-1">Kelas</th>
<th width="13%" class="table-header-options line-left">Aksi</th>
</tr>
**<?php
$view=mysql_query("*SELECT* FROM tbl_jadwal jadwal, setup_kelas kelas, setup_pelajaran pelajaran, data_guru guru where jadwal.id_kelas=kelas.id_kelas and jadwal.id_pelajaran=pelajaran.id_pelajaran and jadwal.id_guru=guru.id_guru order by id_jadwal asc");
$no=0;
while($row=mysql_fetch_array($view)){
?>
<tr>
<td><?php echo $no=$no+1;?></td>
<td><?php echo $row['nama_guru'];?></td>
<td><?php echo $row['nip'];?></td>
<td><?php echo $row['nama_pelajaran'];?></td>
<td><?php echo $row['nama_kelas'];?></td>
<td class="options-width">
</td>
</tr>
<?php
}
?>
</table>
<!-- end product-table................................... -->
</form>
<div class="clear"></div>
</div>
<!-- end content-table-inner ............................................END -->
</td>
<td id="tbl-border-right"></td>
</tr>
<tr>
<th class="sized bottomleft"></th>
<td id="tbl-border-bottom"> </td>
<th class="sized bottomright"></th>
</tr>
</table>**
When i test the code on browser, there's nothing displayed, only empty table, but there is saved data on the database.
I believe the problem came from
**<?php
$view=mysql_query("*SELECT* FROM tbl_jadwal jadwal, setup_kelas kelas, setup_pelajaran pelajaran, data_guru guru where jadwal.id_kelas=kelas.id_kelas and jadwal.id_pelajaran=pelajaran.id_pelajaran and jadwal.id_guru=guru.id_guru order by id_jadwal asc");
$no=0;
while($row=mysql_fetch_array($view)){
?>
<tr>
<td><?php echo $no=$no+1;?></td>
<td><?php echo $row['nama_guru'];?></td>
<td><?php echo $row['nip'];?></td>
<td><?php echo $row['nama_pelajaran'];?></td>
<td><?php echo $row['nama_kelas'];?></td>
<td class="options-width">
</td>
</tr>
<?php
}
?>
But still I can't figure out what the problem is.
is that
$view=mysql_query("*SELECT* FROM ...
from the paste, it should look like this:
$view=mysql_query("SELECT * FROM ...
and
while($row=mysql_fetch_array($view)){
will give you a numbered array, not an associative array. Thus you need to EITHER access fields in their order:
<td><?php echo $row[0];?></td>
<td><?php echo $row[1];?></td> ...
or use assoc (NOT BOTH):
while($row=mysql_fetch_assoc($view)){
Hello I'm trying to update this scholarship application box. However when the year changed to 2013 it only displays scholarship applicant info from 2013. I'd like it to display info from 2012. I tried messing around with the date but I cant seem to figure it out. Any help would be greatly appreciated!
<?php
$appYear = date("Y").'-'.(date("Y")+1);
$sql = 'select * from sApplication where studentID = "'.$database->iPrep($_SESSION['ID']).'" AND appYear = "'.$appYear.'" LIMIT 1';
$appID = Scholarship::iFindSQL($sql);
$total = count($appID);
if ($total > 0)
{
$app = array_shift($appID);
}
else
{
$app = 0;
}
?>
<li id="item-2">
<div id="appStatus">
<h3>Application Status</h3>
<blockquote>
<?php if ($app->submitted == ('0000-00-00') || !isset($app->submitted)) { ?>
<table style="border:1px solid #000;" width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="50%"><strong>Scholarship<br /> 2013-2014</strong></td>
<td width="50" align="right"> <a style="font-size:16px;" href="welcome.php? app=Scholar">Apply Now</a></td>
</tr>
<tr>
<td><strong>Date Submitted</strong></td>
<td align="right"> </td>
</tr>
<tr>
<td><strong>References</strong></td>
<td align="right"> </td>
</tr>
<tr>
<td><strong>Decision</strong></td>
<td> </td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td><strong>Scholarship 2012-2013</strong></td>
<td> </td>
</tr>
<tr>
<td><strong>Decision</strong></td>
<td> </td>
</tr>
</table>
<?php } else { ?>
<table style="border:1px solid #000;" width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="90%"><strong>Scholarship 2013-2014</strong></td>
<td width="10%" align="right"> </td>
</tr>
<tr>
<td><strong>Date Submitted</strong></td>
<td align="right"><?=dbOutDate($app->submitted)?></td>
</tr>
<tr>
<td><strong>References</strong> </td>
<td align="right"></td>
</tr>
<tr>
<td colspan="2">
<?php
$refs = Reference::iFindSQL("Select * from reference where appID = '".$app->ID."'");?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php foreach($refs as $ref) { ?>
<tr> <td> <small><?php if($ref->rType == 'Academic Reference'){ echo 'Academic/Artistic/Professional'; } else { echo 'Community Service'; } ?></small></td> <td align="right"><?=$ref->status?></td></tr>
<?php } ?>
</table>
</td>
</tr>
<tr>
<td><strong>Decision</strong></td>
<td align="right">
<?php
if ($app->complete == 'Approved') { echo 'Approved'; }
if ($app->complete == 'Declined') { echo 'Declined'; }
if ($app->complete == 'Pending') { echo 'Pending'; }
if ($app->complete == 'Incomplete') { echo 'Incomplete'; }
Remove the WHERE clause that limits the year. Use ORDER BY to sort by year, descending.
$sql = 'select * from sApplication
where studentID = "'.$database->iPrep($_SESSION['ID']).
'" ORDER BY appYear DESC LIMIT 1';
I get that error in php..And I have no idea why...
Here is how my connection is established:
<?php
$hostname_QASite = "localhost";
$database_QASite = "qasite";
$username_QASite = "root";
$password_QASite = "";
$QASite = mysql_pconnect($hostname_QASite, $username_QASite, $password_QASite) or trigger_error(mysql_error(),E_USER_ERROR);
?>
my query is the following:
mysql_select_db($database_QASite, $QASite) or die(mysql_error());
$query_get_all_topics = "SELECT topic_id, title FROM topic";
$get_all_topics = mysql_query($query_get_all_topics, $QASite) or die(mysql_error());
$row_get_all_topics = mysql_fetch_assoc($get_all_topics);
$totalRows_get_all_topics = mysql_num_rows($get_all_topics);
And then I iterate over the row_get_all_topics ...
What is wrong in the code ?
Edit:
I get that error, when I try to loop 2 times over different results in the database.
UPDATE:
<body>
<br/><br/><br/><br/><br/><br/><br/>
<div align="center">
<ul id="navlist">
<li> צור נושא</li>
<li> ראה קשרים</li>
</ul>
<?php do { ?>
<table border="1">
<tr>
<td>
<table width="100%" border="1" >
<tr>
<td width="90%" align="right">
<?php echo $row_get_all_topics['title']; ?>
</td>
<td width="10%">
:שם נושא
</td>
</tr>
<tr>
<td colspan="2">
<table>
<tr>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<?php
//$result=$mysql_query("SELECT title, sub_topic_id FROM sub_topic WHERE topic_id=".$row_get_all_topics['topic_id']) or die(mysql_error());
$result="";
if($row=mysql_fetch_array($result))
{
do
{
?>
<table >
<tr>
<td>
<?php echo $row['title']; ?>
</td>
<td>
:תת נושא
</td>
</tr>
<tr>
<td colspan="2">
<table>
<tr>
<td>
</td>
</tr>
<tr>
<td>
עדכן
</td>
<td>
מחק
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
<?php
**}while($row=mysql_fetch_assoc($result));** 1 FIRST LOOP
}//end suptopic search
?>
<?php **} while ($row_get_all_topics = mysql_fetch_assoc($get_all_topics)); ?>** 2ND LOOP
AS soon as I add this line, to query teh database inside the loop, the page shows the error..
$result=$mysql_query("SELECT title, sub_topic_id FROM sub_topic WHERE topic_id=".$row_get_all_topics['topic_id']) or die(mysql_error());