Danh mục: Back-end

Hàm get id của data vừa insert vào sql

Dùng hàm mysql_insert_id() để get id vừa được tạo.   <?php $con = mysql_connect(“localhost”, “peter”, “abc123”); if (!$con) { die(‘Could not connect: ‘ . mysql_error()); } $db_selected = mysql_select_db(“test_db”,$con); $sql =….

Cách sử dụng Data youtube api v3

Các hàm dùng để login youtube qua api $client = new Google_Client(); $client->setClientId($client_id); $client->setClientSecret($client_secret); $client->setRedirectUri($redirect_uri); $client->setScopes(array( “https://www.googleapis.com/auth/plus.login”, “https://www.googleapis.com/auth/userinfo.email”, “https://www.googleapis.com/auth/userinfo.profile”, “https://www.googleapis.com/auth/plus.me”, “https://www.googleapis.com/auth/youtube.upload”, “https://www.googleapis.com/auth/youtube”, “https://www.googleapis.com/auth/youtube.force-ssl” )); $plus = new Google_Service_Plus($client); $youtube =….