Ma che hai sistemato? Adesso manca la condizione che lega le due tabelle..
Ma che hai sistemato? Adesso manca la condizione che lega le due tabelle..
Grazie a tutti sono arrivato alla soluzione!
Riapro questa discussione in quanto ho un altro problema:
questo è il codice
------------------------
include("setConn.php");
$start = $_GET["start"];
if(!isset($start)OR $start<0)
$start=0;
$step=20;
$sql = "SELECT fatture.ID, fatture.numero, fatture.ID_fornitore, fatture.giorno, fatture.mese, fatture.anno, fornitori.ID , fornitori.nome as nome FROM fatture, fornitori WHERE fatture.ID_fornitore=fornitori.ID LIMIT $start, $step";
$result = mysql_db_query("news", $sql, $db);
print "<table width='100%'>";
print "<tr><td height='50'>FORNITORE</td><td height='50'>NUMERO</td></tr>";
while ($row = mysql_fetch_array($result)) {
print "<tr>";
print "<td height='20'>".$row["nome"]."</td><td height='20'>".$row["numero"]."</td>";
print "</tr>";
}
print "</table>";
-------------------------
Il problema è che mi compare il nome del fornitore però l'ID è del fornitore mentre a me serve quello della fattura(in $row["ID"])
Consigli?
Risolto grazie!!!
Puoi comunque usare list per mappare il result set.
codice:while (list($fatture_ID, $fatture_numero, $fatture_ID_fornitore, $fatture_giorno, $fatture_mese, $fatture_anno, $fornitori_ID , $fornitori_nome) = mysql_fetch_array($result)) { ... }