Re: [PHP-DB] SELECT Performance and INDEXing

2005-08-18 Thread Dwight Altman
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

Re: [PHP-DB] SELECT Performance and INDEXing

2005-08-18 Thread Micah Stevens
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

Re: [PHP-DB] SELECT Performance and INDEXing

2005-08-18 Thread Dwight Altman
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

Re: [PHP-DB] SELECT Performance and INDEXing

2005-08-18 Thread Micah Stevens
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 > > > >

Re: [PHP-DB] SELECT Performance and INDEXing

2005-08-18 Thread Dwight Altman
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

Re: [PHP-DB] SELECT Performance and INDEXing

2005-08-10 Thread Dwight Altman
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

[PHP-DB] SELECT Performance and INDEXing

2005-08-10 Thread Dwight Altman
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

Re: [PHP-DB] select * from table where column 'CONTAINS' more than one value (how?)

2005-06-22 Thread Micah Stevens
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

Re: [PHP-DB] select * from table where column 'CONTAINS' more than one value (how?)

2005-06-22 Thread Dan Fulbright
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

Re: [PHP-DB] select * from table where column 'CONTAINS' more than one value (how?)

2005-06-21 Thread Micah Stevens
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

RE: [PHP-DB] select * from table where column 'CONTAINS' more than one value (ho

2005-06-21 Thread Bastien Koert
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

[PHP-DB] select * from table where column 'CONTAINS' more than one value (how?)

2005-06-21 Thread Tramelw
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

RE: [PHP-DB] Select

2005-05-17 Thread Bastien Koert
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

RE: [PHP-DB] Select

2005-05-17 Thread Juffermans, Jos
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.

[PHP-DB] Select

2005-05-16 Thread MIGUEL ANTONIO GUIRAO AGUILAR
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

Re: [PHP-DB] select text from a text file

2005-01-07 Thread Bastien Koert
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

Re: [PHP-DB] select text from a text file

2005-01-07 Thread Ed
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

Re: [PHP-DB] select text from a text file

2005-01-07 Thread Bastien Koert
> 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

Re: [PHP-DB] select text from a text file

2005-01-07 Thread Jochem Maas
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

Re: [PHP-DB] select text from a text file

2005-01-07 Thread Ed
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

Re: [PHP-DB] select text from a text file

2005-01-07 Thread Jochem Maas
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 <

Re: [PHP-DB] select text from a text file

2005-01-07 Thread 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 > > > >

Re: [PHP-DB] select text from a text file

2005-01-06 Thread Andrew Kreps
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

[PHP-DB] select text from a text file

2005-01-05 Thread Ed
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

Fwd: [PHP-DB] select particular columns in query

2004-12-08 Thread Ross Honniball
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

Re: [PHP-DB] select particular columns in query

2004-12-08 Thread Doug Thompson
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

RE: [PHP-DB] select particular columns in query

2004-12-08 Thread Bastien Koert
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

[PHP-DB] select particular columns in query

2004-12-08 Thread blackwater dev
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

[PHP-DB] select command denied to user

2004-09-13 Thread balwantsingh
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

[PHP-DB] select command denied to user

2004-09-10 Thread balwantsingh
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

Re: [PHP-DB] select query across multiple tables

2004-08-26 Thread Cole S. Ashcraft
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, > >

Re: [PHP-DB] select query across multiple tables

2004-08-26 Thread jeffrey_n_Dyke
> 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

[PHP-DB] select query across multiple tables

2004-08-26 Thread Cole S. Ashcraft
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

Re: [PHP-DB] SELECT problem between MySQL 3.23 and MySQL 4

2004-07-02 Thread John W. Holmes
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('

[PHP-DB] SELECT problem between MySQL 3.23 and MySQL 4

2004-07-01 Thread Chris Payne
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

Re[2]: [PHP-DB] Select news based on dates

2004-05-18 Thread Mikhail U. Petrov
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";

Re: [PHP-DB] Select news based on dates

2004-05-17 Thread Daniel Clark
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"];

Re: [PHP-DB] Select news based on dates

2004-05-17 Thread Mikhail U. Petrov
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

Re: [PHP-DB] Select news based on dates

2004-05-17 Thread John W. Holmes
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

RE: [PHP-DB] Select news based on dates

2004-05-17 Thread Angelo Zanetti
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

[PHP-DB] Select news based on dates

2004-05-17 Thread T. H. Grejc
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

RE: [PHP-DB] Select Query--Need help urgently

2004-03-27 Thread Katie Evans-Young
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

RE: [PHP-DB] Select Query--Need help urgently

2004-03-27 Thread Katie Evans-Young
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

Re: [PHP-DB] Select Query--Need help urgently

2004-03-27 Thread Mikhail U. Petrov
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.

[PHP-DB] Select Query--Need help urgently

2004-03-26 Thread irinchiang
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 | ++---

Re: [PHP-DB] SELECT

2004-03-04 Thread Torsten Lange
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

Re: [PHP-DB] SELECT

2004-03-04 Thread peppe
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

Re: [PHP-DB] SELECT

2004-03-04 Thread Ignatius Reilly
?? 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

Re: [PHP-DB] SELECT

2004-03-04 Thread peppe
; ... > 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

Re[2]: [PHP-DB] SELECT

2004-03-04 Thread Richard Davey
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

Re: [PHP-DB] SELECT

2004-03-04 Thread peppe
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

Re: [PHP-DB] SELECT

2004-03-04 Thread Ignatius Reilly
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

Re: [PHP-DB] SELECT

2004-03-04 Thread Richard Davey
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

[PHP-DB] SELECT

2004-03-04 Thread peppe
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

[PHP-DB] select in a object tables

2004-02-17 Thread Sergio
¡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

[PHP-DB] select inside a while loop

2003-11-27 Thread Mike Baerwolf
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

Re: [PHP-DB] SELECT COUNT - result from two tables

2003-11-06 Thread CPT John W. Holmes
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

Re: [PHP-DB] Select Value with 's

2003-11-06 Thread Ignatius Reilly
> > 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

Re: [PHP-DB] Select Value with 's

2003-11-06 Thread CPT John W. Holmes
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

Re: [PHP-DB] Select Value with 's

2003-11-06 Thread pete M
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]

[PHP-DB] SELECT Count - solved

2003-11-05 Thread [EMAIL PROTECTED]
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

Re: [PHP-DB] SELECT COUNT - result from two tables

2003-11-05 Thread Boyan Nedkov
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

Re: [PHP-DB] SELECT COUNT - result from two tables

2003-11-05 Thread John W. Holmes
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

Re: [PHP-DB] SELECT COUNT - result from two tables

2003-11-05 Thread Mark Gordon
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

Re: [PHP-DB] SELECT COUNT - result from two tables

2003-11-05 Thread John W. Holmes
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(*),

[PHP-DB] SELECT COUNT - result from two tables

2003-11-05 Thread Mark Gordon
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,

RE: [PHP-DB] Select Value with 's

2003-11-05 Thread Hutchins, Richard
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

RE: [PHP-DB] Select Value with 's

2003-11-05 Thread Aleks @ USA.net
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

RE: [PHP-DB] Select Value with 's

2003-11-05 Thread Hutchins, Richard
; -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

Re: [PHP-DB] Select Value with 's

2003-11-05 Thread ma
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&#

RE: [PHP-DB] Select Value with 's

2003-11-05 Thread Aleks @ USA.net
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 "

Re: [PHP-DB] Select Value with 's

2003-11-05 Thread ma
.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]>, "'

