J.D. Archer
|
Posted: 05/21/2001, 9:00 PM |
|
I want to have a default value put in one of the fields on my form. The sql
code is
select MAX(vci) as vci from dsl
this will return the largest vci. I then want to add 1 to this number. can
someone point me in the right direction to finding the php code for this?
--
-----
J.D. Archer
Network Engineer
221-6389
|
|
|
Alexey Alexapolsky
|
Posted: 05/23/2001, 8:24 AM |
|
Open "Form properties"/Events/"Before show"
Use $db->Link_ID as already created connection variable , here is sample
code :
======================================
$result = mysql_query("select MAX(vci) as vci from dsl",$db->Link_ID);
while ($row = mysql_fetch_array ($result)) {
$tmp= $row["vci"];
}
$fldsomefield = $tmp
=================================================
CC automatically creates variables for form/database fields.
They contain field values that you can feel free to change.
"fld" is a standard prefix for cc field variable. For instance
if field name is price then corresponding cc variable is named fldprice.
You can manipulate them through events.
--
Regards,
Alexey
CodeCharge Support
J.D. Archer <jarcher@qx.net> wrote in message
news:9eco8i$351$1@mail.tankhill.com...
> I want to have a default value put in one of the fields on my form. The
sql
> code is
>
> select MAX(vci) as vci from dsl
>
> this will return the largest vci. I then want to add 1 to this number.
can
> someone point me in the right direction to finding the php code for this?
>
> --
>
> -----
> J.D. Archer
> Network Engineer
> 221-6389
>
>
|
|
|
|