RE: why does it not work

2001-05-23 Thread Adrian D'Costa
On Wed, 23 May 2001, Don Read wrote: > > > > > > > > > >> while($row = mysql_fetch_object($result)) > > Do you plan on executing a mysql_query() some time before this ? Actually it is executed before this. This scripts works fine on my local host running php 4.0.1pl2. Every time I r

RE: why does it not work

2001-05-23 Thread Kent Hoover
You didn't show the code where the mysql_query() is done. Further, you have "RAND as r" coded in your select statement, not "RAND( ) as r". Is this live code? Cheers, Kent (filter feeder: database) - Before posting, please ch

RE: why does it not work

2001-05-23 Thread Don Read
On 22-May-01 Adrian D'Costa wrote: > > Thanks. Now I am into another problem. I am not sure whether it is php > or mysql. Though it works in the command prompt of mysql. Below is the > snippet of my php script. What I am trying to do is to randomly display a > scroll from the special table

RE: why does it not work

2001-05-21 Thread Adrian D'Costa
On Mon, 21 May 2001, indrek siitan wrote: > order by rand() didn't work back in 3.22. > > if i remember correctly (if this doesn't work, you can try to search > the list archives), the workaround was: > > SELECT col1,col2,RAND() as r FROM table ORDER BY r LIMIT 1; Thanks. Now I am into anoth

RE: why does it not work

2001-05-20 Thread indrek siitan
Hi, > -> DAY) >'$tdate' and city.id=special.cityid order by RAND() limit 1; > ERROR 1064: You have an error in your SQL syntax near 'RAND() limit 1' at > line 3 > > select version(); > +---+ > | version() | > +---+ > | 3.22.32 | > +---+ > > What could be the proble

Re: why does it not work

2001-05-20 Thread Peter Pentchev
On Mon, May 21, 2001 at 11:32:46AM +0530, Adrian D'Costa wrote: > Hi, > > I have been trying this on my localhost and this works > > select special.contid, special.cityid, special.curr1, special.catalogo, > special.hf, special.curr2, special.vitofferta, special.fh, special.club, > special.stars

Re: why does it not work

2001-05-20 Thread Colin Faber
Err also, RAND() is a 3.23 feature ;-) Adrian D'Costa wrote: > > Hi, > > I have been trying this on my localhost and this works > > select special.contid, special.cityid, special.curr1, special.catalogo, > special.hf, special.curr2, special.vitofferta, special.fh, special.club, > special.sta

Re: why does it not work

2001-05-20 Thread Colin Faber
3.22.32 has known Join issues, the machine running that version should be upgraded to the 3.23.32 STABLE release. Adrian D'Costa wrote: > > Hi, > > I have been trying this on my localhost and this works > > select special.contid, special.cityid, special.curr1, special.catalogo, > special.hf,

why does it not work

2001-05-20 Thread Adrian D'Costa
Hi, I have been trying this on my localhost and this works select special.contid, special.cityid, special.curr1, special.catalogo, special.hf, special.curr2, special.vitofferta, special.fh, special.club, special.stars, city.city from special,city where DATE_SUB(special.periodo, INTERVAL 3 DAY)