Re: [PHP] MySQL select matching

2010-07-20 Thread Simcha Younger
On Mon, 19 Jul 2010 10:36:40 -0600 "Ashley M. Kirchner" wrote: > mysql> select * from table where id='1'; > +---+-+-+---+ > | 1 | 123 | 0.0 | C | > | 1 | 234 | 0.1 | D | > | 1 | 345 | 0.0 | D | > | 1 | 456 | 0.1 | C | > | 1 | 567 | 0.1 | G | > +---+-+-

[PHP] Re: [php] & [mysql] select and subselect

2009-11-17 Thread Nisse Engström
On Mon, 16 Nov 2009 14:21:41 -0800, Allen McCabe wrote: > I have an order table that keeps track of the order_id, the date, the > status, etc. I also have an order_lineitem table that is the contents of the > order. This has a one-to-many structure (without foreign keys because it is > mysql).

[PHP] Re: [php] & [mysql] select and subselect

2009-11-17 Thread David Robley
Allen McCabe wrote: > I have a page on my site where I can optionaly filter by certain fields > (order by filesize or file category), but I am implementing a shopping > cart type of idea where users can submit an order. > > As administrators, my coworkers and I need to be able to filter orders by

RE: [PHP] mysql select statement in php having three conditions

2005-12-16 Thread Jay Blanchard
[snip] can someone tell me how to do this: i have to retrive data from a mysql table let's sayTABLE . i have to check that the rows i retrive meet this condition: field1='$variable',field2 is false and field3 is also false. as you can see field2 and field3 are bool type. field1 is varchar. i di

RE: [PHP] mysql select and date functions

2003-02-18 Thread John W. Holmes
> Change your query: > selectdayofmonth(Posted) as DOM_Posted, > month(Posted) as M_Posted, > year(Posted)as Y_Posted, > hour(Posted) as HH_Posted, > minute(Posted) as MM_Posted, > Name, > Prayer > from pray

Re: [PHP] mysql select and date functions

2003-02-18 Thread Sunfire
tnx it worked just like i wanted it to... - Original Message - From: "Barajas, Arturo" <[EMAIL PROTECTED]> To: "'Sunfire'" <[EMAIL PROTECTED]> Sent: Tuesday, February 18, 2003 7:59 PM Subject: RE: [PHP] mysql select and date functions > Ha

RE: [PHP] mysql select and date functions

2003-02-18 Thread Bryan Lipscy
Change your query: select dayofmonth(Posted) as DOM_Posted, month(Posted) as M_Posted, year(Posted)as Y_Posted, hour(Posted) as HH_Posted, minute(Posted) as MM_Posted, Name, Prayer from prayer T

Re: [PHP] Mysql Select

2003-02-09 Thread Nicola Delbono
SELECT DISTINCT(gallery.design) FROM gallery : > >I want to limit to 1 the same names returned from the query like: [CUT] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MySQL select a field's first X bytes

