[eluser]antoniog[/eluser]
Hi all,
I set the model, which reproduce the code to follow, on the page to print the data extracted from the database table that is referenced by the query.
The query works well as an example in the User Guide but I'd need to print the values obtained in the exact spots on the page and not as high as in the example.
What changes should I make?
I tried other queries but this is what works best.
Model code:
Code:
<?php
class MListe extends CI_Model {
function __construct()
{
$this->load->database();
}
public function getDettagli()
{
$dettagli = $this->db->query("SELECT numero_link, raggio_pr, prezzo FROM spp_liste");
if ($dettagli->num_rows() > 0)
{
$row = $dettagli->row_array(1);
echo $row['numero_link'];
echo $row['raggio_pr'];
echo $row['prezzo'];
}
$dettagli->free_result();
}
}
Page code:
Code:
<div class="do1" id="do11"></div>
<!-- Inizio Area Principale -->
<div class="ap" id="ap">
<!-- Inizio maschera Area Principale -->
<div class="maschera1d">
<div class="masass" id="masass"><img src="../imm/mas/ass.gif" alt="angolo superiore sinistro" /></div>
<div class="masbs" id="masbs"><img src="../imm/mas/bs.gif" align="top" alt="bordo superiore" /></div>
<div class="masasd" id="masasd"><img src="../imm/mas/asd.gif" alt="angolo superiore destro" /></div>
<div id="masls3"><img src="../imm/mas/l.gif" alt="lato sinistro" /></div>
<div id="area3">
<!-- Inizio Spazio editabile -->
<h1>Directory e Motori Italiani</h1>
<div id="navlist">
<div id="list1">
<p class="pprod2">Numero Link</p>
<?php echo $row['numero_link'];?> <-- Position in which to print the respective data
</div>
<div id="list2">
<p class="pprod2">PageRank<sup>®</sup></p>
<?php echo $row['raggio_pr'];?> <-- Position in which to print the respective data
</div>
<div id="list3">
<p class="pprod2">Prezzo</p>
[b]<?php echo $row['prezzo'];?> <-- Position in which to print the respective data
...
</div>
<div id="list4">
<p class="pprod3">Pagamenti accettati</p>
<?php echo anchor("pagam_bba", "Bonifico Bancario");?><br />
<?php echo anchor("pagam_papp", "Paga Adesso di PayPal");?>
</div>
<div class="do1"></div>
<div id="list5">
<b>Attenzione</b><br />
Il collegamento per scaricare la lista sarà inoltrato alla e-mail utilizzata per effettuare l'ordine appena avremo ricevuto il suo pagamento nel nostro conto bancario.
</div>
</div>
<!-- Fine Spazio editabile -->
</div>
<div id="masld3"><img src="../imm/mas/l.gif" alt="lato destro" /></div>
<div class="masais" id="masais"><img src="../imm/mas/ais.gif" alt="angolo superiore destro" /></div>
<div class="masbi" id="masbi"><img src="../imm/mas/bs.gif" alt="bordo inferiore" /></div>
<div class="masaid" id="masaid"><img src="../imm/mas/aid.gif" alt="angolo inferiore destro" /></div>
</div>
<!-- Fine maschera Area Principale -->
</div>
<!-- Fine Area Principale -->
<div class="do1" id="do103"></div>
In bold, the point at which the respective data should appear.
For each given the following error message appears with the relevant line of code that generates the error.
One error code:
Code:
Severity: Notice
Message: Undefined variable: row
Filename: pages/liste.php
...
I thank the help of everyone, and I also accept suggestions and recommendations to modify the code to obtain the result.