MYSQL_CONNECT("d63956.mysql.zonevs.eu","d63956sa137465","Jaggy123") OR DIE("serverit ei saakatte"); MYSQL_SELECT_DB("d63956sd152142") OR DIE("baasi ei saa katte"); $kuupaev = date("d-m-Y"); $mitu='0';?>
<<< Esilehele
if ($tyyp==varuosad){ ?>VARUOSAD $query = MYSQL_QUERY("SELECT * FROM autod"); $mitu = MYSQL_NUMROWS($query); Print"Momendil andmebaasis $mitu erinevat autot"; ?> " name="otsi"> $agrupidq = MYSQL_QUERY("SELECT * FROM firma ORDER BY firma ASC ");FOR ($n = 0; $n < MYSQL_NUMROWS($agrupidq); $n++) {$qfirma = MYSQL_RESULT($agrupidq, $n, "firma");PRINT"$qfirma\n";} ?> IF ($otsisona): $mvq = MYSQL_QUERY("SELECT * FROM autod where tyyp like '%$otsisona%' ORDER BY id desc limit 0, 25");$mitukirjet = MYSQL_NUMROWS($mvq);Print" Otsitav mudel $otsisona, leitud $mitukirjet AUTO MUDEL AASTA MOOTOR KIRJELDUS "; ?> FOR ($i = 0; $i < MYSQL_NUMROWS($mvq); $i++) { $ID = MYSQL_RESULT($mvq, $i, "id"); $mudel = MYSQL_RESULT($mvq, $i, "mudel"); //$fail = MYSQL_RESULT($mvq, $i, "fail"); $mootor = MYSQL_RESULT($mvq, $i, "mootor"); $muu = MYSQL_RESULT($mvq, $i, "muu"); $aasta = MYSQL_RESULT($mvq, $i, "aasta"); //$otsisona = MYSQL_RESULT($mvq, $i, "tyyp"); ?> print" $mudel";?> print" $aasta";?> print" $mootor";?> print" $muu";?> }?> endif;//-------------------------------?> IF ($naita): $mvq = MYSQL_QUERY("SELECT * FROM autod order by tyyp asc limit $mitu, 20"); Print" Otsitav mudel K�IK mudelid AUTO MUDEL AASTA MOOTOR KIRJELDUS "; FOR ($i = 0; $i < MYSQL_NUMROWS($mvq); $i++) { $ID = MYSQL_RESULT($mvq, $i, "id"); $mudel = MYSQL_RESULT($mvq, $i, "mudel"); //$fail = MYSQL_RESULT($mvq, $i, "fail"); $mootor = MYSQL_RESULT($mvq, $i, "mootor"); $muu = MYSQL_RESULT($mvq, $i, "muu"); $aasta = MYSQL_RESULT($mvq, $i, "aasta"); //$otsisona = MYSQL_RESULT($mvq, $i, "tyyp"); ?> print" $mudel";?> print" $aasta";?> print" $mootor";?> print" $muu";?> } ?> $mitu=$mitu1+20; print" J�rgmised 20--->" ; endif; ?> //------------------------------ } else { $uudisedq = MYSQL_QUERY("SELECT * , FROM_UNIXTIME(UNIX_TIMESTAMP(kuupaev), '%d/%m/%Y') AS skuupaev FROM sisu where tyyp='$tyyp' ORDER BY ID desc limit 1"); $pikk=40000; // $pilt='$fail'; $loe=""; FOR ($i = 0; $i < MYSQL_NUMROWS($uudisedq); $i++) { $uID = MYSQL_RESULT($uudisedq, $i, "ID"); $pealkiri = MYSQL_RESULT($uudisedq, $i, "pealkiri"); $sisu_short = SUBSTR(STRIPSLASHES(MYSQL_RESULT($uudisedq, $i, "sisu")), 0, $pikk); $sisu_short = EREG_REPLACE("\n", "\n",$sisu_short); $kuupaev = MYSQL_RESULT($uudisedq, $i, "kuupaev"); //$fail = MYSQL_RESULT($uudisedq, $i, "fail"); $sisu = EREG_REPLACE("\n", "\n", STRIPSLASHES(MYSQL_RESULT($uudisedq, $i, "sisu"))); $pikk=200; PRINT"$pealkiri $sisu_short "; ?> } } ?>