key, so I
was wondering if some type of composite index on (field2, field3) would be
better. Then again, any combination with field1 would also be unique.
- Original Message -
From: "Micah Stevens" <[EMAIL PROTECTED]>
To:
Sent: Thursday, August 18, 2005 12:33 PM
ld2 9 const 10 Using where; Using
> filesort
>
>
> - Original Message -
> From: "Micah Stevens" <[EMAIL PROTECTED]>
> To:
> Sent: Thursday, August 18, 2005 9:49 AM
> Subject: Re: [PHP-DB] SELECT Performance and INDEXing
>
> > I think no
evens" <[EMAIL PROTECTED]>
To:
Sent: Thursday, August 18, 2005 9:49 AM
Subject: Re: [PHP-DB] SELECT Performance and INDEXing
I think no one answered it because it doesn't make a whole lot of sense.
Breaking a condition out into a second SQL statement would force the DB to
rescan th
ey "field2 field3" would be unique'
> >
> > - Original Message -
> > From: "Dwight Altman" <[EMAIL PROTECTED]>
> > To:
> > Sent: Wednesday, August 10, 2005 4:23 PM
> > Subject: [PHP-DB] SELECT Performance and INDEXing
> >
> >
be unique'
>
> - Original Message -
> From: "Dwight Altman" <[EMAIL PROTECTED]>
> To:
> Sent: Wednesday, August 10, 2005 4:23 PM
> Subject: [PHP-DB] SELECT Performance and INDEXing
>
>
> I have a MyISAM table holding images with field types
I meant
'Analyze table'
and
'the composite key "field2 field3" would be unique'
- Original Message -
From: "Dwight Altman" <[EMAIL PROTECTED]>
To:
Sent: Wednesday, August 10, 2005 4:23 PM
Subject: [PHP-DB] SELECT Performance and INDEXi
I have a MyISAM table holding images with field types bigint(20), mediumblob,
varchar(255), blob and tinyint(3). The table has grown to over 800 MB and over
6,000 rows. In the past week, performance has been about 15-20 seconds to run
the following select statement which pulls only 16 maximum
On Tuesday 21 June 2005 10:35 pm, Dan Fulbright wrote:
> > I have no problem creating a table, using a query from my dbase table
> > "news":
> >
> > SELECT * FROM table where column = VALUE.
> >
> > However, now that most of our articles have more than one column type
> > (i.e. instead of just
I have no problem creating a table, using a query from my dbase table "news":
SELECT * FROM table where column = VALUE.
However, now that most of our articles have more than one column type (i.e.
instead of just technology, the column can now contain "technology, politics,
local".
You n
You can use LIKE and wildcards, which is faster than fulltext searches, which
will provide you a lot of information you don't need.
Do this:
SELECT * FROM table where column LIKE "%politics%" OR column LIKE "%local%"
to find if the field contains politics or local..
-Micah
On Tuesday 21 J
use full text searches
http://dev.mysql.com/doc/mysql/en/fulltext-search.html
bastien
From: [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] select * from table where column 'CONTAINS' more than one
value (how?)
Date: Tue, 21 Jun 2005 20:49:12 EDT
Hello all,
I have
Hello all,
I have no problem creating a table, using a query from my dbase table "news":
SELECT * FROM table where column = VALUE.
However, now that most of our articles have more than one column type (i.e.
instead of just technology, the column can now contain "technology, politics,
loc
distinc needs a field
select distinct(name) from table
bastien
From: MIGUEL ANTONIO GUIRAO AGUILAR <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] Select
Date: Mon, 16 May 2005 19:26:20 -0700
Hi!!
I have this query in PHP:
$items2 = mysql_query("SELECT DISTINCT * FROM r
edata, rev, andthis FROM rev ORDER BY rev
By the way, having "rev" as a name for your table AND as a fieldname is
confusing and not advisable.
Rgds,
Jos
-Original Message-
From: MIGUEL ANTONIO GUIRAO AGUILAR
[mailto:[EMAIL PROTECTED]
Sent: 17 May 2005 04:26
To: php-db@lists.php.
Hi!!
I have this query in PHP:
$items2 = mysql_query("SELECT DISTINCT * FROM rev ORDER BY rev", $link);
I have three rows with the same data on it, and DISTINCT seems to be not
working, since I got all the rows, any ideas of what is going wrong?
--
MIGUEL GUIRAO AGUILER
read then write, 2 transactions, the second can take place while the user is
reading the content
bastien
From: "Ed" <[EMAIL PROTECTED]>
To: "Bastien Koert" <[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
CC:
Subject: Re: [PHP-DB] select text from a text file
D
7;t seem to find the
answer.
Ed
- Original Message -
From: "Bastien Koert" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc:
Sent: Friday, January 07, 2005 2:06 PM
Subject: Re: [PHP-DB] select text from a text file
> simple, add a
>
To: "Andrew Kreps" <[EMAIL PROTECTED]>
CC:
Subject: Re: [PHP-DB] select text from a text file
Date: Fri, 7 Jan 2005 08:58:18 -
Hi,
Thanks for answering the question.
I'm going to make it write to a database rather than text file after
searching google and coming accros
last grabbed message after you have selected it for output.
have fun!
Ed
- Original Message -
From: "Jochem Maas" <[EMAIL PROTECTED]>
To: "Ed" <[EMAIL PROTECTED]>
Cc:
Sent: Friday, January 07, 2005 11:37 AM
Subject: Re: [PHP-DB] select text from a text file
ginal Message -
From: "Jochem Maas" <[EMAIL PROTECTED]>
To: "Ed" <[EMAIL PROTECTED]>
Cc:
Sent: Friday, January 07, 2005 11:37 AM
Subject: Re: [PHP-DB] select text from a text file
> Ed wrote:
> > Hi,
> >
> > Thanks for answering the questio
eadable 6 months down the line.
Ed
- Original Message -
From: "Andrew Kreps" <[EMAIL PROTECTED]>
To: "Ed" <[EMAIL PROTECTED]>;
Sent: Thursday, January 06, 2005 6:55 PM
Subject: Re: [PHP-DB] select text from a text file
On Wed, 5 Jan 2005 11:58:59 -, Ed <
ent: Thursday, January 06, 2005 6:55 PM
Subject: Re: [PHP-DB] select text from a text file
> On Wed, 5 Jan 2005 11:58:59 -, Ed <[EMAIL PROTECTED]> wrote:
> > Happy new year folks!
> >
> > The titlemight make this seem like an easy to answer question
> >
> >
On Wed, 5 Jan 2005 11:58:59 -, Ed <[EMAIL PROTECTED]> wrote:
> Happy new year folks!
>
> The titlemight make this seem like an easy to answer question
>
> However here's the complicated bit (well for me anyway).
>
> In my text file that is written to by the users in a chatroom it looks like
Happy new year folks!
The titlemight make this seem like an easy to answer question
However here's the complicated bit (well for me anyway).
In my text file that is written to by the users in a chatroom it looks like
this:
nickname||color||what the user is saying||user
how can i make it so th
04 10:46:44 -0500
From: blackwater dev <[EMAIL PROTECTED]>
Reply-To: blackwater dev <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP-DB] select particular columns in query
Hello,
I want to create a new row in the db by copying an existing one. My
db has an auto incrementing id so
The manual is your friend.
You cannot execute the SQL statement you provided because mysql specifically
disallows it:
http://dev.mysql.com/doc/mysql/en/INSERT_SELECT.html
Same reference, your presumption about auto-increment columns is also wrong.
Doug
blackwater dev wrote:
Hello,
I want to create
INSERT INTO `dbname`.`newtablename`
SELECT *
FROM `dname`.`oldtablename` ;
bastien
From: blackwater dev <[EMAIL PROTECTED]>
Reply-To: blackwater dev <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP-DB] select particular columns in query
Date: Wed, 8 Dec 2004 10:46:44 -0500
Hell
Hello,
I want to create a new row in the db by copying an existing one. My
db has an auto incrementing id so I can't simply do insert into cars
select * from cars where id=$id as this throws the primary key error.
How can I do this with out specifying each column?
Thanks!
--
PHP Database Mail
pls. help.
i have grant all to one of my tables made in mysql. now when i want to
retrieve the data through PHP, following error is coming
=
select command denied to user: '[EMAIL PROTECTED]' for table
'timeframe'
=
pls. advise what went wrong.
with best wishes
balwant
--
PHP D
pls. help.
i have grant all to one of my tables made in mysql. now when i want to
retrieve the data through PHP, following error is coming
=
select command denied to user: '[EMAIL PROTECTED]' for table
'timeframe'
=
pls. advise what went wrong.
with best wishes
balwant
--
PHP D
Thanks!
It works
Cole
On Thu, 2004-08-26 at 16:45, [EMAIL PROTECTED] wrote:
> > I'm trying to pull all the records from the table class where classID is
> > not equal to the value of classID in the table assignment.
>
> > Currently, I have 'select class.classID, class.classDesc from class,
> >
> I'm trying to pull all the records from the table class where classID is
> not equal to the value of classID in the table assignment.
> Currently, I have 'select class.classID, class.classDesc from class,
> assignment where assignment.classID >= class.classID and
> assignment.assignmentID=$ass
I'm trying to pull all the records from the table class where classID is
not equal to the value of classID in the table assignment.
Currently, I have 'select class.classID, class.classDesc from class,
assignment where assignment.classID >= class.classID and
assignment.assignmentID=$assidn'. $as
Chris Payne wrote:
> I'm using Booleans in my searches (New to it) but it works perfectly
on my
local 3.23 version of MySQL, but on the main server which uses version 4 of
MySQL I get an error so there's an error in my Syntax. Here's what I
currently use:
[snip]
LENGTH(REPLACE(LOWER(def),LOWER('
Hi there everyone,
I'm using Booleans in my searches (New to it) but it works perfectly on my
local 3.23 version of MySQL, but on the main server which uses version 4 of
MySQL I get an error so there's an error in my Syntax. Here's what I
currently use:
SELECT id, def, word,
0.2*(
LENGTH
Hi!
"text" is of no importance.
I work only with "date".
If it's useful, nobody can prohibit that for you.
Monday, May 17, 2004, 10:43:43 PM, Daniel wrote:
DC> ORDER BY date, text ?
>> Hi!
>> You can use "order by date" and such method:
>>
>> $result = mysql_query(blablabla);
>> $date = "foo";
ORDER BY date, text ?
> Hi!
> You can use "order by date" and such method:
>
> $result = mysql_query(blablabla);
> $date = "foo";
> while($news = mysql_fetch_array($result)){
> if ($date==$news["date"]){
> echo "new date";
> }
> echo $news["text"];
> $date = $news["date"];
Hi!
You can use "order by date" and such method:
$result = mysql_query(blablabla);
$date = "foo";
while($news = mysql_fetch_array($result)){
if ($date==$news["date"]){
echo "new date";
}
echo $news["text"];
$date = $news["date"];
}
Monday, May 17, 2004, 3:50:04 PM, T. wro
From: "T. H. Grejc" <[EMAIL PROTECTED]>
> I would like to display my news like this:
>
> *10.04.2004.*
> - news 1
> - news 2
> - news 3
> *14.04.2004.*
> - news 4
> *15.04.2004.*
> - news 5
> ...
>
> I'm thinking of some while loop but I'm not sure that it will work nor I
> know how to create t
Message-
From: T. H. Grejc [mailto:[EMAIL PROTECTED]
Sent: Monday, May 17, 2004 1:50 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Select news based on dates
Hello,
I would like to display my news like this:
*10.04.2004.*
- news 1
- news 2
- news 3
*14.04.2004.*
- news 4
*15.04.2004.*
- news 5
Hello,
I would like to display my news like this:
*10.04.2004.*
- news 1
- news 2
- news 3
*14.04.2004.*
- news 4
*15.04.2004.*
- news 5
...
I'm thinking of some while loop but I'm not sure that it will work nor I
know how to create that query.
TNX
--
PHP Database Mailing List (http://www.php.net
Irin said:
> $sql = mysql_query("SELECT * FROM class where timetable_day='Monday'");
Oops, I see that he DID do a mysql_query and save the result resource in
$sql. Sorry, guys! I haven't had my coffee yet this morning!
Katie Dewees
Web Developer
E-mail: [EMAIL PROTECTED]
--
PHP Database Mailing
Irin said:
> $sql = mysql_query("SELECT * FROM class where timetable_day='Monday'");
>
> $row = mysql_fetch_array($sql);
> $result = $db->query($sql);
> $numofrows = mysql_num_rows($sql);
>From the PHP manual:
array mysql_fetch_array ( resource result [, int result_type])
You can't send the func
Hi!
Hello irinchiang,
Saturday, March 27, 2004, 8:52:51 AM, you wrote:
ijc> Hi all,
ijc> But I was unable to retrieve the values from database. Was it because I have
ijc> written the SELECT query wrongly??
ijc> Realli need some help urgently..Hope to hear from all soon. Thanks in advance.
Hi all,
I am having having a slight problem with SELECT query statement.
I have a table "Class". The table are as follow:
++--+--+-+-++
| Field | Type | Null | Key | Default | Extra |
++---
peppe schrieb:
for ($row =1; $row <= $numRows; $row++) {
$rowArray = mysql_fetch_array($result);
$access1 = $rowArray[1];
Hi Peppe,
although I don't know the function mysql_fetch_array()...
why you use $rowArray[1], which is the first element (if $rowArray is of
type array). c
2"?
>
> _
> - Original Message -
> From: "peppe" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, March 04, 2004 13:22
> Subject: Re: [PHP-DB] SELECT
>
>
> > Hi
> > I made
??
Didn't you say that $access[1] contains sets such as "1,2,3,4,7,8"?
Why compare it to "2"?
_
- Original Message -
From: "peppe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 04, 2004 13:22
Sub
; ...
> FROM users
> WHERE FIND_IN_SET( 2, values ) > 0
>
> Ignatius
> _
> - Original Message -
> From: "peppe" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, March 04, 2004 12:28
> Subject: [PHP-DB] SEL
Hello peppe,
Thursday, March 4, 2004, 12:02:40 PM, you wrote:
p> The problem is in access values are like string 1,2,3,4,5
Sorry, I didn't realise that. In this case FIND_IN_SET (which I think
Ignatius suggested too).
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html
The problem is in access values are like string 1,2,3,4,5
"Richard Davey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello peppe,
>
> Thursday, March 4, 2004, 11:28:30 AM, you wrote:
>
> p> Hi I have a table users with columns name email and access
> p> In email I have values [E
SELECT
...
FROM users
WHERE FIND_IN_SET( 2, values ) > 0
Ignatius
_
- Original Message -
From: "peppe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 04, 2004 12:28
Subject: [PHP-DB] SELECT
> Hi I have a table users
Hello peppe,
Thursday, March 4, 2004, 11:28:30 AM, you wrote:
p> Hi I have a table users with columns name email and access
p> In email I have values [EMAIL PROTECTED] etc in access I have values 1,2,3,4,7,8
p> How can I filter value 2 ?
p> Beacause I need only users with value 2 to send email
Hi I have a table users with columns name email and access
In email I have values [EMAIL PROTECTED] etc in access I have values 1,2,3,4,7,8
How can I filter value 2 ?
Beacause I need only users with value 2 to send email
Greetings
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe
¡Hi all!
I have a problem and I don't find the solution, my problem is when I
try to do a select on a object table, it returns '*Warning*: Ora_Parse
failed (ORA-00911: carácter no válido -- while processing OCI function
OPARSE)'
I'm working with this code in pl/sql :
create Type TArtPrueba
Hello,
I have two mysql tables songs and artists. They look like this:
CREATE TABLE `artists` (
`artist_id` int(10) unsigned NOT NULL auto_increment,
`artist_name` varchar(100) default NULL,
`artist_img` varchar(50) default NULL,
PRIMARY KEY (`artist_id`),
UNIQUE KEY `artist_name` (`ar
From: "Boyan Nedkov" <[EMAIL PROTECTED]>
> Putting more than one table in the FROM clause means tables are joined,
> then at least following problems could arise:
>
> - using WHERE clause you can have empty recordset returned and then
> COUNT conflicts with it because there is actually no any data
> > hth?
> >
> > _ma
> >
> > # life would be easier if i knew the source code...
> >
> >
> >>Von: "Aleks @ USA.net" <[EMAIL PROTECTED]>
> >>Datum: Wed, 5 Nov 2003 13:12:45 -0500
> >>An: <[EMAIL PROTECTE
From: "pete M" <[EMAIL PROTECTED]>
> > do not quite understand your problem.. pls post some code?
> > heres a small snippet that should work well...
> >
> > $qry = 'SELECT `customer` FROM `customerList` ORDER BY `customer`';
> > $res = mysql_query($qry);
> > while($customer = mysql_fetch_object($re
tch_object($res)) {
echo stripslashes($res->customer).''."\n";
}
hth?
_ma
# life would be easier if i knew the source code...
Von: "Aleks @ USA.net" <[EMAIL PROTECTED]>
Datum: Wed, 5 Nov 2003 13:12:45 -0500
An: <[EMAIL PROTECTED]>
Betreff: [PHP-DB]
Thanks for the debug advice - I will start using my_sql_error
First I got this error:
Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if
there is no GROUP BY clause
So the correct code ended up:
$sql = "SELECT COUNT(bandid), genre
FROM bands, genre
GROUP BY ge
Putting more than one table in the FROM clause means tables are joined,
then at least following problems could arise:
- using WHERE clause you can have empty recordset returned and then
COUNT conflicts with it because there is actually no any data to be
returned;
- joining two (or more) tables
Mark Gordon wrote:
Yes, query is definitely working without COUNT(*). Even in the most stripped down form, the query fails:
$sql = "SELECT COUNT(bandid), genre
FROM bands, genre";
$result=mysql_query($sql);
while ($gen=mysql_fetch_row($result)) {
echo $gen[1];
}
Fails how? If it echos zero, it's
Yes, query is definitely working without COUNT(*). Even in the most stripped down
form, the query fails:
$sql = "SELECT COUNT(bandid), genre
FROM bands, genre";
$result=mysql_query($sql);
while ($gen=mysql_fetch_row($result)) {
echo $gen[1];
}
"John W. Holmes" <[EMAIL PROTECTED]> wrote:
Mark G
Mark Gordon wrote:
I cannot seem to get a SELECT COUNT for a query from fields in two different tables and a WHERE clause. Does anyone know if this is not possible with php/mysql or am I doing something wrong? I have tried a number of variations on the following code:
$sql = "SELECT COUNT(*),
I cannot seem to get a SELECT COUNT for a query from fields in two different tables
and a WHERE clause. Does anyone know if this is not possible with php/mysql or am I
doing something wrong? I have tried a number of variations on the following code:
$sql = "SELECT COUNT(*), bandid, bandname,
You are most welcome, Aleks. Glad it helped.
> -Original Message-
> From: Aleks @ USA.net [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 05, 2003 3:01 PM
> To: 'Hutchins, Richard'; 'PHP-DB'
> Subject: RE: [PHP-DB] Select Value with 's
riginal Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 2:52 PM
To: PHP-DB
Subject: RE: [PHP-DB] Select Value with 's
Using your variables and query, the following, based on one of my own
functional pages, the following should work:
$FF = a
; -Original Message-
> From: ma [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 05, 2003 2:29 PM
> To: PHP-DB
> Subject: Re: [PHP-DB] Select Value with 's
>
>
> hi
>
> hm - it would help if you'd send us the code where you
> generate the query
PROTECTED]>, "'PHP-DB'" <[EMAIL PROTECTED]>
> Betreff: RE: [PHP-DB] Select Value with 's
>
> Tried both... Still no joy...
>
> The statement becomes
> $info = mysql_query('Select * From customer Where customer.customer LIKE St
> Mary
27;] is confusing it
-Original Message-
From: ma [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 2:07 PM
To: PHP-DB
Subject: Re: [PHP-DB] Select Value with 's
hi
ok - than make it this way:
$info = mysql_query( Select * From customer Where customer.customer LIKE "
.customer LIKE
"'.$FF.'"');
_ma
# life would be easier if i knew the source code...
> Von: "Aleks @ USA.net" <[EMAIL PROTECTED]>
> Datum: Wed, 5 Nov 2003 14:01:37 -0500
> An: "'ma'" <[EMAIL PROTECTED]>, "'
Sorry I left out the exact form
It is
$info = mysql_query( Select * From customer Where customer.customer LIKE 'St
Mary's Hospital');
-Original Message-
From: ma [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 1:56 PM
To: PHP-DB
Subject: Re: [PHP-D
et" <[EMAIL PROTECTED]>
> Datum: Wed, 5 Nov 2003 13:52:51 -0500
> An: "'CPT John W. Holmes'" <[EMAIL PROTECTED]>, "'ma'"
> <[EMAIL PROTECTED]>, "'PHP-DB'" <[EMAIL PROTECTED]>
> Betreff: RE: [PHP-DB
rning mysql_fetch_array(): supplied argument is not a valid MySQL result
-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 1:45 PM
To: Aleks @ USA.net; 'ma'; 'PHP-DB'
Subject: Re: [PHP-DB] Select Value with
From: "Aleks @ USA.net" <[EMAIL PROTECTED]>
> First I build my select list:
>
>
> All Customers
>
> While ($Site = mysql_fetch_array($S))
> {
> $Sid = $Site["CID"];
> $SName = htmlspecialchars($Site["Customer"]);
> echo("$SName\n");
Easy fix: echo("$SName\n");
Long version:
htm
lue I get on the Result.php page is St Mary
-Original Message-
From: ma [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 1:18 PM
To: PHP-DB
Subject: Re: [PHP-DB] Select Value with 's
hi!
do not quite understand your problem.. pls post some code?
heres a small snippet that sho
tomer).''."\n";
}
hth?
_ma
# life would be easier if i knew the source code...
> Von: "Aleks @ USA.net" <[EMAIL PROTECTED]>
> Datum: Wed, 5 Nov 2003 13:12:45 -0500
> An: <[EMAIL PROTECTED]>
> Betreff: [PHP-DB] Select Value with 's
>
&g
This is a basic question but I am all messed up and need to be straightened
out..
Have a select field called customer that works great except when there is a
' in the customer name.
Have tried addslash and stripslashes but I think I might be using them
wrong.
If I addslash to the select value,
Depending on the database you are using
Substring()
Substr()
Functions do what you want
jack
-Original Message-
From: Shaun [mailto:[EMAIL PROTECTED]
Sent: Friday, August 29, 2003 11:58 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] SELECT Part of a Field
Hi,
How can I SELECT a
SUBSTRING()
_
- Original Message -
From: "Shaun" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 29, 2003 11:57 AM
Subject: [PHP-DB] SELECT Part of a Field
> Hi,
>
> How can I SELECT a portion of a field i
Hi,
How can I SELECT a portion of a field in a table for example the first
character, or the second two characters etc?
Thanks for your help
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
looking for a better way to query and cehck for overlapping timeframes.
am selecting records for display that has 3 fields of importance;
date_time (unix timestamp)
session_time (in seconds)
user_id (text field)
Of all the sessions recorded, we are looking for a count
003 3:04 PM
To: John Ryan
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] SELECT FROM 2 or more tables
A join merges every record in one table with every record in another
table, which is something you rarely want to do. So you want to set a
filter on the merged records, which can be anything, but is usua
Hehe, ok, that was bad there for a second :)
Ben
-Original Message-
From: Brian Dailey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 3:24 PM
To: Ben Lake; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] SELECT FROM 2 or more tables
No, he meant rarely want to join entire tables
al Message-
From: Brent Baisley [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 3:04 PM
To: John Ryan
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] SELECT FROM 2 or more tables
A join merges every record in one table with every record in another
table, which is something you rarely wan
Rarely want to do joins? That's a new one.
Ben
-Original Message-
From: Brent Baisley [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 3:04 PM
To: John Ryan
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] SELECT FROM 2 or more tables
A join merges every record in one table
A join merges every record in one table with every record in another
table, which is something you rarely want to do. So you want to set a
filter on the merged records, which can be anything, but is usually a
match between a field in one table and a field in another table.
That's a join in two
John,
It sounds like you need to read basic documentation on combining SQL queries.
Basically, you need to have a column that is common across both tables.
Eg., in TABLE1 have a column named TABLE1ID. Have the same ID cross referenced in TABLE2.
The ID would be sequenced in some way (auto_incre
select t1.name,t2.salary from personal t1,sal t2
where t1.id=t2.id;
- Original Message -
From: "John Ryan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 20, 2003 4:41 PM
Subject: [PHP-DB] SELECT FROM 2 or more tables
> Is it easy?? Is it
Is it easy?? Is it possible?? Should I just run 2 different queries and
output their results in the PHP script and make it look like it's all from
the same table
I cant grasp JOIN for the life of me
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/un
>
To: <[EMAIL PROTECTED]>
Sent: Friday, 04 July, 2003 12:08
Subject: [PHP-DB] SELECT question
What is the syntax for running a SELECT command with multiple conditions?
Example SELECT * FROM members WHERE user_id='$u_id' AND email='$email';
Thanks
--
PHP Data
What is the syntax for running a SELECT command with multiple conditions?
Example SELECT * FROM members WHERE user_id='$u_id' AND email='$email';
Thanks
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
t: Tuesday, June 17, 2003 9:51 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Select Statement with output in different
colors.
>
> Here's a slight alteration to Peter's code in "case" someone isn't
> familiar with
> switch statements. Ooh, such a bad pu
om
- Original Message -
From: "Peter Lovatt" <[EMAIL PROTECTED]>
To: "Christopher Lyon" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, 17 June, 2003 17:42
Subject: RE: [PHP-DB] Select Statement with output in different colors.
Try this
$query =
}
print '
da da da
';
}// end while
HTH
Peter
-Original Message-
From: Christopher Lyon [mailto:[EMAIL PROTECTED]
Sent: 17 June 2003 22:35
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Select Statement with output in different colors.
I
I have a php script that does some select statements, on mysql, and
outputs that to a table. I would like to change the color of the table
row depending upon one of the fields. The select statements are from a
syslog database that I have and I would like to highlight key events by
changing the colo
Why not use the built-in conversion functions in mysql?
>From the manual:
INET_NTOA(expr)
Given a numeric network address (4 or 8 byte), returns the dotted-quad representation
of the address as a string:
mysql> SELECT INET_NTOA(3520061480);
-> "209.207.224.40"
INET_ATON(expr)
Given t
Here's how I did it when playing with this...
Table definition:-
CREATE TABLE ip_list (
ip_from double default NULL,
ip_to double default NULL,
country_code char(2) default NULL,
country_name varchar(100) default NULL,
KEY ip_from (ip_from,ip_to,country_code,country_name)
) TYPE=MyISAM;
On Friday 13 June 2003 15:48, G & E Holt wrote:
> I hope this is something easy I am overlooking but here goes:
>
> I have a table called: country which has the following fields:
>
> FieldType
> ip_from double(11,0)
> ip_todouble(11,0)
> country_cod
101 - 200 of 349 matches
Mail list logo