Skip to content

Instantly share code, notes, and snippets.

@dlenettr
Created November 11, 2014 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlenettr/f9f2725495f9c1532212 to your computer and use it in GitHub Desktop.
Save dlenettr/f9f2725495f9c1532212 to your computer and use it in GitHub Desktop.
Örnek SQL kodu ( 464 )
<?php
/*
DLE MySQL Connect Example
Author: Mehmet Hanoğlu ( MaRZoCHi )
*/
define ( 'DATALIFEENGINE', true );
define ( 'ROOT_DIR', dirname ( __FILE__ ) );
define ( 'ENGINE_DIR', ROOT_DIR . '/engine' );
// Tüm DLE ayarlarını okur
require_once ENGINE_DIR . '/data/config.php';
// Veritabanına bağlanmak için gerekli script
require_once ENGINE_DIR . '/classes/mysql.php';
// Veritabanı bilgileri ile bağlantı kurar ( $db )
require_once ENGINE_DIR . '/data/dbconfig.php';
// Veritabanından kategorileri çekerek ekrana basar
$sql = $db->query( "SELECT * FROM " . PREFIX . "_category ORDER by name DESC" );
while ( $dondur = $db->get_row( $sql ) ) {
echo "<option value='".$dondur["id"]."' selected>".$dondur["name"]."</option>";
echo "<br />";
}
// Bağlantıyı keser
$db->close ();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment