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 -> CodeCharge.Discussion

 custom php select and add 1 to the returned value

Print topic Send  topic

Author Message
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
>
>


   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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