You can generate PHP code for accessing database with Visual Paradigm for UML. In this tutorial, we will generate PHP Doctrine, and create a sample PHP file for creating a record in database. Make sure you have PHP, MySQL and Apache webserver ready before you start this tutorial.
| February 18, 2010 | |
User Rating:
/ 4
|
|
| Views: 6,026 | |
|
PDF
Link
Link: |
Add comments |
| Edition: Standard or above (Edition comparison) | |









<?php
require_once 'bootstrap.php';
$conn = Doctrine_Manager::connection(DSN);
$f = new farm();
$f->name = 'My farm';
$f->name = 'Street 1, district 1';
$f->save();
$q = Doctrine_Query::create()->from('Farm');
$as = $q->fetchArray();
print_r($as);
?>
|

Click on one of the stars below to rate this article from 1 (lowest) to 5 (highest).
Comments (8)
written by michele on July 20, 2011
Hi, at the 9 step if I go on language select, I have only Java but no Php....Why? How can I do?
written by Jick Yeung on July 20, 2011
Hi michele,
You are probably running the Java edition of DB Visual ARCHITECT. Please run "VP Suite Product Edition Manager.exe" in the bin folder of VP Suite installation directory and change the product edition to either Professional or PHP Edition. They both support PHP.
Best regards,
Jick Yeung
written by michele on July 20, 2011
I have already selected Professional edition, and in the select there is anyithing like php-edition...
written by Jick Yeung on July 20, 2011
Hi michele,
I am so sorry about this. I will check with our developers and get back to you as soon as possible.
Best regards,
Jick Yeung
written by Jick Yeung on July 20, 2011
Hi michele,
Please do this first:
1. Select "Tools > Object Relational Mapping > Database Configuration"
2. Select PHP for language selection.
I will also ask our team to allow direct language selection in the generation window. Sorry for any inconveniences it might have caused.
Best regards,
Jick Yeung
written by michele on July 20, 2011
I have not solved. When I go on
1. Select "Tools > Object Relational Mapping > Database Configuration"
On the Selection language I have only:
- java
- enterprise object framework
There is not Php.....What can be?
2. Select PHP for language selection.
written by michele on July 20, 2011
the solution is that php is supported for the enteriprise version and not for the professional!
written by Jick Yeung on July 21, 2011
Hi michele,
You are running VP-UML, not DB-VA. This tutorial was written for DB-VA. For DB-VA, there is no Enterprise Edition. The highest edition is Professional Edition. It supports PHP, .NET, Java.
If you are evaluating, please run the VP Suite.exe in the bin folder and install DB Visual ARCHITECT.
Best regards,
Jick Yeung