This file contains hidden or 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 TestController extends BaseController { | |
/** | |
* Setup the root action of this controller. | |
* | |
* @return void | |
*/ | |
public function getIndex() |
This file contains hidden or 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
{ | |
"name": "laravel/laravel", | |
"description": "The Laravel Framework.", | |
"keywords": ["framework", "laravel"], | |
"require": { | |
"laravel/framework": "4.0.*" , | |
"stevemo/cpanel": "dev-develop" , | |
"zendframework/zend-config": "2.*", | |
"zendframework/zend-http": "2.*" | |
}, |
This file contains hidden or 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 | |
mysql_connect('localhost', 'user', 'password'); | |
mysql_select_db('myDB'); | |
$data = mysql_real_escape_string($_POST['data']); | |
$query = 'SELECT column FROM table WHERE data = \'' . $data . '\''; | |
$result = mysql_query($query); | |
while($row = mysql_fetch_array($result, FETCH_NUM)) | |
{ |
This file contains hidden or 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 | |
// PDO without prepared statement | |
$connStr = 'mysql:host=localhost;dbname=world' ; | |
try | |
{ | |
$conn = new PDO($connStr, 'root', ''); | |
} | |
catch(PDOException $pe) | |
{ |
This file contains hidden or 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 | |
$mysqli = new mysqli("localhost", "my_user", "my_password", "world"); | |
if (mysqli_connect_errno()) | |
{ | |
printf("Connect failed: %s", mysqli_connect_error()); | |
exit(); | |
} | |
$query = "SELECT * FROM users WHERE user_id='$userid'"; |
This file contains hidden or 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 | |
// Create connection | |
$con = mysqli_connect("localhost", "username", "password", "dbname"); | |
/* check connection */ | |
if (mysqli_connect_errno()) { | |
printf("Connect failed: %s\n", mysqli_connect_error()); | |
exit(); | |
} |
This file contains hidden or 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 | |
/* | |
First downlaod the library from Google | |
http://code.google.com/a/apache-extras.org/p/phpmailer/ | |
*/ | |
require_once 'class.phpmailer.php'; | |
$mail = new PHPMailer(); |
This file contains hidden or 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 | |
/* | |
First downlaod the library from Google | |
http://code.google.com/a/apache-extras.org/p/phpmailer/ | |
*/ | |
require_once 'class.phpmailer.php'; | |
$mail = new PHPMailer(true); | |
$to = "[email protected]"; |
This file contains hidden or 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
Route::get('facade' , function() | |
{ | |
return get_class(App::getFacadeRoot()) ; | |
}) ; |
This file contains hidden or 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 | |
Schema::create('users' , function($table) | |
{ | |
$table->increments('id'); Incrementing ID to the table (primary key). | |
$table->string('email'); VARCHAR equivalent column | |
$table->string('name', 100); VARCHAR equivalent with a length | |
$table->integer('votes'); INTEGER equivalent to the table |
OlderNewer