Re: session_registered variable problem

From: Date: Mon, 28 Jan 2002 15:45:23 +0000
Subject: Re: session_registered variable problem
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-16249@lists.php.net to get a copy of this message
On Monday 28 January 2002 17:34, Jason Wong wrote: > > Crikey, it looks terribly complicated for what looks like something to page > through a set of results. > > Wouldn't it be easier to do away with the ereg_replace()? > > if($go=="next") { > if($page < $nr_pages && $page >= 0) { > $page++; > $start = $page * 20; > } > } > > $qry = "SELECT > > L.Tunnus,N.Nimi,L.ISSN,L.Vuosi,L.Lisätietoja,L.Vuosikerta,L.Numerot,L.Huom > autuksia FROM uusi_lehtitaulu L, nimet N > WHERE (L.Nimi_id=N.id AND N.Nimi LIKE "asdf") > LIMIT $start,20" > > > Even it this doesn't work, at least it's easier to understand :) Well, in this particular case it won't work at all, because the SQL-query is dynamically created based on what the user wants to search for. It doesn't nessecary include all columns. The only static bit of the query is "FROM uusi_lehtitaulu L, nimet N" and "WHERE (L.Nimi_id=N.id" : ) It would be just as big a mess with a truckload of concatenations, like $query = "SELECT " . $tables . " FROM uusi_lehtitaulu L, nimet N WHERE (L.nimi_id=N.id" . $search . ") LIMIT $start,20"; Besides, I have a strange fetisch to do everything the hard way. : ) Cheers, Markus -- Markus Lervik Linux-administrator with a kungfoo grip Vaasa City Library - Regional Library markus.lervik@vaasa.fi +358-6-325 3589 / +358-40-832 6709

« previous php.db (#16249) next »