Another question on PHP

From: Date: Wed, 07 Jun 2000 19:17:36 +0000
Subject: Another question on PHP
Groups: php.db 
Request: Send a blank email to php-db+get-254@lists.php.net to get a copy of this message
I actually have two question. How do I initialize a variable, I would like to initialize the variable to 0 before the submit is ran. $foo=0, where do I put this at in my source code? Also where do I put the Anchor so it will show up at the bottom of my return query. Where it at right now it shows up on top. Thanks for the help Tim <html> <body> <? if(!isset($submit)){ ?> <form> <form method=post action='divedepthq.php3'> <input type='text' name='foo'> <input type='submit' name='submit' value='Search'> </form> <A href = "divedepthq.php3">Back</A> <? } else { } ?> int settype(foo, integer type); <table border=0><td width=105><td width=190><td width=90><td width=88><td width=93> <TR><TD><B><CENTER> Dive Location</CENTER></B></TD> <TD><B><CENTER> Dive Site</CENTER></B></TD> <TD><B><CENTER> Dive Buddy</CENTER></B></TD> <TD><B><CENTER> Dive Depth</CENTER></B></TD> <TD><B><CENTER> Bottom Time</CENTER></B></TD></TR></B> <?php $db = ODBC_Connect("dive", "", ""); $res = ODBC_Exec($db, "SELECT * FROM tblDiveData WHERE DiveDepth >=$foo"); while (ODBC_Fetch_Row($res)) { echo "<table border=0><td width=107><td width=192><td width=90><td width=88><td width=93>\n"; echo "<TR><TD><CENTER>".ODBC_Result($res, 'DiveLocation')."</CENTER></TD>", "<TD><CENTER>".ODBC_Result($res, 'DiveSite')."</CENTER></TD>", "<TD><CENTER>".ODBC_Result($res, 'DiveBuddy')."</CENTER></TD>", "<TD><CENTER>".ODBC_Result($res, 'DiveDepth')."</CENTER></TD>", "<TD><CENTER>".ODBC_Result($res, 'BottomTime')."</CENTER></TD>","</TR>"; } ODBC_Free_Result($res); ?> </body> </html> ===== "Hokey religions and ancient weapons can never compare to a good blaster at your side, Kid." May all your bubbles be external. __________________________________________________ Do You Yahoo!? Yahoo! Photos -- now, 100 FREE prints! http://photos.yahoo.com

« previous php.db (#254) next »