Skip to content

Instantly share code, notes, and snippets.

ubuntu@master:~/crons$ php reportemailcron.php
September 8, 2015, 4:27 pm
Checking ah_turnkey....
Checking alphaflightservices_brisbane0....
Checking angadc_angadl0....
Checking angelstadium_angelstadium0....
@chopf
chopf / gist:7d9d7c7c4673624a0205
Last active April 24, 2016 02:20
mysql to pdo conversions
COMMANDS
MySQL PDO Notes
$result = mysql_query($queryStr) $pdoStatement = $pdo->query($queryStr)
mysql_fetch_array($result,$type = MYSQL_BOTH) $pdoStatement->fetch($type = PDO::FETCH_BOTH)
mysql_error() NO EXACT EQUIVALENT $pdo->errorInfo() returns an array, [0=>ErrorCode,1=>Driver specific error code,2=>driver specific error message]
mysql_insert_id() $pdo->lastInsertId()
mysql_free_cursor() NO EXACT EQUIVALENT $pdoStatement->closeCursor() is similar but on statement not PDO
mysql_select_db($dbName) NO EQUIVALENT PDO does not allow databases to be changed, you must create a new PDO connection, or if the info is the same you an use dot notation to query a different database
mysql_real_escape_string($stringToEscape) $pdo->quote($stringToEscape) PDO::quote will add the quotes for you!!!!
deployment steps
backed up SoniCloud
removed all laravel tables from SoniCloud
sudo php ~/sonicucode/laravel.php --update --branch='master'
- failed due to lack of SoniCloud.sonicu_companies
imported sql from test server.
sudo php ~/sonicucode/laravel.php --update --branch='master'
removed sonicu_companies table
php artisan migrate
php artisan db:seed