[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 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: php-db@lists.php.net Sent: Wednesday, August 10, 2005 4:23 PM Subject: [PHP-DB] SELECT Performance and INDEXing I have a MyISAM table holding

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 need

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 technology, the

[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,

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 no problem

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 June

RE: [PHP-DB] Select

2005-05-17 Thread Juffermans, Jos
, 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.net Subject: [PHP-DB

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 rev ORDER BY rev

[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 AGUILERA

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

2005-01-07 Thread Ed
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 However here's the complicated bit (well for me anyway). In my text file

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

2005-01-07 Thread Jochem Maas
Message - From: Andrew Kreps [EMAIL PROTECTED] To: Ed [EMAIL PROTECTED]; php-db@lists.php.net 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 [EMAIL PROTECTED] wrote: Happy new year folks! The titlemight make

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

2005-01-07 Thread Ed
Message - From: Jochem Maas [EMAIL PROTECTED] To: Ed [EMAIL PROTECTED] Cc: php-db@lists.php.net 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 question. I'm going to make it write to a database rather

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

2005-01-07 Thread Jochem Maas
grabbed message after you have selected it for output. have fun! Ed - Original Message - From: Jochem Maas [EMAIL PROTECTED] To: Ed [EMAIL PROTECTED] Cc: php-db@lists.php.net Sent: Friday, January 07, 2005 11:37 AM Subject: Re: [PHP-DB] select text from a text file Ed wrote: Hi, Thanks

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

2005-01-07 Thread Bastien Koert
PROTECTED] CC: php-db@lists.php.net 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 accross common problems with text files. I've

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

2005-01-07 Thread Ed
the answer. Ed - Original Message - From: Bastien Koert [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: php-db@lists.php.net Sent: Friday, January 07, 2005 2:06 PM Subject: Re: [PHP-DB] select text from a text file simple, add a 'read flag' column to the table, when

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 this:

[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

[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

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 Hello, I want

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

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

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

[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

[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

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

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=$assidn'.

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 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]

[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*(

[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

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 that query.

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: code $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. wrote:

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: code $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

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 function

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

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

[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

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

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 with columns name email and access

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 [EMAIL

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
_ - 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 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

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 Subject: Re: [PHP-DB] SELECT Hi I made this query $sql

Re: [PHP-DB] SELECT

2004-03-04 Thread peppe
- From: peppe [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 04, 2004 13:22 Subject: Re: [PHP-DB] SELECT Hi I made this query $sql= SELECT * FROM users WHERE FIND_IN_SET( 2, access ) 0 ; $result = mysql_query($sql); $numRows = mysql_num_rows($result

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).

[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`

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

2003-11-06 Thread pete M
($res)) { echo stripslashes($res-customer).'br'.\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 This is a basic question but I am all

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($res)) {

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

2003-11-06 Thread Ignatius Reilly
); while($customer = mysql_fetch_object($res)) { echo stripslashes($res-customer).'br'.\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

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 to be

[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

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

2003-11-05 Thread ma
; } 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 This is a basic question but I am all messed up and need to be straightened out

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

2003-11-05 Thread Aleks @ USA.net
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 should work well... $qry = 'SELECT `customer` FROM `customerList` ORDER BY `customer`'; $res = mysql_query($qry); while($customer = mysql_fetch_object($res

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: SELECT NAME=Cid size=1 OPTION Selected VALUE=All Customers/OPTION ? While ($Site = mysql_fetch_array($S)) { $Sid = $Site[CID]; $SName = htmlspecialchars($Site[Customer]); echo(option

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

2003-11-05 Thread Aleks @ USA.net
(): 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 's From: Aleks @ USA.net [EMAIL PROTECTED

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

2003-11-05 Thread ma
-0500 An: 'CPT John W. Holmes' [EMAIL PROTECTED], 'ma' [EMAIL PROTECTED], 'PHP-DB' [EMAIL PROTECTED] Betreff: RE: [PHP-DB] Select Value with 's Thanks John for the answer But... Now my select statement on the Result.php page errors out when The value has the [']in it. What

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-DB] Select Value

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

2003-11-05 Thread ma
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], 'PHP-DB' [EMAIL PROTECTED] Betreff: RE: [PHP-DB] Select Value with 's Sorry I left out the exact form It is $info = mysql_query( Select

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

2003-11-05 Thread Aleks @ USA.net
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 St Mary's Hospital); anyways - shouldn't

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

2003-11-05 Thread ma
['] 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 St

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

2003-11-05 Thread Hutchins, Richard
- 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 _ma # life would be easier if i knew the source code... Von: Aleks

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

2003-11-05 Thread Aleks @ USA.net
- 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 = addslashes($_POST[Cid

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 BINGO Thanks Rich... I just realized were I

[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 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(*),

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 Gordon

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 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)

[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

[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

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 in a table for example the first character

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

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

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

[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

[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:

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 possible?? Should I just run 2

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

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
: 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 want to do. So you want

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 question

2003-07-07 Thread Becoming Digital
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 Database Mailing List (http://www.php.net

[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

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

2003-06-17 Thread Peter Lovatt
/tr'; }// 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 have a php script that does some

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

2003-06-17 Thread Becoming Digital
.' tdda da da nbsp;/td /tr'; }// end while ? Edward Dudlik Becoming Digital www.becomingdigital.com - 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

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

2003-06-17 Thread Christopher Lyon
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 pun, as if there's any other kind. ? $query = 'SELECT * FROM table

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

2003-06-13 Thread G E Holt
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_code char(2) country_name varchar(50) IP_FROM

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

2003-06-13 Thread Ronan Chilvers
On 13 Jun,2003 at 0:48 G E Holt wrote: $resolved=$DB_site-query_first(SELECT * FROM country WHERE '$resolvingip' BETWEEN ip_from AND ip_to); Don't think you should have the '' around the ip number. Does that help? Ronan e: [EMAIL PROTECTED] t: 01903 739 997 w: www.thelittledot.com The

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_code

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) )

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: quote 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

RE: [PHP-DB] SELECT * FROM Command

2003-03-19 Thread Snijders, Mark
be unlawful. -Original Message- From: Michelle Whelan [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: woensdag 19 maart 2003 9:06 To: [EMAIL PROTECTED] Subject: [PHP-DB] SELECT * FROM Command Hi, I have a question about how to display results. I am using PHP

RE: [PHP-DB] SELECT * FROM Command

2003-03-19 Thread Hutchins, Richard
: [PHP-DB] SELECT * FROM Command guess it is hard to answer this with so less information first show us how the table defenition is... how it is build up and then which fields you want to show to the user! then I or others can help you much more

[PHP-DB] SELECT * FROM Command *REVISED*

2003-03-19 Thread Michelle Whelan
-Ok, this is what I have. I hope this is what you are looking for. I'm looking to format this search results page so that the results come back with the entire entry that also matches the zipcode that was searched. ex: zipcode search = 90210 results for 90210 are: contactname phone

RE: [PHP-DB] SELECT * FROM Command *REVISED*

2003-03-19 Thread Gary . Every
: Wednesday, March 19, 2003 1:04 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] SELECT * FROM Command *REVISED* -Ok, this is what I have. I hope this is what you are looking for. I'm looking to format this search results page so that the results come back with the entire entry that also

Re: [PHP-DB] SELECT * FROM Command *REVISED*

2003-03-19 Thread Mark
--- Michelle Whelan [EMAIL PROTECTED] wrote: -Ok, this is what I have. I hope this is what you are looking for. I'm looking to format this search results page so that the results come back with the entire entry that also matches the zipcode that was searched. ex: zipcode search =

Re: [PHP-DB] select

2003-02-03 Thread Maxim Maletsky
Yes, option value=? echo $row-id; ? ? echo $selected; ? selected You've hardcoded selected there and also expect it to be set dynamically. -- Maxim Maletsky [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] select from multi tables

2003-02-03 Thread Griffiths, Daniel
Hi All, I have a situation where I need to get data from more than one table, but where the fields in the table are identical, the two tables are holding data for different years. The queries I would like to execute would be something along the lines of this: - SELECT SUM(T1.F1) AS C1,

[PHP-DB] select

2003-02-02 Thread Addison Ellis
hi and thank you, is there a reason this will not work? i am trying to echo an option that has already been selected in a list menu. best, addison select name=property ? $obj = mysql_db_query($dbname,select * from ads where id=$id;); while($row =

Re: [PHP-DB] SELECT problem

2003-01-17 Thread Larry E. Ullman
    Hello PHP world!!! i've just finisched installing Apache 1.3.27 with PHP4 and 1.4 in Windows 2000. I've installed all off the scripts that function all right in Linux Red Hat in Windows 2000, but when it comes to do a simple select to a table that does exist and the select is all right

<    1   2   3   4   >