2002-12-16 Thread Micah Bushouse
Thanks a lot! I'm just blind! "Quentin Bennett" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] o.nz... What's wrong with select left(myfield, 500) from mytable; ? Quentin -Original Message- From: Micah Bushouse [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 17 December 2002 3:

RE: [PHP] MySQL select a field's first X bytes

2002-12-16 Thread Quentin Bennett
What's wrong with select left(myfield, 500) from mytable; ? Quentin -Original Message- From: Micah Bushouse [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 17 December 2002 3:22 p.m. To: [EMAIL PROTECTED] Subject: [PHP] MySQL select a field's first X bytes Is there a way in MySQL to select

Re: [PHP] mySQL select statement with mulitple where definitions

2002-01-16 Thread mike cullerton
on 1/16/02 11:57 AM, Mike Krisher at [EMAIL PROTECTED] wrote: > someone here has to know the syntax for using multiple items in a where > definition, something like: > > $values = 120106,120095; > $sql = "SELECT * FROM products WHERE catalognumber = $values ORDER BY > price"; > select * from p

RE: [PHP] MySQL: Select ALL

2001-08-09 Thread Karl Phillipson
if(!($result=mysql_db_query("SELECT username FROM users" $db))) { print "Error getting rows"; exit(); } while($row=mysql_fetch_array($result)) { $username=$row["username"]; print "$username"; } mysql_free_result($res

Re: [PHP] MySQL: Select ALL

2001-08-09 Thread Daniel Rezny
Hello Tarrant, Thursday, August 09, 2001, 1:14:25 PM, you wrote: TC> When saying; mysql_query("SELECT username FROM users",$db); it only show's TC> one of the first users in the column "users". TC> Could someone please tell me how to make it print out the complete column TC> list of usernames. I

Re: [PHP] MySQL: Select ALL

2001-08-09 Thread B. van Ouwerkerk
> but no luck. Take a look at one of the tutorials.. Many can be found on the links page you can click to on www.php.net This will help you to find the info you need and also answer the next question you're going to ask. Bye, B. -- PHP General Mailing List (http://www.php.net/) To unsu

RE: [PHP] MySQL Select

2001-05-24 Thread Jon Haworth
] Sent: 23 May 2001 21:28 To: [EMAIL PROTECTED] Subject: Re: [PHP] MySQL Select why not just simply it more while ($r = mysql_fetch_array($result)) { // do your thing here } -- Chris Lee [EMAIL PROTECTED] "Jon Haworth" <[EMAIL PROTECTED]> wrote in message 67DF9B67CEFA

Re: [PHP] MySQL Select

2001-05-23 Thread Chris Lee
why not just simply it more while ($r = mysql_fetch_array($result)) { // do your thing here } -- Chris Lee [EMAIL PROTECTED] "Jon Haworth" <[EMAIL PROTECTED]> wrote in message 67DF9B67CEFAD4119E4200D0B720FA3F53FA57@BOOTROS">news:67DF9B67CEFAD4119E4200D0B720FA3F53FA57@BOOTROS... > So

Re: [PHP] MySQL Select

2001-05-23 Thread Vanessa
Hi This is what I always do... 1. for one row (saved in array $reihe)... $bla = "SELECT * FROM table WHERE id = '$something'''; // db is your database connection $test = mysql_query($bla, $db); // you dont have to use the if...i do that to check if anything was returned if ($r

Re: [PHP] MySQL Select

2001-05-23 Thread Martín Marqués
On Mié 23 May 2001 16:32, you wrote: > ok...sorry to ask a stupid question but > > $result = mysql_query("SELECT jazz FROM funk WHERE foo='bar'") > > but where do you go from there. How would you iterate through the array a > row at a time, doing your thing as you go along? Man, Read The F***

RE: [PHP] MySQL Select

2001-05-23 Thread Jon Haworth
Something like: if ($array_result = mysql_fetch_array($result)) { do { // do your thing here } while ($array_result = mysql_fetch_array($result)); } HTH Jon -Original Message- From: Jamie Thompson [mailto:[EMAIL PROTECTED]] Sent: 23 May 2001 14:33 To: [E

[PHP] Re:[PHP] MySQL Select

2001-05-23 Thread Jon Yaggie
think this is what you want $i = 0; $result = mysql_query("SELECT jazz FROM funk WHERE foo='bar'") while($music = mysql_fetch_array($result)) { $funk_music[$i] = $music[0]; $I++; } ok...sorry to ask a stupid question but $result = mysql_query("SELECT jazz FROM funk WHERE foo='

Re: [PHP] MySQL select rand() with weighting?

2001-05-03 Thread Mark Maggelet
On Thu, 3 May 2001 20:15:26 +0100, James, Yz ([EMAIL PROTECTED]) wrote: >Hi Guys, > >Does anyone know how to select one field randomnly from a MySQL table >against a weighting column in the same row the field is selected >from? > >For example, "SELECT id, url, image FROM table ORDER BY rand() LIMI

Re: [PHP] MySQL SELECT performance suggestions

2001-01-10 Thread Christian Reiniger
On Wednesday 10 January 2001 20:58, [EMAIL PROTECTED] wrote: > I have PHP perform SELECT queries on the table, and I need to display > the results in a format of: "viewing $top to ($top+$depth) of $numrows > found" > > I haven't found a way to determine $numrows without performing a second > SELE

Re: [PHP] MySQL SELECT performance suggestions

2001-01-10 Thread Monte Ohrt
You don't need to select all the data to get the number of rows. Try this: select count(*) as total from products where $product_query; Then use total instead of num_rows. Be sure the elements in your where clause are properly indexed. [EMAIL PROTECTED] wrote: > > Could someone suggest some op

Re: [PHP] MySQL SELECT performance suggestions

2001-01-10 Thread Joe Stump
You can use KEY() which will add extra keys to the table. --Joe On Wed, Jan 10, 2001 at 12:58:37PM -0700, [EMAIL PROTECTED] wrote: > Could someone suggest some options here for performance improvement? > > I have a table with about 300,000 entries/records by 7 columns/fields. All of > the inf