neverforget98 Posted November 2, 2012 Share Posted November 2, 2012 I've been using snippets plus my own knowledge to code a new system called Integrated Services for my organization. I know SOMETHING is wrong but I can't find what, it's a snippet that I found that I REALLY like. Can you guys try to find out why I'm getting the error below? I have included the code too! Thanks so much! I think this line $result=mysql_query("SELECT * FROM users ORDER BY id ID"); and this line while($res=mysql_fetch_array($result)){ are causing the problems! <?php session_start(); require("inc/mysql.php"); require("inc/Membership.class.php"); $Member = new Membership($DBH); require("inc/membership.php"); //test user permissions if(!$Member->test_perms(2)) { //No perms, echo error or forward or something header( 'Location: nopermission.php' ) ; } ?> <html> <head> <title>Users | OUB's Integrated Services</title> <meta name="description" content=""> <meta name="author" content="Brandin Arsenault, OUB"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <script src="./ajax/libs/jquery/1/jquery.min.js"></script> <link rel="stylesheet" href="css/960.css" /> <link rel="stylesheet" href="style.css" /> <script src="js/scripts.js"></script> <script type="text/javascript" language="javascript" src="jquery-1.2.6.min.js"></script> <div id="message_box"> <?php { echo "Hello, " . $Member->get_field("real_name"); }?> </div> <?php //including the database connection file include_once("inc/usersdb.php"); //fetching data in descending order (lastest entry first) $result=mysql_query("SELECT * FROM users ORDER BY id ID"); ?> </head> <body> <br /><br /><br /><br /> <?php include 'header.php'; ?> <br /><br /> <center><h5>INTEGRATED SERVICES USERS</center> <br /> <center> <?php echo "<table width='100%' border=0>"; echo "<tr>"; echo "<th>ID</th>"; echo "<th>Name</th>"; echo "<th>Username</th>"; echo "<th>Position</th>"; echo "<th>Email</th>"; echo "<th>Alternate Email</th>"; echo "<th>Home Number</th>"; echo "<th>Mobile Number</th>"; echo "<th>System Username</th>"; echo "<th>System Password</th>"; echo "<th>NDA</th>"; echo "<th>PCA</th>"; echo "<th>TOU</th>"; echo "<th>Permissions</th>"; echo "<th>Update</th>"; echo "</tr>"; while($res=mysql_fetch_array($result)){ echo "<tr bgcolor='#CCCCCC'>"; echo "<td>".$res['id']."</td>"; echo "<td>".$res['real_name']."</td>"; echo "<td>".$res['username']."</td>"; echo "<td>".$res['position']."</td>"; echo "<td>".$res['email']."</td>"; echo "<td>".$res['altemail']."</td>"; echo "<td>".$res['hnumber']."</td>"; echo "<td>".$res['mnumber']."</td>"; echo "<td>".$res['sysusername']."</td>"; echo "<td>".$res['syspassword']."</td>"; echo "<td>".$res['nondisclosure']."</td>"; echo "<td>".$res['properconduct']."</td>"; echo "<td>".$res['termsofuse']."</td>"; echo "<td>".$res['perms']."</td>"; echo "<td><a href=\"edit.php?id=$res[id]\">Edit</a> | <a href=\"delete.php?id=$res[id]\">Delete</a></td>"; } echo "</table>"; ?> <p><a href="auseradd.php">Add New User</a></p> <?php include 'logout.php'; ?> </body> </html> Thanks again, <33s Link to comment https://forums.phpfreaks.com/topic/270229-i-need-help/ Share on other sites More sharing options...
Pikachu2000 Posted November 2, 2012 Share Posted November 2, 2012 A haiku to help explain: Your query now fails Echo mysql_error() To see the message Link to comment https://forums.phpfreaks.com/topic/270229-i-need-help/#findComment-1389810 Share on other sites More sharing options...
neverforget98 Posted November 3, 2012 Author Share Posted November 3, 2012 Fixed it! Thanks very much! <33 hugzz! Link to comment https://forums.phpfreaks.com/topic/270229-i-need-help/#findComment-1389811 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.