0

this is my modal button

this is within the table that why i use echo $rows['id']

    <a data-id="<?php echo $rows['id']; ?>" type="button" class="btn btn-success btn-lg btn-block" data-toggle="modal" data-target="#myModal">View Order</a>

this is my modal body

<?php
                        include('../conn.php');
                        $id=$_GET['id'];
                        $list_query=mysql_query("select * from db where id='$id'");
                        $rows=mysql_fetch_array($list_query);
                    ?>
                    <form class="form-horizontal orderitem" role="form">
                        <div class="form-group">
                            <label for="inputFullName" class="col-sm-2 control-label">Full Name</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="fullname" value="<?php echo $rows['id'];  ?>">
                            </div>
                        </div>
                        </div>
                    </form>

Edited by Shodow

2
Contributors
5
Replies
42
Views
3 Years
Discussion Span
Last Post by mattster
0

Just saying, it's very unhelpful when people don't actually post a problem, but hey ho...

I can instantly see one error in your code however, and you are closing one to many <div> tags around line 13-14. So just remove one of those lines and you should be fine.

jsFiddle to show my attemped mockup at what you've done (with php variables substituted).

-1

i want to pass the value of mysql to modal

Votes + Comments
Tell us what's wrong and what's not working, because that isn't very helpful at all. Help us to help you.
0

Sorry, my magical powers are a bit cloudy this morning, can't seem to guess whats not working for you for some reason...

Show your error messages and actually tell us what isn't working!!!

I'm sorry to be inpatient, but come on that is absolutely rediculous.

Edited by mattster

0

there is no error, but the output is not right, the data is not showing up in the modal

0

Well have you checked to make sure the rest of your markup is like mine in the fiddle. Because the rest of your HTML that you've provided is legitimate (as proved by the fiddle).

I cant see any other reason why it shouldn't show up. What does "View Source" or "Developer tools" show?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.