
PHP & MySQL - belajar php : "Fungsi/Method"
Wednesday, Juny 11, 2009 by Hariadi
PHP & MySQL - Kali Ini akan "belajar php" mengenai Koding "Fungsi/Method". FUngsi, atau method diparadigma objek, adalah blok
kode yg dapat di depinisikan kemudian di pangil (di-invoke) dai bagian lain program . Belajar php mesti pelan-pelan, apalagi
mengenai "Fungsi/Method". Tahap balajr php ini merupakan tahap dasar yang perlu di mengerti dan dio pahami, guna untuk
pengembangan kedepan.
Sebagai pemrogram, kita bisa menganalisa, kapan mesti mengunakan fungsi. contoh nya, untuk kode-kode php yang smaa dan sering
digunakan, nah pastinya ini akan mempermudah anda untuk membuat koding. Tapi mungkin ini sulit yang baru pertama untuk
belajar php.
/* Mendapatkan Jam dari system dengan format 0-23 */
$time = date("G");
if ($time <12) {
$say = 'Good morning ..';
}elseif ($time < 17 ){
$say = 'Good Afternoon ..';
}else
{
$say = 'Good evening ..';
}
echo $say;
Para pembaca blog "belajar php" kode diatas jika diperlukan kembali akan ditulis lagi, dan ditulis lagi. Agar lebih efisien,
maka kode php diatas sebaiknya di pakai "Fungsi/Method" PHP.
function greeting($tNow){
if(!$tNow) return '';
if(!$tNow < 12 ) return 'Good Morning..';
if(!$tNow < 17 ) return 'Good afternoon..';
if(!$tNow >17 ) return 'Good evening..';
}
//memanggil fungsi strlen
echo getLength('Hello');
Rabu, 10 Juni 2009
PHP & MySQL
Diposting oleh this is my blog di 21.23 0 komentar
PHP
PHP: Hypertext Preprocessor) is a computer scripting language, originally designed for producing dynamic web pages. It is
mainly used in server-side scripting, but can be used from a command line interface or in standalone graphical applications.
While PHP was originally created by Rasmus Lerdorf in 1995, the main implementation of PHP is now produced by The PHP Group
and serves as the de facto standard for PHP as there is no formal specification. Released under the PHP License, the Free
Software Foundation considers it to be free software.
PHP is a widely-used general-purpose scripting language that is especially suited for web development and can be embedded
into HTML. It generally runs on a web server, taking PHP code as its input and creating web pages as output. It can be
deployed on most web servers and on almost every operating system and platform free of charge.[5] PHP is installed on more
than 20 million websites and 1 million servers, although the number of websites with PHP installed has declined since August
2005.It is also the most popular Apache module among computers using Apache as a web server.The most recent major release of
PHP was version 5.2.6 on May 1, 2008.
Diposting oleh this is my blog di 21.12 0 komentar
MySQL Embedded Server 5.1
NEW! MySQL Connector/C++
* Free Web Seminar
The New MySQL Connector/C++" by connector developers Article
*
o "Developing Database Applications Using MySQL Connector/C++"
MySQL Embedded Server 5.1
* Whitepaper
o MySQL Embedded Server 5.1
* Free Web Seminar
o MySQL Embedded Server 5.1 for Commercial ISVs/OEMs
ISV / OEM Resources
* On-Demand Webinars
* Customer Case Studies
* White papers
* Industry Verticals and Horizontals
* Customer List
MySQL Embedded Server is a full-featured, zero administration database that over 2000 ISVs, OEMs, and VARs rely on to make their products more competitive, bring them to market faster, and lower their COGs (cost of goods sold). They choose the SQL-compliant MySQL Embedded Server for its:
* Low-cost, 90% less than proprietary databases with features that ensure an ISV / OEM's COGS remain low throughout their application's life cycle;
* High Performance, Reliability and Scalability to meet the requirements of the most demanding applications, such as Telco and Network management, 24x7;
* Flexibility with a small footprint and support for 20+ platforms providing the freedom to ship products on multiple hardware and operating system combinations;
* Ease-of-Use with fast installation, configuration and integration so developers can focus on application development, reducing costs and time to market;
* Zero-administration, eliminating the need for end-user customers to hire a dedicated DBA or spend any cycles on database administration.
NEW MySQL Embedded Server 5.1 adds advanced capabilities to manage large data volumes, and improve performance, availability and manageability. Features include:
* New! Partitioning to improve performance and management of very large database environments
* New! Row-based/Hybrid Replication for improved replication security
* New! Event Scheduler to create and schedule jobs that perform various database tasks
* New! XPath Support
* New! Dynamic General/Slow Query Log
* New! Performance/Load Testing Utility (mysqlslap)
* Improved! Full Text Search (faster, new dev templates)
* Improved! Archive engine (better compression, more features)
* Improved! User session and problem SQL identification
* Improved! MySQL embedded library (libmysqld)
* Additional INFORMATION_SCHEMA objects
* Faster data import operations (parallel file load)
* ACID Transactions to build reliable and secure business critical applications
* Stored Procedures to improve developer productivity
* Triggers to enforce complex business rules at the database level
* Views to ensure sensitive information is not compromised
* Information Schema to provide easy access to metadata
* Pluggable Storage Engine Architecture for maximum flexibility
* Archive Storage Engine for historical and audit data
Diposting oleh this is my blog di 21.08 0 komentar
MySQL Affected Rows

MySQL_affected_rows — Get number of affected rows in previous MySQL operation
Description
int mysql_affected_rows ([ resource $link_identifier ] )
Get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE query associated with link_identifier .
Parameters
link_identifier
The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments. If by chance no connection is found or established, an E_WARNING level error is generated.
Return Values
Returns the number of affected rows on success, and -1 if the last query failed.
If the last query was a DELETE query with no WHERE clause, all of the records will have been deleted from the table but this function will return zero with MySQL versions prior to 4.1.2.
When using UPDATE, MySQL will not update columns where the new value is the same as the old value. This creates the possibility that mysql_affected_rows() may not actually equal the number of rows matched, only the number of rows that were literally affected by the query.
The REPLACE statement first deletes the record with the same primary key and then inserts the new record. This function returns the number of deleted records plus the number of inserted records.
Examples
Example #1 mysql_affected_rows() example
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('mydb');
/* this should return the correct numbers of deleted records */
mysql_query('DELETE FROM mytable WHERE id < 10');
printf("Records deleted: %d\n", mysql_affected_rows());
/* with a where clause that is never true, it should return 0 */
mysql_query('DELETE FROM mytable WHERE 0');
printf("Records deleted: %d\n", mysql_affected_rows());
?>
Diposting oleh this is my blog di 21.02 0 komentar
MySQL Client Encoding

(PHP 4 >= 4.3.0, PHP 5)
mysql_client_encoding — Returns the name of the character set
Description
string mysql_client_encoding ([ resource $link_identifier ] )
Retrieves the character_set variable from MySQL.
Parameters
link_identifier
The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments. If by chance no connection is found or established, an E_WARNING level error is generated.
Return Values
Returns the default character set name for the current connection.
Examples
Example #1 mysql_client_encoding() example
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$charset = mysql_client_encoding($link);
echo "The current character set is: $charset\n";
?>
Diposting oleh this is my blog di 20.47 0 komentar


