note 66751 deleted from language.oop by bjori

From: Date: Sun, 28 May 2006 11:02:51 +0000
Subject: note 66751 deleted from language.oop by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-112439@lists.php.net to get a copy of this message
Note Submitter: phenixcm at hotmail dot com Reason: useless ---- ##PG2## ####################################### Here is how to execute those classes, and to display results : [...] $helps=new Helps(); $helps->constraint(" WHERE help_pid='".$_GET["pid"]."' LIMIT ".$beg.",10"); $helps->read(); $hs=new Helps(); $hs->constraint(" WHERE help_pid='".$_GET["pid"]."'"); $hs->read(); $total=$hs->size(); if($helps->size()>0) { if(($beg-10)<0) $debmin=-1; else $debmin=$beg-10; foreach($helps->hlp as $h) { echo"<b>".$h->question."</b><blockquote>".$h->answer ."</blockquote>".BR; $beg++; } if($beg>=$total) $debmax=-1; else $debmax=$beg; } else { echo"<i>.../i>"; $debmin=$debmax=-1; } [...] ## ($debmin/$debmax/$beg are used only to manage 'previous/next' page; ## BR is an 'housemande' equal to "<br /><br />") ####################################### AND here is how to used classes to manage the DB : [...] if($_GET["act"]=="add") { $q=new Help("",$_POST["aid"],writ($_POST["question"]), writ($_POST["answer"])); $q->add(); } elseif($_GET["act"]=="up") { $q=new Help($_POST["id"],$_POST["aid"], writ($_POST["question"]),writ($_POST["answer"])); $q->update(); } elseif($_GET["act"]=="del") { $q=new HelpId($_POST["id"]); $q->del(); } [...] ## (writ() is an "homemade" function) Hope u will like this way to script php4 classes. It looks very powerfull to me ... but still looking for optimisation (reducing time processing, size (octets) of files transmitted, better, quicker and more secured way to access data) If any comment, question or information to exchange, dont hesitate to contact me on my email address phenixcm at hotmail dot com ...

« previous php.notes (#112439) next »