CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Inserting/updating 2 tables from one record form (php/mysql) the right way?

Print topic Send  topic

Author Message
Jean-François ROY
Posted: 04/07/2003, 1:06 PM

Hi all,

There has to be a way to do this?

All I need to do is insert the data from a record form into 2 tables;
t_products & t_suppliers.

Also is it possible to populate the field from t_article -> related to the
same field in t_supplier by selecting an already existing supplier or if new
supllier then auto_increment the id_supplier in both tables field
t_products.id_supplier & t_supplier.id_supplier?

t_products t_supplier
----------- ----------
id_products
id_supplier 8----1 id_supplier (many products, one supplier)

and use a dynamically populated listbox for the field id_supplier with the
existing suppliers?

I use CCS 2.0.5

Thank you,

JFR


PvD
Posted: 04/12/2003, 2:02 AM

Hi Jean-Francois,

the way I see it is that you make two forms with the same information. If
you only want to display the info once, you use hidden fields for the second
form.
You only use one button to submit the form, but instead of making it a
type="submit", you use a type="button".
Then you add an onClick event that calls a piece of script to send both
forms.
Example:
<form name="Form1">
</form>
<form name="Form2">
<input type="button" name="button" value="submit info"
onClick="submitForms()">
</form>

In the header you put:
<script language="JavaScript">
function submitForms() {
document.Form1.submit();
document.Form2.submit();
}
</script>

Hope this helps,

best regards,

Peter


"Jean-François ROY" <jfroy@wanadoo.fr> wrote in message
news:b6slok$qpf$1@news.codecharge.com...
> Hi all,
>
> There has to be a way to do this?
>
> All I need to do is insert the data from a record form into 2 tables;
> t_products & t_suppliers.
>
> Also is it possible to populate the field from t_article -> related to the
> same field in t_supplier by selecting an already existing supplier or if
new
> supllier then auto_increment the id_supplier in both tables field
> t_products.id_supplier & t_supplier.id_supplier?
>
> t_products t_supplier
> ----------- ----------
> id_products
> id_supplier 8----1 id_supplier (many products, one supplier)
>
> and use a dynamically populated listbox for the field id_supplier with the
> existing suppliers?
>
> I use CCS 2.0.5
>
> Thank you,
>
> JFR
>
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.