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] MySQL select matching

2010-07-19 Thread Ashley M. Kirchner
I may be going at this completely wrong but at the moment I'm stuck. I have a DB from a client and need to do several searches on it. This one sentence is important because it's their DB, not mine. So I can't modify the way the DB was created in the first place, I can only work with wh

[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

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

2009-11-16 Thread Allen McCabe
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 their contents. For example:

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

[PHP] mysql select statement in php having three conditions

2005-12-16 Thread sunaram patir
hi, 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 did t

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

[PHP] mysql select and date functions

2003-02-18 Thread Sunfire
i have a field in a table called Posted and it is a timestamp type im using mysql and my page is supposed to take the timestamp field and show it on the screen in the form of month#/dayofmonth/year like 02/18/2003 the problem im having is trying to get it to be formatted.. i tried mysql functions l

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

[PHP] Mysql Select

2003-02-09 Thread andraskende
Hello, Can anyone help me with this simple query: I want to limit to 1 the same names returned from the query like: FROM: SELECT gallery.design FROM gallery buffet buffet buffet buffet barstools barstools barstools barstools barstools barstools barstools barstools tables tabl

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

2002-12-16 Thread Micah Bushouse
uesday, 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 a fields first X bytes? I have a field of type text. I would like to print the first 500 or so bytes of its contents as a summary of the entire fi

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 i

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

2002-12-16 Thread Micah Bushouse
Is there a way in MySQL to select a fields first X bytes? I have a field of type text. I would like to print the first 500 or so bytes of its contents as a summary of the entire field, then having the user click "read more..." or something of that sort for the whole document. I read up on select

Re: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-22 Thread Marek Kilimajer
if one of $titulotxt or $cdstxt is not set, your query will look something like this: SELECT * FROM divx WHERE && cds like '$cdstxt' ORDER BY titulo As you see, there is unnecessery &&. I build my search queries using this form: $query_cond=''; foreach($_GET as $col => $val) { switch($col)

Re: [PHP] Newbie: php/mysql (Select)

2002-11-20 Thread Ernest E Vogelsinger
At 20:23 20.11.2002, Mr. BuNgL3 said: [snip] >Hi... >I'm with a little sintax problem... >The question is that i have two search fields (titulotxt and cdstxt) and i >want to create an mysql condition... i trying: > > $sql1=($titulotxt) ? "titulo like '%".$tit

RE: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread Van Andel, Robert
need the two statements listed above and then put into your actual sql statement. Robbert van Andel -Original Message- From: Mr. BuNgL3 [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 11:54 AM To: [EMAIL PROTECTED] Subject: [PHP] Newbie: PHP/MySQL (SELECT) Hi... I'm

Re: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread DL Neil
> On Thursday 21 November 2002 03:53, Mr. BuNgL3 wrote: > > Hi... > > I'm with a little sintax problem... > > The question is that i have two search fields (titulotxt and cdstxt) and i > > want to create an mysql condition... i trying: > > > > $sql1=($titulotxt) ? "titulo like '%".$titulotxt."%'":

Re: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread Jason Wong
On Thursday 21 November 2002 03:53, Mr. BuNgL3 wrote: > Hi... > I'm with a little sintax problem... > The question is that i have two search fields (titulotxt and cdstxt) and i > want to create an mysql condition... i trying: > > $sql1=($titulotxt) ? "titulo like '%".$titulotxt."%'":""; > $sql2=(

[PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread Mr. BuNgL3
Hi... I'm with a little sintax problem... The question is that i have two search fields (titulotxt and cdstxt) and i want to create an mysql condition... i trying: $sql1=($titulotxt) ? "titulo like '%".$titulotxt."%'":""; $sql2=($cdstxt) ? "cds like '$cdstxt'":""; $sql="SELECT * FROM divx WHERE

[PHP] Newbie: php/mysql (Select)

2002-11-20 Thread Mr. BuNgL3
Hi... I'm with a little sintax problem... The question is that i have two search fields (titulotxt and cdstxt) and i want to create an mysql condition... i trying: $sql1=($titulotxt) ? "titulo like '%".$titulotxt."%'":""; $sql2=($cdstxt) ? "cds like '$cdstxt'":""; $sql="SELECT * FROM divx WHERE

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

[PHP] mySQL select statement with mulitple where definitions

2002-01-16 Thread Mike Krisher
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"; Does this make sense, » Michael Krisher [EMAIL PROTECTED] -- PHP General Mailing List (h

RE: [PHP] MySQL: Select ALL

2001-08-09 Thread Karl Phillipson
L PROTECTED]] Sent: 09 August 2001 12:14 To: '[EMAIL PROTECTED]' Subject: [PHP] MySQL: Select ALL When saying; mysql_query("SELECT username FROM users",$db); it only show's one of the first users in the column "users". Could someone please tell me how to make i

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
[mailto:[EMAIL PROTECTED]] > Sent: 23 May 2001 14:33 > To: [EMAIL PROTECTED] > Subject: [PHP] MySQL Select > > > ok...sorry to ask a stupid question but > > $result = mysql_query("SELECT jazz FROM funk WHERE foo='bar'") > > but where do you go

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
: [EMAIL PROTECTED] Subject: [PHP] MySQL Select 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 al

[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='

[PHP] MySQL Select

2001-05-23 Thread Jamie Thompson
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? thanks, jamie -- PHP General Mailing List (http://www.php.net

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

[PHP] MySQL select rand() with weighting?

2001-05-03 Thread James, Yz
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() LIMIT 1". And have a column like "weighting" where values between 1 and 100 ar

Re: [PHP] php/mySql SELECT where clause using dates.

2001-05-03 Thread Pierre-Yves Lemaire
Hello, maybe this could help, WHERE TO_DAYS( NOW()) - TO_DAYS( your_date_field ) <= 45 py At 04:30 PM 5/3/01 +0200, you wrote: >***NEWBIE ALERT*** (I am only very new at this) > >PHP and MySQL > >OK - I have a table with data and one of the fields is a Date field. > >Now I would like to SELEC

Re: [PHP] php/mySql SELECT where clause using dates. ooops

2001-05-03 Thread Jon Rosenberg
kildsen" <[EMAIL PROTECTED]> Cc: "PHP General List" <[EMAIL PROTECTED]> Sent: Thursday, May 03, 2001 10:28 AM Subject: Re: [PHP] php/mySql SELECT where clause using dates. > Take out the order by clause or chaqnge it. You can't order by a column you > a

Re: [PHP] php/mySql SELECT where clause using dates.

2001-05-03 Thread Jon Rosenberg
Take out the order by clause or chaqnge it. You can't order by a column you aren't selecting. - Original Message - From: "Dan Eskildsen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 03, 2001 10:30 AM Subject: [PHP] php/mySql

[PHP] php/mySql SELECT where clause using dates.

2001-05-03 Thread Dan Eskildsen
***NEWBIE ALERT*** (I am only very new at this) PHP and MySQL OK - I have a table with data and one of the fields is a Date field. Now I would like to SELECT all records where the date is less that 45 days old. Eh, How do I do that? I have tried this: #Declaring variables $today=date("Y-m-d

[PHP] mySQL - select column

2001-04-17 Thread Julian Wood
Hi all, Given that the resultset from a mysql query is a 2-d array (of sorts - I don't know), if I retrieve only a single column, is there an easy way to grab it as a linear array? For example - old way: $uids=array(); $res = mysql_db_query("db", 'select uid from tbl;', $link); while ($row = my

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

[PHP] MySQL SELECT performance suggestions

2001-01-10 Thread webbie
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 information varies from entry, but only one field can be declared as UNIQUE. I have PHP perform SELECT queries on the table, and I need to disp