{I+=codeWee;} |
define("DB_IP", "localhost"); define("DB_USER", "id"); define("DB_PWD", "pw"); define("DB_NAME", "db"); $TABLE_NAME = "codewee"; $conn = mysql_connect(DB_IP, DB_USER, DB_PWD); if($conn == NULL) { die("DB_CONN_FAIL"); } mysql_select_db(DB_NAME, $conn); $sql = "SELECT * FROM $TABLE_NAME where idx=$idx"; $res = mysql_query($sql, $conn); $count = mysql_num_rows($res); if($count > 0) { $row = mysql_fetch_array($res); // Do Something... } mysql_close($conn);