Autor Zpráva
pito
Profil
Jak to zmenim do php kodu

SELECT tymy.nazev AS tymA, (

SELECT nazev
FROM tymy
WHERE tymy.id = zapasy.id_tymB
) AS tymB, tip.tip AS tip
FROM tip
INNER JOIN zapasy ON tip.id_zapas = zapasy.id
INNER JOIN tymy ON zapasy.id_tymA = tymy.id
WHERE tip.id_uzivatel =1
ORDER BY tip.id_tip DESC
Sicario
Profil *
$result = mysql_query("SELECT ...");
pito
Profil
mam to takhle a nic mi to neukazuje

<?
require "db.php";
$result = mysql_query ('SELECT tymy.nazev AS tymA, ('SELECT nazev FROM tymy WHERE tymy.id = zapasy.id_tymB') AS tymB, tip.tip AS tip FROM tip'
        . ' INNER JOIN zapasy ON tip.id_zapas = zapasy.id'
        . ' INNER JOIN tymy ON zapasy.id_tymA = tymy.id'
        . ' WHERE tip.id_uzivatel =1 '
        . ' ORDER BY tip.id_tip DESC'); 


while($zaznam = mysql_fetch_array( $result )) {
	

echo $zaznam['tymA']
echo $zaznam['tymB']
echo $zaznam['tip']
	
} 

?>
Sicario
Profil *
Tak minimalne to musi hazet nejakou chybu protoze na radku $result = mysql_query ('SELECT tymy.nazev.... mas navic par uvozovek.

Po provedeni dotazu si nech vypsat chybova hlaseni SQL (jsou-li nejaka) pomoci echo mysql_error();.

Co pole obsahuje, se nejlepe zjistuje pomoci funkce print_r. Do tela cyklu vloz print_r($zaznam);.
Kajman_
Profil *
$result = mysql_query ('SELECT tymy.nazev AS tymA, (SELECT nazev FROM tymy WHERE tymy.id = zapasy.id_tymB) AS tymB, tip.tip AS tip FROM tip'
        . ' INNER JOIN zapasy ON tip.id_zapas = zapasy.id'
        . ' INNER JOIN tymy ON zapasy.id_tymA = tymy.id'
        . ' WHERE tip.id_uzivatel =1 '
        . ' ORDER BY tip.id_tip DESC') or die(mysql_error()); 
pito
Profil
pise mi to chybu Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /3w/wz.cz/i/icq5pool/tipes.php on line 16

a 16 radek je tohle:
echo ."$zaznam['tymA'].";
BetaCam
Profil
pito
require "db.php";
$result = mysql_query ('SELECT tymy.nazev AS tymA,
						(SELECT nazev FROM tymy WHERE tymy.id = zapasy.id_tymB) AS tymB,
						tip.tip AS tip
						FROM tip
        					INNER JOIN zapasy ON tip.id_zapas = zapasy.id
        					INNER JOIN tymy ON zapasy.id_tymA = tymy.id
        				WHERE tip.id_uzivatel =1
        				ORDER BY tip.id_tip DESC');


while($zaznam = mysql_fetch_array($result)) {


echo $zaznam['tymA'];
echo $zaznam['tymB'];
echo $zaznam['tip'];

}
pito
Profil
moc ti dekuji BetaCam

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: