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
function changeUser($user) | |
{ | |
$this->database_user = $user; | |
} | |
function changePass($pass) | |
{ | |
$this->database_pass = $pass; | |
} |
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
function connect() | |
{ | |
$this->database_link = mysql_connect($this->database_host, $this->database_user, $this->database_pass) or die("\ | |
Could not make connection to MySQL"); | |
mysql_select_db($this->database_name) or die ("Could not open database: ". $this->database_name); | |
} |
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
function disconnect() | |
{ | |
if(isset($this->database_link)) mysql_close($this->database_link); | |
else mysql_close(); | |
} |
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
function iquery($qry) | |
{ | |
if(!isset($this->database_link)) $this->connect(); | |
$temp = mysql_query($qry, $this->database_link) or die("Error: ". mysql_error()); | |
} |
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
function query($qry) | |
{ | |
if(!isset($this->database_link)) $this->connect(); | |
$result = mysql_query($qry, $this->database_link) or die("Error: ". mysql_error()); | |
$returnArray = array(); | |
$i=0; | |
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) | |
if ($row) | |
$returnArray[$i++]=$row; | |
mysql_free_result($result); |
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 | |
// Our Database Class | |
include("lib/database.php"); | |
$db = new Database(); // Instantiate our Database Class | |
$resArr = $db->query("SELECT * FROM users WHERE userid != 1"); // Query! | |
// $resArr is now an associative array containing the entire result set | |
// of the SQL query. We can now use and abuse this data as necessay. | |
// In this hypothetical situation, I am returing all of the users in |
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
$ chmod +x video2ipod |
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
$ video2ipod Chemical_Brothers_-_Believe.wmv Chemical_Brothers_-_Believe.mp4 |
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
$ ffmpeg -i greeting_essare_and_avere.mp3 -acodec aac greetings_essare_and_avare.m4a |
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
$ mv greetings_essare_and_avare.m4a greetings_essare_and_avare.m4b |