Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Temptable in special data form

Post Reply
forgot
Posts: 42
Joined: Thu Aug 09, 2012 8:52 pm

Temptable in special data form

Unread post by forgot »

Hello.

Is it possible in nuBuilder in php procedure create temporary table in then open form with that table in as data for subform?

So step by step
1. Call php procedure
2. In php create temp table (like __my213423424__) or put new rows in special table (mytemptable)
3. Open data form with subform
4. That subform shows me mytemptable’s row by row.

Can I do that in nyBuilder?

--
Maxim
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Temptable in special data form

Unread post by admin »

Maxim,

You could try something like this..

Steps..

1.On Before Load

Code: Select all

nuRunQuery("CREATE TABLE #browseTable# SELECT * FROM items");
2. In SQL of Subform Object

Code: Select all

nuRunQuery("SELECT * FROM #browseTable#");
Steven
forgot
Posts: 42
Joined: Thu Aug 09, 2012 8:52 pm

Re: Temptable in special data form

Unread post by forgot »

Very good way for me use #browseTable#. Thank you. Now I don't obligate delete temptable.

Some problem
If I put this code

Code: Select all

nuRunQuery("CREATE TABLE #browseTable# SELECT * FROM orders");
in 'Before open' tab nuBuilder get error ("can't execute SQL code"). I check in wiki http://wiki.nubuilder.com/tiki-index.ph ... structure= this hash variables don't belong to Before Open event.

If I put this code in Before Browse it don't execute when I directly go to form with datafields.



And one more question in this topic.
Can I run Form from JavaScript and give some variables to this Form? Like java function runIt(pCode, param1, param2, param3…)


--
Maxim
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Temptable in special data form

Unread post by admin »

Maxim,

You're right about browseTable but try recordID eg.

Code: Select all

nuRunQuery("CREATE TABLE `temp#recordID#` SELECT * FROM orders");
And if you create another table with a record holding every temp#recordID# created. You could loop through and delete them at some point.

Question 2.

The only parameter that gets passed is a new thing explained here.

http://www.youtube.com/watch?v=6d_nYErMGPI

Steven


Steven
Post Reply