Unknown Column 'id' In 'order Clause' Username Id, I need some help with this php |
||
Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.
In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.
Zymic Webmaster Forums Zymic Free Web Hosting Zymic Free Web Hosting - General Discussion & Help |
||
Unknown Column 'id' In 'order Clause' Username Id, I need some help with this php |
||
Sep 29 2009, 11:53 PM
Post
#1
|
|
![]() Member ![]() ![]() Group: Members Posts: 69 Joined: 29-September 09 Member No.: 111,978 |
Ok, I hope I am posting in the right section
I keep getting this error on my page: CODE Unknown column 'ID' in 'order clause' UserName ID I have no idea what is wrong. I am good at fixing most errors in my script after they are pointed out, but this one just baffles me. Here is the full code: CODE <?php $con = mysql_connect("localhost","hidden","hidden"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("altapets_zxq_dbtables", $con); $result = mysql_query("SELECT * FROM members ORDER BY ID"); echo "<table border='0'> <tr> <th>UserName</th> <th>ID</th> </tr>"; $sql = "SELECT * FROM users ORDER BY ID"; $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "<tr>"; echo "<td>" . $row['UserName'] . "</td>"; echo "<td>" . $row['ID'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> It is a script that will show a list of all registered members. Please note that the "hidden" is just so I don't give away my database username and password, as I use them for almost all things. |
|
|
![]() |
Sep 30 2009, 06:22 PM
Post
#2
|
|
![]() Member ![]() ![]() Group: Members Posts: 69 Joined: 29-September 09 Member No.: 111,978 |
I do, don't I?
|
|
|
Sep 30 2009, 10:43 PM
Post
#3
|
|
![]() Outrageously Uber Ninja ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Administrators Posts: 2,831 Joined: 11-March 07 From: UK Member No.: 9 |
|
|
|
PHP_student Unknown Column 'id' In 'order Clause' Username Id Sep 29 2009, 11:53 PM
Ed The column names are case sensitive, so ensure the... Sep 30 2009, 03:21 AM
PHP_student Oh! It is in my database table. I thought it w... Oct 1 2009, 06:21 PM
PHP_student I thought I fixed it but when I checked my page ag... Oct 2 2009, 10:32 AM
Ed What's the table schema? Oct 2 2009, 11:08 AM
PHP_student Tables:
active_guests
active_users
banned_users
m... Oct 4 2009, 09:51 AM
PHP_student I'm going to have to take a good review at all... Oct 5 2009, 09:55 PM ![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 24th May 2013 - 12:54 PM |