Tema: Re: Padekit su PHP
Autorius: Mindaugas J.
Data: 2009-02-12 16:20:37
O bandei dokumentacijoje paskaityt?

<?php
$db_connection = mysql_connect('192.168.100.200','svecias','minute50') or die('Nepavyko prisijungti DB');
mysql_select_db('gagass', $db_connection) or die('Nepavyko parinkti DB');
$db_query = "SELECT auto_mark_kod FROM auto_markes ORDER BY auto_mark_kod";
$rezultatai = mysql_query($db_connection, $db_query);
while($eilute = mysql_fetch_row($rezultatai)){
 print_r($eilute);
}
?>

http://lt2.php.net/manual/en/ref.mysql.php

-Mindaugas J.

"zigmas" <montag@one.lt> wrote in message news:gn198h$7i0$1@trimpas.omnitel.net...
> 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);
> 
>                ?> 
> 
>