{I+=codeWee;}
[PHP] DB Connection And Select
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);
HTML | PHP | C++ | DirectX11 | Javascript | C# | HTML5 | ASP | SQL | General | CSS | Oculus Rift | Unity3d | Virtools SDK | Tip | NSIS | PowerShell | node.js | Web API | RTSP | All
Copyright© 2016 CodeWee.com All rights reserved.