Showing posts with label database. Show all posts
Showing posts with label database. Show all posts

Mar 17, 2011

You just finished building the perfect database for use as a web-app, if only you knew how to write a web-app
What do you do?

Well, writing a web application does not have to be complicated and definitely does not have to take months of programming. With WhizBase it takes just two steps to make your database "airborne".

Step one - create report that will display records from your database
Open your ordinary, plain HTML web page, position your cursor where you want
your records displayed and type the following code (replace values for
WB_BaseName and WB_RcdSet with your own values):

#*
[FormFields]
wb_basename=biblio.mdb
wb_rcdset=(Authors inner join titles on authors.au_id=titles.au_id) inner join
publishers on publishers.pubid=titles.pubid
wb_command=q
*#
#*Now we will add some plain HTML with no WhizBase code*#
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<td>Title</td>
<td>Year published</td>
<td>ISBN</td>
<td>Author</td>
<td>Publisher</td>
</tr>
#*And here we will start adding some really simple WhizBase code*#
<!--WB_BeginDetail-->#*Define the beginning of block that will be repeated for every record*#
<tr>

<td>$wbf[Title]</td>
<td>$wbf[Year published]</td>
<td>$wbf[ISBN]</td>
#*Since we have field "Name" in two joined tables we must add table name in $WBF function together with the name of the field*#
<td>$wbf[Authors.name]</td>
<td>$wbf[Publishers.name]</td>
</tr>
<!--WB_EndDetail-->#*Define the end of repeating block *#
</table>
$wbnavigator[]

Save it as books.wbsp and the report is finished.

Step two - create search form

The search form for this example will be ordinary page with HTML form as follows:

<form action="books.wbsp" method="POST">
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<td>Title</td>
<td><input type="text" name="WBF_Title" value=""></td>
</tr>
<tr>
<td>Year Published</td>
<td><input type="text" name="WBF_Year Published" value=""></td>
</tr>
<tr>
<td>ISBN</td>
<td><input type="text" name="WBF_ISBN" value=""></td>
</tr>
<tr>
<td>Search conditions</td>
<td ><select size='1' name='wb_andor'>
<option value='And'>all conditions</option>
<option value='Or'>any condition</option>
</select></td>
</tr>
</table>
<input type='submit' value='Search'>
<input type='reset' value='Reset'>
</form>

As you can see, there's nothing special with this form except that we named input text fields same as database fields with prefix (WBF_). When user submits the form data to books.wbsp (report we created earlier) WhizBase opens database biblio.mdb, create recordset based upon WB_RcdSet value combined with WHERE clause generated from form fields WBF_Title, WBF_Year published, WBF_ISBN. Upon creating recordset, WhizBase "reads" the report, search for detail section (everything between <!--WB_BeginDetail--> and <!--WB_EndDetail-->), finds the keywords (in this case $wbf[] functions) processes them and send to the browser, and repeats it for 20 records. After that, it process $WBNavigator[] function and generate links to other report pages (paginate the report).
Of course, you can format HTML form and WhizBase report anyway you want using ordinary HTML or CSS.

More info: http://www.whizbase.com/

Mar 7, 2011

You just created your client’s website, now he wants a database.
What do you do?

Well, if you are a hardcore programmer/web developer, there’s a plenty of choices. You can use ASP, PHP, ASP.NET, Ruby on Rails, Python, Perl, Java, etc. However, if you are just a humble web designer primary focused on making beautiful, eye-catching, state-of-the-art graphic layouts, and with development knowledge that’s just about enough to make a decent web page that shows well on all browsers and have a good SEO, then the choice is not that big. Of course, you still can select between few options:

Option A - Tell your client you can’t do it.
Never, never select this option. If you have to do it, don’t do it!

Option B - Hire a programmer/web developer to do it for you
This appears to be a good solution, but there are few serious issues with it – you will take your client’s request and pass it to the developer, then it will turn out that you did not get it right and you need to modify the request, then the developer will ask for more money because of extra work, then it goes in circle until the project is finally finished, and you have spent almost a half of project budget on outsourcing. But that’s not the end – if something goes wrong – who do you think your client is going to call – your outsourcing developer? Don’t think so – he will call you and he will demand immediate answers and reactions. I do not need to explain any further – you got the picture.

Option C - Do it yourself
Always the best solution, that allows you to control all parts of the web site you created, but you are not a developer, so how the heck I can suggest it. Well, this is how:
A) Collect your client’s data in an Excel spreadsheet, or Access database, or simple comma-delimited text file (CSV)
B) Add some simple, yet powerful, magic with WhizBase
C) Upload files to the web server and your database is ready to go.