Wednesday 12 December 2012

Re: [dcphp-dev] Digest for washington-dcphp-group@googlegroups.com - 1 Message in 1 Topic

This should help you get started:
http://www.sitepoint.com/books/phpmysql5/

On Wed, Dec 12, 2012 at 6:44 AM,
<washington-dcphp-group@googlegroups.com> wrote:
> Today's Topic Summary
>
> Group: http://groups.google.com/group/washington-dcphp-group/topics
>
> Please Help me to complete my PDO Crud Class [1 Update]
>
> Please Help me to complete my PDO Crud Class
>
> Pavan PHP <pavan.php@gmail.com> Dec 11 06:44PM -0800
>
> I am a beginner to intermediate php programmer using mysql_connect and
> mysql_* functions for curd operations.
>
> As world have changed and I also need to change to adapt the new way,
> I am trying to implement CRUD using PDO the very first time.
>
> I have created following class:
>
> class PdoCrud {
> var $db;
> var $db_driver = 'mysql'; // mysql or other database driver
> var $db_host = 'localhost';
> var $db_name = 'website';
> var $db_uname = 'root';
> var $db_upass = '';
>
> var $db_dns = $db_driver . ':host='. $db_host.';dbname='.$db_name;
>
> function connectDB() {
> $this->db = new PDO($db_dns, $db_uname, $db_pass);
> }
> function disconnectDB() {
> $this->db = null;
> }
>
> // returns false and logError() in case of error, else returns id of
> inserted record
> function insertRecord() { }
>
> // returns false and logError() in case of error, else returns true
> function insertRecords() { }
>
> // returns false and logError() in case of error, else returns # of
> rows updated.
> function updateRecord() { }
>
> // returns false and logError() in case of error, else returns no. of
> records found
> function findRecord() { }
>
> // returns false and logError() in case of error, if delete one or
> multiple records based on criteria
> function deleteRecord() { }
>
> function logError($errorinfo) { /* here my code to log error */ }
> }
>
> I request you to please help me complete these following functions
> insertRecord(), insertRecords(), updateRecord(), findRecord() and
> deleteRecord().
>
>
>
> You received this message because you are subscribed to the Google Group
> washington-dcphp-group.
> You can post via email.
> To unsubscribe from this group, send an empty message.
> For more options, visit this group.
>
> --
> You received this message because you are subscribed to the Google
> Group: "Washington, DC PHP Developers Group" - http://www.dcphp.net
> To post, send email to washington-dcphp-group@googlegroups.com
> To unsubscribe, send email to
> washington-dcphp-group+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/washington-dcphp-group?hl=en
>
>

--
You received this message because you are subscribed to the Google
Group: "Washington, DC PHP Developers Group" - http://www.dcphp.net
To post, send email to washington-dcphp-group@googlegroups.com
To unsubscribe, send email to washington-dcphp-group+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/washington-dcphp-group?hl=en

0 comments:

Post a Comment