RE: [PHP-DB] Select Value with 's

2003-11-05 Thread Aleks @ USA.net
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

Re: [PHP-DB] Select Value with 's

2003-11-05 Thread ma
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

RE: [PHP-DB] Select Value with 's

2003-11-05 Thread Aleks @ USA.net
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 &#

Re: [PHP-DB] Select Value with 's

2003-11-05 Thread CPT John W. Holmes
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

RE: [PHP-DB] Select Value with 's

2003-11-05 Thread Aleks @ USA.net
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

Re: [PHP-DB] Select Value with 's

2003-11-05 Thread ma
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

[PHP-DB] Select Value with 's

2003-11-05 Thread Aleks @ USA.net
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,

RE: [PHP-DB] SELECT Part of a Field

2003-08-29 Thread Jacob A. van Zanen
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

Re: [PHP-DB] SELECT Part of a Field

2003-08-29 Thread Ignatius Reilly
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

[PHP-DB] SELECT Part of a Field

2003-08-29 Thread Shaun
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

[PHP-DB] select and comparison of fields,

2003-08-21 Thread Dave [Hawk-Systems]
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

Re: [PHP-DB] SELECT FROM 2 or more tables

2003-08-21 Thread Brent Baisley
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

RE: [PHP-DB] SELECT FROM 2 or more tables

2003-08-20 Thread Ben Lake
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

Re: [PHP-DB] SELECT FROM 2 or more tables

2003-08-20 Thread Brian Dailey
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

RE: [PHP-DB] SELECT FROM 2 or more tables

2003-08-20 Thread Ben Lake
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

Re: [PHP-DB] SELECT FROM 2 or more tables

2003-08-20 Thread Brent Baisley
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

Re: [PHP-DB] SELECT FROM 2 or more tables

2003-08-20 Thread Brian Dailey
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

Re: [PHP-DB] SELECT FROM 2 or more tables

2003-08-20 Thread Jonatan Pugliese.
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

[PHP-DB] SELECT FROM 2 or more tables

2003-08-20 Thread John Ryan
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

Re: [PHP-DB] SELECT question

2003-07-07 Thread Becoming Digital
> 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

[PHP-DB] SELECT question

2003-07-04 Thread Artoo
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

RE: [PHP-DB] Select Statement with output in different colors.

2003-06-17 Thread Christopher Lyon
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

Re: [PHP-DB] Select Statement with output in different colors.

2003-06-17 Thread Becoming Digital
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 =

RE: [PHP-DB] Select Statement with output in different colors.

2003-06-17 Thread Peter Lovatt
} 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

[PHP-DB] Select Statement with output in different colors.

2003-06-17 Thread Christopher Lyon
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

Re: [PHP-DB] Select statement drops 10th digit during table lookup?

2003-06-13 Thread Doug Thompson
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

Re: [PHP-DB] Select statement drops 10th digit during table lookup?

2003-06-13 Thread Ronan Chilvers
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;

Re: [PHP-DB] Select statement drops 10th digit during table lookup?

2003-06-13 Thread Jason Wong
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

<    1   2   3   4   >