스크립트/Php 코드 팁
미국 유명한 개발자가 만든 클래스 입니다.
Font_Charisma
2009. 6. 14. 14:04
# Using the default constructor...
$db = new MySQL('localhost', 'root', null, 'database');
# Or the connect method.
$db = new MySQL();
$db->connect('localhost', 'root', null, 'database');
# If you want to select a different database, you can:
$db->select_db('new_databaseName');
# Querying the database... Just a random SELECT.
$result = $db->query('SELECT * FROM `the_table`');
# Or maybe one with a variable..?
$result = $db->query("SELECT * FROM `the_table` WHERE colName = '". $db->escape($_GET['someVar']). "'");