Fair warning
I do not know alot about mysql or php
I am making an exception sheet, which I plan to migrate to a different local web server when it is finished.
Basiaclly a user will log information.. and I want them to only view the ones that they entered.. Right now I am just focusing on being able to just view the records..
I am having a rough time getting it to display my tables at all.. My method so far is write the code see what doesn't work and fix it. So far I have been able top may a login system, the ability to upload data to the sql server, and it can tell an admin from a regular user..
My problem
the site doesn't pull any errors, but it also doesn't display any data what so ever.. Any ideals?
Here is the code I am using so far.
I do not know alot about mysql or php
I am making an exception sheet, which I plan to migrate to a different local web server when it is finished.
Basiaclly a user will log information.. and I want them to only view the ones that they entered.. Right now I am just focusing on being able to just view the records..
I am having a rough time getting it to display my tables at all.. My method so far is write the code see what doesn't work and fix it. So far I have been able top may a login system, the ability to upload data to the sql server, and it can tell an admin from a regular user..
My problem
the site doesn't pull any errors, but it also doesn't display any data what so ever.. Any ideals?
Here is the code I am using so far.
Code:
<?php
//Load Files
include 'connect.php';
include 'header.php';
//Load databases
$sql = "SELECT
exception.element_5_1,
exception.element_5_2,
exception.element_5_3,
exception.element_1_1,
exception.element_1_2,
exception.element_1_4,
exception.element_2_1,
exception.element_2_2,
exception.element_2_4,
exception.element_4,
exception.element_3,
exception.topic_by
WHERE
exception.topic_by = " . mysql_real_escape_string($_GET['id']);
$result = mysql_query($sql);
//Make sure logged in and correctly privileged
if($_SESSION['signed_in'] == false | $_SESSION['user_level'] != 0 )
{
//the user is not an admin
echo 'Sorry, you do not have sufficient rights to access this page.';
}
else
{
//if not signed in
if(!$_SESSION['signed_in'])
{
echo '<tr><td colspan=2>You must be <a href="signin.php">signed in</a> to reply. You can also <a href="signup.php">sign up</a> for an account.';
}
else
{
if(!$result)
{
while($posts_row = mysql_fetch_assoc($posts_result))
//create table for use to view records.
echo ' All Topics for the user '.$posts_row['topic_by'].'
<table style="text-align: left; width: 762px; height: 77px;" border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td>Date</td>
<td>Time In</td>
<td>Time Out</td>
<td>Code used</td>
<td>Reason</td>
</tr>
<tr>
<td> '.$posts_row['element_5_1'].' - '.$posts_row['element_5_2'].' - '.$posts_row['element_5_3'].'</td>
<td> '.$posts_row['element_1_1'].' : '.$posts_row['element_1_2'].' '.$posts_row['element_1_4'].'</td>
<td> '.$posts_row['element_2_1'].' : '.$posts_row['element_2_2'].' '.$posts_row['element_2_4'].'</td>
<td> '. $posts_row['element_4'].'</td>
<td> '. $posts_row['element_3'].'</td>
</tr>
</tbody>
</table> ';
}
else
{
echo 'The topic could not be displayed, please try again later.';
}
}
}
include 'footer.php';
?>