query or string problem?
Posted: Thu Apr 15, 2004 8:45 am
hello,
i'm a newbie
i have a problem with a query and/or a string to make an record downloadable
well, i've a DB with 2 tables:
table news
id_news auto_increment
title
date
author
news
table pdf:
id_pdf auto_increment
id_sharepdf
DatiBinari
Nome
Size
Type
Relationship 1 to 1
the script:
now, the link :
doesn't work.
i need help to know where is the problem: link or query ( or both)?
thanks to all
i'm a newbie
i have a problem with a query and/or a string to make an record downloadable
well, i've a DB with 2 tables:
table news
id_news auto_increment
title
date
author
news
table pdf:
id_pdf auto_increment
id_sharepdf
DatiBinari
Nome
Size
Type
Relationship 1 to 1
the script:
Code: Select all
<?php
include("dbconnect.php");
$getnews = mysql_query("select * from news ORDER BY id_news DESC")or die (mysql_error());
$query = mysql_query("SELECT pdf.Nome, pdf.id_pdf, news.id_news FROM pdf, news WHERE news.id_news = pdf.id_sharepdf ORDER BY id_news DESC")or die (mysql_error());
while ($row = mysql_fetch_array($getnews))
{
list ($nome)=mysql_fetch_row($query);
extract($row);
echo <<< NEWS
<div id="riga"><h3>Titolo: $title</h3></div>
<div id="riga1"=><h4>News inserita il $date - <b>Autore:</b> $author</h4></div>
<div id="riga2"><h5>$news</h5><img src="../../../immagini/pdf.gif" width="16" height="16" style="float: left;" /><h6>
<a href="download.php?action=download&Id={$nome['Nome']}" /><h6>{$nome}</h6></a>
<img src="../../../immagini/word.gif" width="16" height="16" style="float: left;" /><h6>$nome1</h6>
</div>
<div id="riga3"></div>
NEWS;
}
?>Code: Select all
<?php
<a href="download.php?action=download&Id={$nome['Nome']}" /><h6>{$nome}</h6></a>
?>i need help to know where is the problem: link or query ( or both)?
thanks to all