0
I Use This!
Activity Not Available

Project Summary

Pre-requisites: php 5, mysql

This is a php based program for generating code, specificlly the complete class for handling tables. No matter the database engine (future), it creates the class for UPDATING, DELETING, or INSERTING registries, making easier the handling of the data. The code can be generated form your local mysql databases, or from the CREATE statement.

Future featuresMake everything MySQL independant. Option to download the generated file!! (force download the .php generated, WARNING! with secure code, we are downloading a php file) Solve bugs. Known bugsConsider tables with more than one key. Error when the create statement doesn't specify the database name. Problem when primary key is not numeric. Let the user choose the SQL server of the output. Example code generated<?php
class site_places{

private $a_FIELDS = Array();
function __construct(){
$this->a_FIELDS['id'] = null;
$this->a_FIELDS['id_state'] = null;
$this->a_FIELDS['name'] = null;
$this->a_FIELDS['latcoord'] = null;
$this->a_FIELDS['loncoord'] = null;
$this->a_FIELDS['zoom'] = null;
$this->a_FIELDS['published'] = null;
}

public function load($fVal){
$f_result = false;
$sql = 'SELECT * FROM site_places WHERE id='.$fVal;
$r = mysql_query($sql);
if( $r !== false ){
if ($a_r = mysql_fetch_row($r)){
$this->a_FIELDS['id'] = $a_r[0];
$this->a_FIELDS['id_state'] = $a_r[1];
$this->a_FIELDS['name'] = $a_r[2];
$this->a_FIELDS['latcoord'] = $a_r[3];
$this->a_FIELDS['loncoord'] = $a_r[4];
$this->a_FIELDS['zoom'] = $a_r[5];
$this->a_FIELDS['published'] = $a_r[6];
$f_result = true;
}
@mysql_free_result($r); unset($a_r);
}
return $f_result;
}
public function update(){
$sql='UPDATE site_places SET
id='.$this->a_FIELDS['id'].',
id_state='.$this->a_FIELDS['id_state'].',
name="'.$this->a_FIELDS['name'].'",
latcoord="'.$this->a_FIELDS['latcoord'].'",
loncoord="'.$this->a_FIELDS['loncoord'].'",
zoom='.$this->a_FIELDS['zoom'].',
published='.$this->a_FIELDS['published'].'
WHERE id='.$this->a_FIELDS['id'];
return @mysql_query($sql);
}
public function add(){
$sql='INSERT INTO site_places SET
id_state='.$this->a_FIELDS['id_state'].',
name="'.$this->a_FIELDS['name'].'",
latcoord="'.$this->a_FIELDS['latcoord'].'",
loncoord="'.$this->a_FIELDS['loncoord'].'",
zoom='.$this->a_FIELDS['zoom'].',
published='.$this->a_FIELDS['published'].'
';
return @mysql_query($sql);
}
public function set_field($fKey, $fValue){
$this->a_FIELDS[$fKey]=$fValue;
$f_result = true;
return $f_result;
}
public function get_field($fKey){
$f_result = false;
if (isset($this->a_FIELDS[$fKey])){
$f_result = $this->a_FIELDS[$fKey];
}
return $f_result;
}
public function delete(){
$sql = 'DELETE FROM site_places WHERE id='.$this->a_FIELDS['id'];
return $r=@mysql_query($sql);
}
}
?>

Tags

class classes classgenerator classmaker codegenerator

In a Nutshell, dbclassmaker...

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

GNU General Public License v3.0 or later
Permitted

Place Warranty

Use Patent Claims

Commercial Use

Modify

Distribute

Forbidden

Sub-License

Hold Liable

Required

Distribute Original

Disclose Source

Include Copyright

State Changes

Include License

Include Install Instructions

These details are provided for information only. No information here is legal advice and should not be used as such.

All Licenses

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    you can embed statistics from Open Hub on your site
  • ...
    in 2016, 47% of companies did not have formal process in place to track OS code
  • ...
    check out hot projects on the Open Hub

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

Community Rating

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!
Sample ohloh analysis