Created
November 11, 2014 18:26
-
-
Save dlenettr/f9f2725495f9c1532212 to your computer and use it in GitHub Desktop.
Örnek SQL kodu ( 464 )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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