[PHP] SQL select

2003-07-21 Thread Ji Nmec
heloo, i have got a MySQL table: id_comp id_goods type cooler aa1256 n cooler aa1255 n cooler aa1317 f cooler aa1196 n cpu cpu183 n cpu cpu177 f cpu cpu190 n gk gk1265 f gk gk1258 n gk NULL i gk gk1193 n gk gk1257 n mb mb f ram mem713 n ram me1112 f ram mem704 n ram me1081 n and I need

Re: [PHP] SQL select

2003-07-21 Thread David Nicholson
Hello, This is a reply to an e-mail that you wrote on Mon, 21 Jul 2003 at 11:08, lines prefixed by '' were originally written by you. heloo, i have got a MySQL table: id_comp id_goods type has somebody some idea hot to select? This is off topic for this list but here goes... SELECT * FROM

Re: [PHP] SQL select

2003-07-21 Thread Curt Zirzow
* Thus wrote Jiøí Nìmec ([EMAIL PROTECTED]): and I need only first row of each component order by type. so: cooler aa1317 f cpu cpu177 f gk NULL i mb mb f ram me1112 f has somebody some idea hot to select? Suggestion: invest in a SQL book. Curt -- I used to think I was

[PHP] SQL select

2003-07-10 Thread Ji Nmec
hello, i have got a problem with SQL select: I have got a table such this: id_k typ name id 1 f bla1 1 2 f bla2 1 2 i bla3 1 3 z bla4 1 3 f bla5 1 4 i bla6 1 4 z bla7 1 5 z bla8 1 and id = 1 and I need select these rows: id_k typ nazev

Re: [PHP] SQL select

2003-07-10 Thread Marek Kilimajer
I did not understand you much but would not this work? SELECT * FROM table WHERE typ='f' OR typ='i' Ji Nmec wrote: hello, i have got a problem with SQL select: I have got a table such this: id_k typ name id 1 f bla1 1 2 f bla2 1 2 i bla3 1 3 z bla4 1 3 f bla5

Re: [PHP] SQL select

2003-07-10 Thread Mark
Jiøí Nìmec wrote: hello, i have got a problem with SQL select: I have got a table such this: id_k typ name id 1 f bla1 1 2 f bla2 1 2 i bla3 1 3 z bla4 1 3 f bla5 1 4 i bla6 1 4 z bla7 1 5 z bla8 1 and

Re: [PHP] SQL select

2003-07-10 Thread Adam Voigt
Hmm. How about: SELECT DISTINCT id_k, name FROM tablename WHERE typ != 'z' ORDER BY typ ASC; Does that work? On Thu, 2003-07-10 at 11:29, Mark wrote: Ji Nmec wrote: hello, i have got a problem with SQL select: I have got a table such this: id_k typ name id 1 f

[PHP] SQL Select on a DATE field

2003-06-05 Thread Lorenzo Ciani
Hi all! I would like to ask your advice on a script that I wrote. As you can surely see from my script below, I really need help as I am totally new to PHP. Regular expressions are my worst nightmare because I don't have a background in software programming: I'm just kidding around here! Please

Re: [PHP] SQL Select Unique() ?

2001-05-02 Thread Anuradha Ratnaweera
On Thu, 19 Apr 2001, James, Yz wrote: Is there a method of extracting rows from a MySQL table Uniquely (as in only once) ?. For example, when a user performs a search, using two words, it may return the same row twice if the search is spread over two or more SQL selections. An example:

Re: [PHP] SQL Select Unique() ?

2001-05-02 Thread CC Zona
In article Pine.LNX.4.21.0105021106340.342-10@presario, [EMAIL PROTECTED] (Anuradha Ratnaweera) wrote: Is there a method of extracting rows from a MySQL table Uniquely (as in only once) ?. For example, when a user performs a search, using two words, it may return the same row

[PHP] SQL Select Unique() ?

2001-04-19 Thread James, Yz
Hi Guys, Is there a method of extracting rows from a MySQL table Uniquely (as in only once) ?. For example, when a user performs a search, using two words, it may return the same row twice if the search is spread over two or more SQL "selections". An example: If hypothetical row 129 is a

Re: [PHP] SQL Select Unique() ?

2001-04-19 Thread David Robley
On Fri, 20 Apr 2001 05:41, James, Yz wrote: Hi Guys, Is there a method of extracting rows from a MySQL table Uniquely (as in only once) ?. For example, when a user performs a search, using two words, it may return the same row twice if the search is spread over two or more SQL

Re: [PHP] SQL Select Unique() ?

2001-04-19 Thread CC Zona
In article 9bng4u$ftc$[EMAIL PROTECTED], [EMAIL PROTECTED] ("James, Yz") wrote: $sql = "SELECT * FROM table WHERE category LIKE 'Public House / Restaurant' OR description LIKE 'Public House / Restaurant'"; Surely that would bring the same row back twice Surely not. Have you tried it

[PHP] SQL - Select rand() ?

2001-04-17 Thread James, Yz
Hi Guys, If I wanted to retrieve just one field randomly from a MySQL table, would I just use something like: "SELECT RAND(id) FROM table LIMIT 0,1" ? I suppose the best thing for me to do would be to try it, but I am fast losing the will to stay awake ;) Thanks, as always, James. --

Re: [PHP] SQL - Select rand() ?

2001-04-17 Thread Steve Lawson
Sup, In the newer versions of mySQL, you can get random results like SELECT id FROM table ORDER BY rand() LIMIT 0,1 SL. - Original Message - From: "James, Yz" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 17, 2001 2:55 PM Subject: [PHP] SQL - Select rand