We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,294 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

input text || ellement below could not print

could someone help me out of this code i have a problem the quoted input text could not be print see my codes

`function generate_table(){
    $query = "select id,branchcode,accountno,accountname,naturalaccount,mname,placeholder,design,elevel from account_codes";
    $result = mssql_query($query);  
    $index = 0; 

    while($result_row=mssql_fetch_array($result)){
    $index++;
        echo '<tr>
                    <td><input size="2" type="hidden" value="'.$result_row['id'].'" name="did'.$index.'" id="did'.$index.'" disabled="disabled"/>';
                        echo '<select  style="width:160px" disabled="disabled" name="bcode'.$index.'" id="bcode'.$index.'" >'.branch_code($result_row['branchcode']).'</select></td>';
                    echo '<td><input type="text" style="width:200px;" value="'.$result_row['accountno'].'" name="ano'.$index.'" id="ano'.$index.'" readonly="readonly"/></td>
                    <td><input type="text" style="width:300px;" value="'.$result_row['accountname'].'" name="aname'.$index.'" id="aname'.$index.'" readonly="readonly"/></td>
                    <td><input type="text" value="'.$result_row['naturalaccount'].'" name="naccount'.$index.'" id="naccount'.$index.'" readonly="readonly"/></td>
                    <td><input type="text" value="'.$result_row['mname'].'" name="mname'.$index.'" id="mname'.$index.'" readonly="readonly"/></td>
                    <td><input  type="text" value="'.$result_row['placeholder'].'" name="pholder'.$index.'" id="pholder'.$index.'" readonly="readonly"/></td>
                    <td><input  size="10" type="text" value="'.$result_row['design'].'" name="design'.$index.'" id="design'.$index.'" readonly="readonly"/></td>
                    <td><input  size="4" type="text" value="'.$result_row['elevel'].'" name="elevel'.$index.'" id="elevel'.$index.'" readonly="readonly"/></td>
                    <td><a href="javascript: edit_acodes('.$index.')" id="editor'.$index.'">edit</a></td><td><a href="delete_acodes.php?did='.$result_row['id'].'">delete</a></td>';
        echo '</tr>';
    }
  echo '<input type="text" id="endindex" name="endindex" value="'.$index.'"/>';
}

function branch_code($default){
    $query = "select left(locationname,PATINDEX( '%~%' , locationname )-1) as id,right(locationname,len(locationname)-PATINDEX( '%~%' , locationname )) as lname from location_setup1_v";
    $result = mssql_query($query);
    $retval = '';
    while($result_row = mssql_fetch_array($result)){
        if($default==$result_row['id']){
            $selected = 'selected="selected"';
        }else{
            $selected = '';
        }
        $retval .= '<option value="'.$result_row['id'].'" '.$selected.' >'.$result_row['lname'].'</option>';
    }
    return $retval;     
}`
3
Contributors
5
Replies
23 Hours
Discussion Span
11 Months Ago
Last Updated
6
Views
Question
Answered
code739
Posting Whiz in Training
208 posts since May 2012
Reputation Points: 17
Solved Threads: 28
Skill Endorsements: 5

Which input does not print (identify it by name attribute)? The first input is the type of "hidden" and won't print which is what is expected. Other input fields show up normaly.

broj1
Nearly a Posting Virtuoso
1,211 posts since Jan 2011
Reputation Points: 167
Solved Threads: 164
Skill Endorsements: 13

Try and watch your opening posts a bit more, it's very hard to read without dots and enters at the right place.
also, if your 'endindex' file seems empty, try to echo $index one rule in front of it, see what that gives you.
try using multiple echoes in your functions to see if it even gets there at all. it lookss commented away here.

phoenix_2000
Junior Poster
143 posts since Sep 2011
Reputation Points: 40
Solved Threads: 16
Skill Endorsements: 0

One more issue: are your queries returning values for all the fields? You are not checking that in your (with isset() function). This is not a good practice. If some field is not returned (since it not exists) your query can break.

broj1
Nearly a Posting Virtuoso
1,211 posts since Jan 2011
Reputation Points: 167
Solved Threads: 164
Skill Endorsements: 13

thanks for the replies =)
i already solved it the query
breaks and only few will be displayed its because there are lots of data to be retrieve and i only set mssql.timeout to 3600

code739
Posting Whiz in Training
208 posts since May 2012
Reputation Points: 17
Solved Threads: 28
Skill Endorsements: 5

OK. Please mark the thread as solved.

broj1
Nearly a Posting Virtuoso
1,211 posts since Jan 2011
Reputation Points: 167
Solved Threads: 164
Skill Endorsements: 13
Question Answered as of 11 Months Ago by broj1 and phoenix_2000

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.1043 seconds using 2.69MB