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
mysql -u root -p | |
use mysql; | |
update user set password=PASSWORD('your_new_password') where User='root'; | |
flush privileges; | |
quit |
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 | |
$options = array( | |
'active' => 'tab1' | |
); | |
echo JHtml::_('bootstrap.startTabSet', 'tab_group_name',$options); | |
echo JHtml::_('bootstrap.addTab', 'tab_group_name', 'tab1', JText::_('Tab 1 Header')); | |
tab 1 content goes here | |
echo JHtml::_('bootstrap.endTab'); | |
echo JHtml::_('bootstrap.addTab', 'tab_group_name', 'tab2', JText::_('Tab 2 Header')); |
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 | |
JHTML::_('behavior.modal'); | |
//example 1 | |
<a href="http://www.example.com/images/myimage.jpg" class="modal">Click here to see my image</a> | |
//example 2 | |
<div id="loadDiv"> | |
A div element containing some text that you want to display. | |
</div> |
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 | |
$position = 'wrapper'; | |
$modules =& JModuleHelper::getModules('testpos'); | |
foreach ($modules as $module) { | |
echo JModuleHelper::renderModule($module); | |
} | |
?> |
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
create sequence player_id_seq; | |
alter table player alter playerid set default nextval('player_id_seq'); | |
Select setval('player_id_seq', 2000051 );--set to the highest current value of playerID |
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 | |
function redirect($url) | |
{ | |
if (!headers_sent()) | |
{ | |
header('Location: '.$url); | |
exit; | |
} | |
else | |
{ |
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 | |
//get difference between two dates in days | |
//$now = time(); // or your date as well | |
$now = strtotime("2016-07-28"); | |
$your_date = strtotime("2016-07-26"); | |
$datediff = $now - $your_date; | |
echo floor($datediff/(60*60*24)); | |
//check from date is after than to date |
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
//import .sql file | |
1) select the schema. | |
2) Plugins->PSQL console | |
3) Type \i /path/to/yourfile.sql | |
i.e \i 'C:/Users/Work/Desktop/School Work/load_database.sql' <= Note the single quote |
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 | |
$array_1 = array(); | |
array_push($array_1,10,15,2,3,4,5,18,40); | |
$array_2 = array_unique( array_diff_assoc( $array_1, array_unique( $array_1 ) ) ); | |
print_r($array_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 | |
//hierarchical | |
//hook into the init action and call create_book_taxonomies when it fires | |
add_action( 'init', 'create_topics_hierarchical_taxonomy', 0 ); | |
//create a custom taxonomy name it topics for your posts | |
function create_topics_hierarchical_taxonomy() { |