Syntax is ORDER BY column_name ASC|DESC, so your statement:
[PHP]$res = mysql_query("SE LECT * FROM EWT WHERE $field='$findit ' ORDER BY $orderby DESC;") [/PHP]
Ronald :cool:...
User Profile
Collapse
-
[SOLVED] Order by DESC?
-
nvm.... apparantly I did put an extra column in the values, lol....
thx for making me look over it again. Everything works fine now. :D -
Yea I don't know what happened in the Copy & paste, but I assure you the columns are correct on the page.
I'll change the error message too to see what shows up.
Also, I checked the user privelages for inserting and altering the table and everything is fine, don't know... :(Leave a comment:
-
I am having somewhat of a similar problem, but the following should help out a bit... I can elaborate more once I get an answer to my own problem, lol.
[php]
<?php
include 'config.php';
$pili_id=$_POST['pili_id'];
$branch=$_POST['branch'];
$zone=$_POST['zone'];
$location=$_POS T['location'];
$type=$_POST['type'];
$subtype=$_POST['subtype'];
$alamat=$_POST['alamat'];...Leave a comment:
-
Also remember that the code is very touchy...
I find it easier to make html statements in php by using the following...
[php]
<?php
echo "<html code blah blah>"
?>
[/php]Leave a comment:
-
Something wrong with this?
Okay, so I'm trying to send new rows of data to my table on MySQL. I'm pretty sure I have the syntax right but when I go to execute it, it gives me the "or die" message.
Can someone correct this bit of code if it's wrong please?
[php]
/* send the data to table */
$query = "INSERT INTO EWT (Bldg,Room,ST,C ageCD,PartNum,S erialNum,VndID, CompId,Model,RO S,Description,S canned,Section)... -
Awesome thank you so much, that gave me a huge grip on things. Very helpful indeed! =DLeave a comment:
-
Using PHP to query a MySQL Database table
I'm trying to get a php page to show data from a MySQL database. But the problem that I have is I don't know where to start.
I'm very new at PHP and I'm constantly told by others that it's very hard to just jump straight into it, but that's the best way I learn.
All I need to know is how to show all the information I have on a MySQL database table in a table on a web page. From there I should be able to create a form...
No activity results to display
Show More
Leave a comment: