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 |
> +---+-+-
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
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).
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
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:
[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
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
> 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
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
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
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
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
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
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
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
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
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)
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
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
> 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."%'":
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=(
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
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
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
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
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
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
> 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
]
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
[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
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
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***
: [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
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='
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
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
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
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
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
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
***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
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
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
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
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
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
46 matches
Mail list logo