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 | |
#Ard Mysql DB Tester Ver. 1.0 By Eka | |
#https://gist.github.com/farindra/d56ee7a131fb852b8ad35370c16fafbf | |
$dbname = 'db'; | |
$dbuser = 'user'; | |
$dbpass = 'pass'; | |
$dbhost = 'localhost'; | |
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); |
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 artisan migrate --path=/database/migrations/selected/ |
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
//get data from csv | |
if (($handle = fopen ( 'database\\seeds\\datas\\customer_group.csv', 'r' )) !== FALSE) { | |
while ( ($data = fgetcsv ($handle, 1000, ',' )) !== FALSE ) { | |
$csv_data = new \App\Models\CustomerGroup; | |
// $csv_data->id = $data [0]; | |
$csv_data->decode = $data [0]; | |
$csv_data->name = $data [1]; | |
$csv_data->save (); | |
} | |
fclose ( $handle ); |
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
$q->whereDay('created_at', '=', date('d')); | |
$q->whereMonth('created_at', '=', date('m')); | |
$q->whereYear('created_at', '=', date('Y')); |
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
SELECT MAX(id) FROM customer; | |
SELECT nextval('customer_id_seq'); | |
SELECT setval('customer_id_seq', (SELECT MAX(id) FROM customer)+1); |
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 | |
/* | |
* | |
* Use the examples below to add your own servers. Coded by clone1018 [?] | |
* | |
*/ | |
$title = "Simple Server Status"; // website's title | |
$servers = array( | |
'Google Web Search' => array( |
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 | |
/** | |
* Check to see if a given integer is prime. | |
* | |
* Adapted from this Python implementation http://pthree.org/2007/09/05/prime-numbersin- python/ | |
* This list of the first 10,000 prime numbers is also helpful http://primes.utm.edu/lists/small/10000.txt | |
* | |
* @param int $number the number to check to see if it is prime. | |
* @return boolean true if the number is prime, false if not. |
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 | |
/** | |
* | |
*/ | |
class database | |
{ | |
private $connection; | |
public function __construct($hostname=DB_HOST, $database=DB_NAME, $username=DB_USER, $password=DB_PASS, $port = '3306') { |
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
Devan Kampret |
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 | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Register any application services. |