mam pytanie jak napisac prosty formularz zeby wyswietlal pozniej wyniki z kiliku tabel
mam kilka tabel i chcialbym napisac zapytanie np zeby znalazl mi nazwisko i pozniej wyswietlil wszystki dane z wszystkich tabel, pomocyyyyy
WHERE `cos` LIKE '%$_POST['szukaj']%'
<html> <head> <meta http-equiv=\"Content-type\" content=\"text/html; charset=iso-8859-2\" /> </head> <body bgcolor=\"#B0CEB5\" leftmargin=\"20\" topmargin=\"20\"> <?php include('config.php'); // połączenie z bazą danych // wybór bazy danych $sql = \"Where `autor` Like '%$_POST['szukaj']%'\"; //print \"Usunięto temat $IdTematy\"; //print (\"Usunięto temat\"); ?> </body> </html>
dopisalem ci select bo sam warunek nie jest zapytaniem.
<?php $sql = \"select * from tabela where autor Like '%{$_POST['szukaj']}%'\"; ?>
<html> <head> <meta http-equiv=\"Content-type\" content=\"text/html; charset=iso-8859-2\" /> </head> <body bgcolor=\"#B0CEB5\" leftmargin=\"20\" topmargin=\"20\"> <?php include('config.php'); // połączenie z bazą danych // wybór bazy danych $sql = \"Select from autor Where nazwisko Like '\"%$_POST[\"szukaj\"]%\"'\"; //print \"Usunięto temat $IdTematy\"; //print (\"Usunięto temat\"); ?> </body> </html>
<?php $sql = \"Select * from autor Where nazwisko Like '%{$_POST[\"szukaj\"]}%'\"; ?>
SELECT * FROM tabela1, tabela 2 WHERE tabela1.id = tabela2.id
<html> <head> <meta http-equiv=\"Content-type\" content=\"text/html; charset=iso-8859-2\" /> </head> <body bgcolor=\"#B0CEB5\" leftmargin=\"20\" topmargin=\"20\"> <?php include('config.php'); // połączenie z bazą danych // wybór bazy danych $sql = \"Select from autor Where nazwisko Like '%{$_POST[\"szukaj\"]}%'\"; //'\"%$_POST[\"szukaj\"]%\"'\" <?php { $IdAutora = $rekord[0]; $Nazwisko = $rekord[1]; $Imie = $rekord[2]; $NumerAlbumu = $rekord[3]; $Kierunek = $rekord[4]; $Specjalnosc = $rekord[5]; <table width=\"98%\" border=\"0\"> <tr><td width=\"10%\">IdAutora:</td><td width=\"90%\"><b>$IdAutora</b></td></tr> <tr><td width=\"10%\">Nazwisko:</td><td width=\"90%\"><b>$Nazwisko</b></td></tr> <tr><td width=\"10%\">Imie:</td><td width=\"90%\"><b>$Imie</b> </td></tr> <tr><td width=\"10%\">NumerAlbumu:</td><td width=\"90%\"><b>$NumerAlbumu</b></td></tr> <tr><td width=\"10%\">Kierunek:</td><td width=\"90%\"><b>$Kierunek</b></td></tr> <tr><td width=\"10%\">Specjalnosc:</td><td width=\"90%\"><b>$Specjalnosc</b></td></tr> </table>\"); } //print \"Usunięto temat $IdTematy\"; //print (\"Usunięto temat\"); ?> </body> </html>
<?php include('config.php'); // połączenie z bazą danych // wybór bazy danych $sql = \"Select from autor Where nazwisko Like '%{$_POST[\"szukaj\"]}%'\"; //'\"%$_POST[\"szukaj\"]%\"'\" { $IdAutora = $rekord[0]; $Nazwisko = $rekord[1]; $Imie = $rekord[2]; $NumerAlbumu = $rekord[3]; $Kierunek = $rekord[4]; $Specjalnosc = $rekord[5]; <table width=\"98%\" border=\"0\"> <tr><td width=\"10%\">IdAutora:</td><td width=\"90%\"><b>$IdAutora</b></td></tr> <tr><td width=\"10%\">Nazwisko:</td><td width=\"90%\"><b>$Nazwisko</b></td></tr> <tr><td width=\"10%\">Imie:</td><td width=\"90%\"><b>$Imie</b> </td></tr> <tr><td width=\"10%\">NumerAlbumu:</td><td width=\"90%\"><b>$NumerAlbumu</b></td></tr> <tr><td width=\"10%\">Kierunek:</td><td width=\"90%\"><b>$Kierunek</b></td></tr> <tr><td width=\"10%\">Specjalnosc:</td><td width=\"90%\"><b>$Specjalnosc</b></td></tr> </table>\"); } //print \"Usunięto temat $IdTematy\"; //print (\"Usunięto temat\"); ?>
<html> <head> <meta http-equiv=\"Content-type\" content=\"text/html; charset=iso-8859-2\" /> </head> <body bgcolor=\"#B0CEB5\" leftmargin=\"20\" topmargin=\"20\"> <?php include('config.php'); // połączenie z bazą danych // wybór bazy danych $sql = \"Select from autor Where nazwisko Like '%{$_POST[\"szukaj\"]}%'\"; //'\"%$_POST[\"szukaj\"]%\"'\" { $IdAutora = $rekord[0]; $Nazwisko = $rekord[1]; $Imie = $rekord[2]; $NumerAlbumu = $rekord[3]; $Kierunek = $rekord[4]; $Specjalnosc = $rekord[5]; <table width=\"98%\" border=\"0\"> <tr><td width=\"10%\">IdAutora:</td><td width=\"90%\"><b>$IdAutora</b></td></tr> <tr><td width=\"10%\">Nazwisko:</td><td width=\"90%\"><b>$Nazwisko</b></td></tr> <tr><td width=\"10%\">Imie:</td><td width=\"90%\"><b>$Imie</b> </td></tr> <tr><td width=\"10%\">NumerAlbumu:</td><td width=\"90%\"><b>$NumerAlbumu</b></td></tr> <tr><td width=\"10%\">Kierunek:</td><td width=\"90%\"><b>$Kierunek</b></td></tr> <tr><td width=\"10%\">Specjalnosc:</td><td width=\"90%\"><b>$Specjalnosc</b></td></tr> </table>\"); } //print \"Usunięto temat $IdTematy\"; //print (\"Usunięto temat\"); ?> </body> </html>
<html> <head> <meta http-equiv=\"Content-type\" content=\"text/html; charset=iso-8859-2\" /> </head> <body bgcolor=\"#B0CEB5\" leftmargin=\"20\" topmargin=\"20\"> <? include('config.php'); // połączenie z bazą danych // wybór bazy danych ?> <?php { $IdAutora = $rekord[0]; $Nazwisko = $rekord[1]; $Imie = $rekord[2]; $NumerAlbumu = $rekord[3]; $Kierunek = $rekord[4]; $Specjalnosc = $rekord[5]; <table width=\"98%\" border=\"0\"> <tr><td width=\"10%\">IdAutora:</td><td width=\"90%\"><b>$IdAutora</b></td></tr> <tr><td width=\"10%\">Nazwisko:</td><td width=\"90%\"><b>$Nazwisko</b></td></tr> <tr><td width=\"10%\">Imie:</td><td width=\"90%\"><b>$Imie</b> </td></tr> <tr><td width=\"10%\">NumerAlbumu:</td><td width=\"90%\"><b>$NumerAlbumu</b></td></tr> <tr><td width=\"10%\">Kierunek:</td><td width=\"90%\"><b>$Kierunek</b></td></tr> <tr><td width=\"10%\">Specjalnosc:</td><td width=\"90%\"><b>$Specjalnosc</b></td></tr> </table>\"); } //print \"Usunięto temat $IdTematy\"; //print (\"Usunięto temat\"); ?> </body> </html>
SELECT * FROM tab1, tab2 WHERE tab1.id = tab2.id
<?php ?>