A JM
Members-
Posts
249 -
Joined
-
Last visited
Everything posted by A JM
-
They are .xls, .doc and maybe some images. I'm looking for the best way to display them on an HTML page. Should I just create a hyperlink to each file and move on... just looking for some ideas. Thanks,
-
I'm looking for some suggestions for allowing my users to view and download files from my site. The files are contained in a single directory and I would like to allow the user to view a list of files in that directory and then be able to select them for downloading, singularly. Anyone have any suggestions for the best way to present this to the user? Thanks. A JM,
-
Since the Option has a blank option the field in the DB can be ISNULL which when using the following gives me "NO" as opposed to a blank? <option value="" <?php echo ($row_rstocdetail['pol_mortgage']="")?"selected=\"selected\"":"";?>></option>" <option value="Y" <?php echo ($row_rstocdetail['pol_mortgage']="Y")?"selected=\"selected\"":"";?>>YES</option>"; <option value="N" <?php echo ($row_rstocdetail['pol_mortgage']="N")?"selected=\"selected\"":"";?>>NO</option>" <option value="M" <?php echo ($row_rstocdetail['pol_mortgage']="M")?"selected=\"selected\"":"";?>>MayBe</option>" Can I actually test for ISNULL and set the option to be blank? Thanks. A JM,
-
It also has an empty/null option.. is that feasible to add into that? So there really no need for a single line - I see. Can you also perform a CASE statement similarly? Thanks. A JM,
-
I'm trying to set the value of a YES/NO Option from a recordset so that the end user can edit the field if needed. Just reaching out for some solution... this didn't work. <select size="1" name="pol_mortgage" tabindex="32" class="form-inputitem"></option> <option value="<?php echo htmlentities($row_rstocdetail['mortgage'], ENT_COMPAT, 'utf-8'); ?>"><?php echo htmlentities($row_rstocdetail['mortgage'], ENT_COMPAT, 'utf-8'); ?></option> <option value="Y">YES</option> <option value="N">NO</option></select>
-
I need some help with a single line IF ELSE statement - hopefully someone can help... I was under the impression this would work but I'm not having any luck. <?php $answ=$row_rstocdetail['pol_mortgage']=="y" ? "YES" : "NO"; ?> Thanks. A JM,
-
Hey joel24 nice to see you again. After re-reading my post I realize that I left out some important info. like I'm trying to set the default value from a recordset. So, I have a recordset that I am reading and using and I need to populate the state field onmy form which is essentially an EDIT form for the user to change the state if necessary. Sorry about that. A JM,
-
I'm using a Master/Detail scenario and my Detail page has a State field that I am trying to populate but not having any luck - can someone give me a hand with this? Selected should be the default but its not working... <select name="clnt_state" id="clnt_state" tabindex="8" class="form-inputitem" selected"<?php echo htmlentities($row_rstocdetail['clnt_state'], ENT_COMPAT, 'utf-8'); ?>"> <option value=""></option> <option value="AL">AL</option> <option value="AK">AK</option> <option value="AZ">AZ</option> <option value="AR">AR</option> <option value="CA">CA</option> <option value="CO">CO</option> <option value="CT">CT</option> <option value="DE">DE</option> <option value="DC">DC</option> <option value="FL">FL</option> <option value="GA">GA</option> <option value="HI">HI</option>...
-
yes, thanks I cut down the SQL statement since it was redundant. I still have the zero records returned issue though. A JM,
-
How should I handle zero records returned from my query? mysql_select_db($database_maxdbconn, $maxdbconn); $query_rstassign = "SELECT ID FROM users WHERE usergroup = 'adjuster' AND username = '" . $_SESSION['MM_Username'] . "'"; $rstassign = mysql_query($query_rstassign, $maxdbconn) or die(mysql_error()); $row_rstassign = mysql_fetch_assoc($rstassign); $activeADJ = $row_rstassign['ID']; The above query retrieves the ID of the user logged in. In some instances the ID retrieved when used in this later query will retrieve zero records, that's OK. $query_rstassign = "SELECT clnt_city, clnt_state, clnt_zipa FROM claimcue WHERE chk_new = 1 AND adj_id = " . $activeADJ . " ORDER BY clnt_zipa ASC"; How do I deal with my Dynamic Table that I'm creating when zero records are retrieved? This is the error that I'm seeing. Thanks. A JM,
-
[SOLVED] Using Yes/No <Input> with a Dynamic Recordset problem?
A JM replied to A JM's topic in PHP Coding Help
I was thinking 2 checkboxes... duh. I got you now. Thanks, -
[SOLVED] Using Yes/No <Input> with a Dynamic Recordset problem?
A JM replied to A JM's topic in PHP Coding Help
How do I get a checkbox to uncheck when I select the opposite item? its not performing like a radio button... A JM, -
[SOLVED] Using Yes/No <Input> with a Dynamic Recordset problem?
A JM replied to A JM's topic in PHP Coding Help
Since I'm new here - do I need to close this question or wrap it up somehow? Thanks, -
[SOLVED] Using Yes/No <Input> with a Dynamic Recordset problem?
A JM replied to A JM's topic in PHP Coding Help
Correct Joel. In the form there is a loop, the Dynamic table was created by Dreamweaver CS4. Now that I see how this is working I needed to create the variables as you said and add my object, it works as needed. <?php do { ?> ... <?php } while ($row_rstassign = mysql_fetch_assoc($rstassign)); ?> Thanks for your help - you got me there. I agree and will be changing them. -
[SOLVED] Using Yes/No <Input> with a Dynamic Recordset problem?
A JM replied to A JM's topic in PHP Coding Help
thanks joel24. I think I may have found the solution and it appears easier than I thought... <input type="radio" name="chk_accept<?php echo $i++; ?>[]" value=1> Do you see a reason why this wouldn't work? :-\ A JM, -
[SOLVED] Using Yes/No <Input> with a Dynamic Recordset problem?
A JM replied to A JM's topic in PHP Coding Help
I'm just trying to loop through the number of records in the recordset. Can I implement a counter in the form, how would I do that? Like: <?php $counter++><input type="radio" name="chk_accept[]" . <?php $counter> . "value=0> -
[SOLVED] Using Yes/No <Input> with a Dynamic Recordset problem?
A JM replied to A JM's topic in PHP Coding Help
yes, that is corect. I was trying something like this but can't get it to work. //<Input type=radio $theusers = ''; $theusers .= '<input type="radio" name="chk_accept[]"'; while ($row = mysql_fetch_assoc($rst_adjusters)) { $i=0; $theusers .= . $i . ; $i++; } $theusers .= 'value=1>'; Then on the form: <?php echo $theusers; ?> [edit] <input type="radio" name="chk_accept[]"012345678 value=1> It's close but I think it needs to be in the form loop. Can I set up a counter in the form? -
[SOLVED] Using Yes/No <Input> with a Dynamic Recordset problem?
A JM replied to A JM's topic in PHP Coding Help
The recordset is dynamic so a set nnumber ofiterations won't get it... I had used this routine on a dropdown box that worked great but wasn't sure how to implement for my <input> items? $theusers = ''; $theusers .= '<select name="adj[]"><option value="Please Select">Please Select</option>'; while ($row = mysql_fetch_assoc($rst_adjusters)) { $theusers .= '<option value=' . $row['ID'] . '>' . $row['firstname'] . ' ' . $row['lastname'] . '</option>'; } $theusers .= '</select>'; -
[SOLVED] Using Yes/No <Input> with a Dynamic Recordset problem?
A JM replied to A JM's topic in PHP Coding Help
I thought that might be the problem but am not sure how to create the auto numbering, any suggestions on how to do that? A JM, -
I'm running into a slight problem getting a Yes/No <input> to work with a dynamic recordset. Creating the Yes/No options aren't the problem, its that each record when I choose either Yes or No impacts the other records on my form in a different record. For example, on record 1 if I choose Yes or No choosing one deselects the other but if I move to record 2 and do the same then record 1 clears and vice versa. How do I get this to work since I think I have to name the input type the same name in order to get the Yes/No to originally work? <input type="radio" name="chk_accept[]" value=1> <input type="radio" name="chk_accept[]" value=0> A JM,
-
Thanks for the post joel24, Let me see if I somewhat understand... I can use the Submit button on the form to Post - so the $_POST['adj'] variables are populated and then stop the page from ??? (not really sure what it was doing) by using - header('location: '.basename($_SERVER['PHP_SELF'])); exit(); I'm still pretty new to PHP can you explain this a little more for me? From what I can tell - when submitting the form it was running my SQL UPDATE and then refreshing some portion of the page but I don't understand why it was only generating a partial recordset. I believe that fixed my problem, many thanks!!!
-
Can someone answer this for me. <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1"> <input type="submit" value="Post Assignments" /> When I use the above action on my form and click the submit button does that cause the form to re-run the entire page of PHP code? Since my form consists of multiple sections of PHP code I'm wondering how to handle just running certain sections? Thanks.
-
I'm still trying to solve this problem and hoping someone can help... I'm wondering if using $editFormAction in my form is the way to go with this since my intent is to update the records in the database and remove those items from the users view on the form. The ideal for me would be to submit the form, update the records in the DB with the users selections of the dropdowns , then have the form redrawn. Is there a better way to do this? A JM,
-
Sorry to reply to my own post. I think I've finally figure out the routine but am still a little perplexed on the form re-draw issue but I think I know the problem with it, maybe? <?php $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { //print_r($_POST['adj']); //exit(); $i = 0; Do { $adjID = $_POST['adj'][$i]; if($adjID<>"Please Select") { $updateSQL = sprintf("UPDATE claimcue SET adj_id='" . $adjID . "' WHERE maxclaimnum=" . $row_rstassign['maxclaimnum']); mysql_select_db($database_maxdbconn, $maxdbconn); $Result1 = mysql_query($updateSQL, $maxdbconn) or die(mysql_error()); } $i++; } while ($row_rstassign = mysql_fetch_assoc($rstassign)); } ?> Does the form get redrawn because I'm calling the PHP function using the form action? action="<?php echo $editFormAction; ?>"
-
BINGO! thank you - been looking for that for a while... arrgh.. Does "escape the quotations" mean if I had $adjID = $_POST["adj"][$i]; instead of $adjID = $_POST['adj'][$i]; that it would have worked? Shouldn't the while ($row = mysql_fetch_assoc($rstassign)) only loop through the number of rows in the recordset? I'm also seeing a new problem - the form is being re-drawn with only a single record after SUBMIT there were originally 10 records on the form. The 1st record is all that exists the other 9 are gone, does that make any sense to you? A JM,