0

I cannot get this table to work even though i hav eit working PERFECTLY in 3 other instances, now what i dont get is it seems to be a connection issue between the database and the form, now that makes some sense to me. What doesnt make sense is when i do the exact solution to connect it to the database, it doesnt work at all. what gives!

<?php mysql_select_db('numbers', mysql_connect('localhost','root',''))or die(mysql_error());?>

<html>
        <link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="screen">

        <link rel="stylesheet" type="text/css" href="css/DT_bootstrap.css">

<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>

<script type="text/javascript" charset="utf-8" language="javascript" src="js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8" language="javascript" src="js/DT_bootstrap.js"></script>


<form method="post">
<div class="row-fluid">
        <div class="span12">

            <div class="container">
            <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">

            <div class="alert alert-info">

            <center>                  
            <strong><i class="icon-user icon-large"></i>&nbsp;Uploaded Files</strong>
            </center>

            </div>
            <thead>

                <tr>

                  <th>File Name</th>
                  <th>Upload Date</th>
                  <th>Upload Time</th>

                  </tr>
              </thead>
              <tbody>
              <?php 
              $query=mysql_query("select * from upfiles")or die(mysql_error());
              while($row=mysql_fetch_array($query)){
              $id=$row['id'];
              ?>

                    <tr>

                     <td><?php echo $row['filename'] ?></td>
                     <td><?php echo $row['update'] ?></td>
                     <td><?php echo $row['uptime'] ?></td>

                    </tr>

              <?php } ?>
              </tbody>
              </table>
          </div>
      </div>
  </div>
</form>
</html>

here is my table, why isnt it connecting to the database??? why is this different while the others are exactly alike and they work fine?

3
Contributors
9
Replies
42
Views
2 Years
Discussion Span
Last Post by berserk
0

I tried that, putting the three semi Colons at the end of my echo lines but they arent there in my other tables and they work just fine, plus it yielded the same result. I even tried moving some of the html around but NOTHING, its gotta be where it cant access the database, but why cant it? I dont see how this is any different execpt MAYBE where this table is along side another html file for uploading, but that shouldnt make any difference.

0

here it is

</head>

    <div class="row-fluid">
        <div class="span12">


            <div class="container">


<br><br>
                            <form method="post">
                        <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">

                            <div class="alert alert-info">

                                <strong><i class="icon-user icon-large"></i>&nbsp;Do Not Call Information From User Submitted Data</strong>

                            </div>
                            <thead>

                                <tr>

                                    <th>Employee Name</th>
                                    <th>First Name</th>
                                    <th>Last Name</th>
                                    <th>Email Address</th>
                                    <th>Customer Address</th>
                                    <th>Phone Number</th>
                                    <th>Date Added</th>
                                    <th>Time Added</th>
                                    <th>Accidental Calls</th>
                                </tr>
                            </thead>
                            <tbody>
                            <?php 
                            $query=mysql_query("select * from usernumdata")or die(mysql_error());
                            while($row=mysql_fetch_array($query)){
                            $id=$row['id'];
                            ?>

                                        <tr>

                                         <td><?php echo $row['empname'] ?></td>
                                         <td><?php echo $row['firstname'] ?></td>
                                         <td><?php echo $row['lastname'] ?></td>
                                         <td><?php echo $row['email'] ?></td>
                                         <td><?php echo $row['streetadd'], " ", $row['city'], " ", $row['state'], " ", $row['zip'], " ", $row['prov'] ?></td>
                                         <td><?php echo $row['numb'] ?></td>
                                         <td><?php echo $row['date'] ?></td>
                                         <td><?php echo $row['time'] ?></td>
                                         <td><?php echo $row['called'] ?></td>
                                </tr>

                                  <?php } ?>
                            </tbody>
                        </table>

</form>

sadly it is identical, :/

0

I figured out the issue, i was posting twice on the same page, not allowed so i fixed it.

This question has already been answered. 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.