Fiji Web Design
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Share your PHP Pages Code (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Share your PHP Pages Code
#27
admin (Admin)
Admin
Posts: 475
graph
User Online Now Click here to see the profile of this user
Share your PHP Pages Code 3 Years, 7 Months ago Karma: 10  
If you have written some custom code for the PHP Pages Component and would like to share it, post it here:
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#85
admin (Admin)
Admin
Posts: 475
graph
User Online Now Click here to see the profile of this user
Re:Share your PHP Pages Code 3 Years, 6 Months ago Karma: 10  
Here is how to connect to a database other then the Joomla database using the Joomla 1.5 API.

$options = array();
$options['driver']   = 'mysql'; // or mysqli
$options['host']     = 'localhost';
$options['user']     = 'j10';
$options['password'] = 'j10';
$options['database'] = 'j10';
$otherdb = JDatabase::getInstance($options);

$otherdb->setQuery('SELECT * FROM jos_users');
$rows = $otherdb->loadObjectList();

print_r($rows);
The $option values are dependent on your database settings.
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/07/26 05:15 By admin.
  The administrator has disabled public write access.
#908
Kaleo Akamu (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Re:Share your PHP Pages Code 2 Years, 8 Months ago Karma: 0  
Something I recently wrote...

PHP Code:
function alphanumeric_underscores($string) {
// Converts a string into an underscores-instead-of-spaces, all-lower-case, alphanumeric string.
// "This function isn't too complex" becomes "this_function_isnt_too_complex".
$string = strtolower($string);
$string = ereg_replace("[^A-Za-z0-9 ]", "", $string);
$string = str_replace(" ", "_", $string);
return $string;
}

--- url snipped ---
 
Report to moderator   Logged Logged  
 
Last Edit: 2009/05/18 13:48 By admin. Reason: Please do not post unnecessary links.
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Joomla Downloads

DownloadsDownload our free Joomla! Components, Modules and Plugins.