|
Posted by Hilarion on 10/07/35 11:24
shorty wrote:
> > > The following piece of code has worked in the past but any ideas why
> > > it does not work now ???
> > >
> > > $sql = mysql_query("ALTER TABLE `words` ORDER BY `counter` DESC");
> > So what are you trying to do? Maybe you meant
> > SELECT * FROM `words` ORDER BY `counter` DESC?
> > > The code that is above it, also uses the same database, username,
> > > password etc and works fine.
> > >
> > > The mysql scheme privilges are set to 'select' and 'update'
> > See you used ALTER not SELECT or UPDATE.
> After a customer enters data into a table, and then leaves the
> website.
>
> All I want to do is sort (numerically) a particular column in the
> table, and then resave the table, ready for its next use.
Tables in SQL databases are not sorted in any way and you can't
make them be sorted.
What you can do is to sort the data you get from table when
you select the data as Stefan described.
Only statement with which "ORDER BY" can be used is "SELECT"
(not CREATE, ALTER, DROP, INSERT, UPDATE or DELETE).
Hilarion
Navigation:
[Reply to this message]
|