Tema: Padekit su PHP
Autorius: zigmas
Data: 2009-02-12 15:46:57
Ka blogai darau? Neisveda man auto markiu.

<?php
                //Per ODBC prisijungiam prie duomenu bazes
               // $db_connection = odbc_connect ('AUTOMIS', '', '');
                $db_connection = mysql_connect('192.168.100.200', 'svecias', 
'minute50');
                mysql_select_db('gagass', $db_connection) or die('Nepavyko 
parinkti DB');


                // pagal koda isrenkam duomenis is db
                $db_query = "SELECT auto_mark_kod ";
    $db_query.= "FROM auto_markes ORDER BY auto_mark_kod ";
    $eilute = mysql_query($db_connection, $db_query);

                //Paleidziame uzklausa vykdymui ir formuojame rezultatu 
masyva eilute
                //$eilute = odbc_exec ($db_connection, $db_query);
                //Paleidziame cikla duomenu isvedimui
                 while (mysql_fetch_row ($eilute))
                {
                $auto_mar_kod = mysql_result ($eilute,1);
                print("<option>$auto_mar_kod</option>\n");
                }

                mysql_free_result($eilute);
                mysql_close($db_connection);

                ?>