Bu Blogda Ara

17 Temmuz 2010 Cumartesi

En Popüler Php veritabanı Sınıfı EzSql

ezSQL Veritabanı (ler kullanmak için gülünç) PHP betikleri içinde kolaylaştıran bir widgettır. It is fully documented with many easy to understand examples. Bu tamamen çok kolay örnekleri anlamak için belgelenmiştir. mySQL version available, Oracle coming soon. mySQL sürümü, Oracle yakında.

By : jv Gönderen: jv

ezSQL is a widget that makes it ridiculously easy for you to use database(s) within your PHP scripts. ezSQL Veritabanı (ler kullanmak için gülünç) PHP betikleri içinde kolaylaştıran bir widgettır.

This widget is a php file that you include at the top of your script. Bu widget size komut üst kısmında yer bir php dosyasıdır. Then, instead of using std php database functions listed in the php manual, you use a much smaller (and easier) set of ezSQL functions. Daha sonra, yerine std php veritabanı fonksiyonları php manuel listelenen kullanarak, kullanmak çok (daha küçük ve daha kolay) ezSQL fonksiyonlar dizisi.

ezSQL can dramatically increase development time and in most cases will streamline your code and make things run faster as well as making it very easy to debug and optimise your database queries. ezSQL ölçüde geliştirme zamanı artırabilir ve çoğu durumda kodunuzu aerodinamik ve işler daha hızlı hem çok hata ayıklamak kolay yapım olarak çalıştırın ve veritabanı sorgularını optimize olun.

The debug system draws a neat table showing exactly what your query was and results are. Hata ayıklama sistemi düzgün bir tablo tam olarak ne Sorgunuzla ve sonuçları gösteren çizer.

Please read through these examples to see how easy using databases can be using ezSQL. Bu örnekler üzerinden ne kadar kolay kullanarak veritabanları ezSQL kullanarak görmek için okuyun.

------------------------------------------------------- -------------------------------------------------- -----
Example 1 Örnek 1
------------------------------------------------------- -------------------------------------------------- -----

// Select multiple records from the database.. veritabanı .. dan / / Birden fazla kayıt
$results = $db->get_results("SELECT name, email FROM users"); $ Sonuç = $ db-> get_results ("SELECT ad, email FROM kullanıcı");

foreach ( $results as $user ) foreach ($ kullanıcı olarak sonuçlar)
{ (
// Access data using object syntax / / Access veri sözdizimi nesne kullanarak
echo $user->name; $ User-> isim echo;
echo $user->email; $ User-> email echo;
} )

---------------------------------------------------- -------------------------------------------------- -
Example 2 Örnek 2
---------------------------------------------------- -------------------------------------------------- -

// Get one row from the database.. / / Veritabanı .. dan bir satır alın
$user = $db->get_row("SELECT name,email FROM users WHERE id = 2"); $ User = $ db-> get_row ("SELECT ad, email FROM kullanıcı WHERE = 2" id);

echo $user->name; $ User-> isim echo;
echo $user->email; $ User-> email echo;


---------------------------------------------------- -------------------------------------------------- -
Example 3 Örnek 3
---------------------------------------------------- -------------------------------------------------- -

// Get one variable from the database.. / / Veritabanı .. tek bir değişken alın
$var = $db->get_var("SELECT count(*) FROM users"); $ Var = $ db-> get_var ("SELECT count (*) FROM kullanıcı");

echo $var; $ Var echo;


---------------------------------------------------- -------------------------------------------------- -
Example 4 Örnek 4
---------------------------------------------------- -------------------------------------------------- -

// Insert into the database / / Ekle veritabanına
$db->query("INSERT INTO users (id, name, email) VALUES (NULL,'Justin','jv@foo.com')"); $ Db-> sorgu ("INSERT INTO kullanıcıları (isim, e-posta) VALUES (NULL, 'Justin', 'jv@foo.com')"); id


---------------------------------------------------- -------------------------------------------------- -
Example 5 Örnek 5
---------------------------------------------------- -------------------------------------------------- -

// Update the database / / Güncelleme veritabanı
$db->query("UPDATE users SET name = 'Justin' WHERE id = 2)"); $ Db-> sorgu ("UPDATE kullanıcılar SET name = 'Justin' WHERE id = 2)");


---------------------------------------------------- -------------------------------------------------- -
Example 6 (for debugging) Örnek 6 (hata ayıklama için)
---------------------------------------------------- -------------------------------------------------- -

// Display last query and all associated results / / Ekran son sorgu ve tüm sonuçlar ilişkili
$db->debug(); $ Db-> debug ();


---------------------------------------------------- -------------------------------------------------- -
Example 7 (for debugging) Örnek 7 (hata ayıklama için)
---------------------------------------------------- -------------------------------------------------- -

// Display the structure and contents of query results (or any variable) / / Ekran yapısı ve sorgu sonucu (ya da herhangi bir değişken) içeriği
$results = $db->get_results("SELECT name, email FROM users"); $ Sonuç = $ db-> get_results ("SELECT ad, email FROM kullanıcı");

$db->vardump($results); $ Db-> vardump ($ sonuçları);


---------------------------------------------------- -------------------------------------------------- -
Example 8 Örnek 8
---------------------------------------------------- -------------------------------------------------- -

// Get 'one column' (based on index) from a query.. / / '(Endeksi) bir sorgu .. dan sütun alın
$names = $db->get_col("SELECT name,email FROM users",0) $ Isim = $ db-> get_col ("SELECT ad, email FROM kullanıcı", 0)

foreach ( $names as $name ) foreach ($ isim gibi isimler)
{ (
echo $name; $ Name echo;
} )

// Get another column from the previous (cached) query results.. / / Önceki (zula) sorgu sonuçlarından başka bir sütun .. alın
$emails = $db->get_col(null,1) $ Emails = $ db-> get_col (null, 1)

foreach ( $emails as $email ) foreach ($ e-posta olarak e-postalar)
{ (
echo $email; $ Email echo;
} )


---------------------------------------------------- -------------------------------------------------- -
Example 9 Örnek 9
---------------------------------------------------- -------------------------------------------------- -

// Map out the full schema of any given database.. / / Herhangi bir veritabanı .. tam şeması dışarı Haritası

$db->select("my_database"); $ Db-> select ("my_database");

foreach ( $db->get_col("SHOW TABLES",0) as $table_name ) foreach ($ db-> get_col ("SHOW TABLOLAR", 0) olarak $ tablo_ismi)
{ (

$db->debug(); $ Db-> debug ();
$db->get_results("DESC $table_name"); $ Db-> get_results ("DESC $ tablo_ismi");

} )

$db->debug(); $ Db-> debug ();


işte indime adresi

http://www.codewalkers.com/codefiles/179_ez_sql.zip

Hiç yorum yok:

Yorum Gönder