I’ve done some sites using Freeway 5 Pro which I could never have done if I had to generate HTML code myself (thanks Softpress). I’m now trying to help my daughter develop a dynamic website for her new vintage shoe store.
I’ve done some FileMaker Pro development in the past, so I understand the principles of relational databases. The ISP I’m using supports MySQL under Linux. I now understand the concept of having to build a server side database to enter the inventory (including multiple product specific photographs). While I understand the concepts, I don’t want to climb the learning curve needed to become a proficient PHP code poet.
My question, is there a Freewayesq program for the Mac that will generate PHP code for MySQL? I’ve found some Windows only programs along this line — but don’t want to go there.
Alternatively, does anyone know of someone that does solid PHP / MySQL development?
My question, is there a Freewayesq program for the Mac that will generate PHP code for MySQL?
Not that i’ve ever heard of exactly. There are some with very specific purposes, such as FormsToGo, that generate the php code necessary to create a form.
This looks like it will be harder (rather than easier) than hand-coding, simply because it will force you to learn a templating language (Smarty) rather than give you a leg up to coding PHP. I haven’t tried this particular package, but I have dealt with Smarty before, and didn’t much enjoy the experience.
If you need to be able to access a database and get things in and out of it from within Freeway, you might want to take a close look at Paul Dunning’s PHP Actions[1]. Or you might want to look at a database abstraction package (I’m very fond of MyActiveRecord[2]). Using MAR can be as simple as including a file and writing a small extension to describe your data. It can be literally as simple as this:
<?php
include('MyActiveRecord.0.4.php');
class contacts extends MyActiveRecord{
function save(){
if(empty($this->name)) $this->add_error('name','Please enter your name')'
return parent::save();
}
}
if(isset($_POST['name']){
$contact = MyActiveRecord::Create('contacts');
$contact->populate($_POST);
$contact->save();
if($contact->get_errrors()){
print_r($contact->get_errors());
}else{
header('Location: nextpage.php?message=Yay!');
}
}
foreach(MyActiveRecord::FindAll('contacts') as $f){
$out .= $contact->name . '<br />';
}
?>
<!-- later on in your page -->
<p>Names:<br/>
<?= $out ?>
</p>
And a form for adding new names...
That’s literally a complete example, in maybe 18 lines of code.
MAMP just gets you the server to run things on locally, while you are testing out your solution. The OP was interested in generating the “glue code” that translates a Web interface into database records.