Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function one(){
- $query = "SELECT * FROM table WHERE id='$id'....";
- $result = mysql_query($query);
- while($row=mysql_num_rows($result))
- {echo "$row[data]";} }
- function(something here, and here){then the result here?}
- function simplify() {
- $query = "$crud * FROM $table WHERE id= '$id' ";
- $result = mysql_query($query);
- while($row=mysql_fetch_array($result)) {echo "$row[data]";}
- }
- echo simlify(and here would be table name, id, select, create, update...) {
- and here the result}
- $db = new DBAdapter(array('host' => 'localhost'));
- $results = $db->Select('mytable')->Where('id > 2')->Execute();
- class DBAdapter extends PDO
- {
- public function __construct( array $params)
- {
- // construct the connection
- }
- public function Select ($table)
- {
- // do stuff for a table select
- return $this;
- }
- public function Count ($table)
- {
- // do stuff for a table count
- return $this;
- }
- public function Where ($condition)
- {
- // do stuff for a where
- return $this;
- }
- public function Execute ()
- {
- // execute stuff
- return $result;
- }
- }
Add Comment
Please, Sign In to add comment