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: [PHP-DB] SELECT

2004-03-04 Thread peppe
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); for ($row =1; $row = $numRows; $row++) { $rowArray = mysql_fetch_array($result); $access1 = $rowArray[1]; if

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

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

2003-11-06 Thread pete M
why the backticks and not quotes ? pete Ma wrote: 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 =

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
of reserved words and use well-formed names, with a clear naming convention. Then you won't need backticks. HTH Ignatius _ - Original Message - From: pete M [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 06, 2003 1:58 PM Subject: Re: [PHP-DB

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

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

2003-11-05 Thread ma
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)) { echo stripslashes($res-customer).'br'.\n;

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

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)

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

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

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
The internet is a wonderful resource. http://www.mysql.com/doc/en/SELECT.html Edward Dudlik Becoming Digital www.becomingdigital.com Did I help you? Want to show your thanks? www.amazon.com/o/registry/EGDXEBBWTYUU - Original Message - From: Artoo [EMAIL PROTECTED] To: [EMAIL

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

2003-06-17 Thread Peter Lovatt
Try this $query = 'SELECT * FROM table $mysql_result = mysql_query($query, $link); while($row = mysql_fetch_array($mysql_result)) { switch ($row[event] ) { case event_one: $bg = 'blue' break;

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

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
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!! ___ Mark Snijders, Developer Atos Origin

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

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

2003-03-19 Thread Gary . Every
SELECT * FROM tablename WHERE zipcode='$zipcode' ORDER BY entered_date; Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 Pay It Forward mailto:[EMAIL PROTECTED] http://accessingram.com -Original Message- From: Michelle Whelan [mailto:[EMAIL PROTECTED] Sent:

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

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

Re: [PHP-DB] select date YYYY-MM mysql help

2003-01-03 Thread Peter Goggin
PROTECTED]; [EMAIL PROTECTED] Sent: Friday, January 03, 2003 9:38 AM Subject: RE: [PHP-DB] select date -MM mysql help Sounds more like an SQL question than PHP, but try the following: SELECT * FROM table WHERE date LIKE '2002-12%'; Regards, Matthew Moldvan

RE: [PHP-DB] select date YYYY-MM mysql help

2003-01-02 Thread Matthew Moldvan
Sounds more like an SQL question than PHP, but try the following: SELECT * FROM table WHERE date LIKE '2002-12%'; Regards, Matthew Moldvan --- System Administrator Trilogy International, Inc http://www.trilogyintl.com/ecommerce/

Re: [PHP-DB] Select a table inside a db

2002-12-24 Thread Jason Wong
On Wednesday 25 December 2002 00:10, zeroked wrote: Hi I am a newbie to PHP so please help How do I add information into my mysql db? I have a db called sitedb and I want to insert datat into my news table inside my sitedb. Merry Christmas. You forgot to say what the problem is. -- Jason

Re: [PHP-DB] Select a table inside a db

2002-12-24 Thread Michal Stankoviansky
z mysql_query(INSERT INTO news (author, posted, body) VALUES($author, z $posted, $body) ); I don't really know what the problem is, but you definitely need to include quotation marks around the variables: mysql_query(INSERT INTO news (author, posted, body) VALUES('$author', $posted,

RE: [PHP-DB] Select Query Help...

2002-12-11 Thread Hynek Semecký ME
table includes identical fgnumber-faqid rows. :) Hynek -Original Message- From: Ignatius Reilly [mailto:[EMAIL PROTECTED]] Sent: 10. prosince 2002 23:42 To: [EMAIL PROTECTED]; Michael Knauf/Niles Subject: Re: [PHP-DB] Select Query Help... Try: SELECT DISTINCT F.question, F.answer

Re: [PHP-DB] Select Query Help...

2002-12-10 Thread Ignatius Reilly
Try: SELECT DISTINCT F.question, F.answer FROM Faqs AS F, FaqsRelatedToProducts Table AS FP WHERE F.faqid = FP.faqid DTH? Ignatius - Original Message - From: Michael Knauf/Niles [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December

RE: [PHP-DB] Select Last row

2002-11-21 Thread Rich Gray
Does 'select * from table order by id desc limit 1' do what you want? HTH Rich -Original Message- From: Afif [mailto:[EMAIL PROTECTED]] Sent: 21 November 2002 01:49 To: PHP DB Subject: [PHP-DB] Select Last row dear All, I have data and I want to get the last row of my table. how to

Re: [PHP-DB] Select Last row

2002-11-20 Thread Marco Tabini
Can you reverse your sorting order? In that case, the last row now becomes the first--making things much easier and faster! :-) Marco -- php|architect - The magazine for PHP Professionals The monthly worldwide magazine dedicated to PHP programmers Come visit us at

Re: [PHP-DB] Select Fields

2002-11-06 Thread David Smith
Tyler, You probably need one or two of the following: 1. Put single-quotes around case in your SQL (where type like 'case') 2. Use wild-cards in your where statement (where type like '%case%') Good luck! --Dave On Wed, 2002-11-06 at 23:31, Tyler Whitesides wrote: Hi, Sorry if this is

Re: [PHP-DB] Select Fields

2002-11-06 Thread Tyler Whitesides
Thank you putting '%case%' instead of case worked! - Original Message - From: David Smith [EMAIL PROTECTED] To: Tyler Whitesides [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 10:47 PM Subject: Re: [PHP-DB] Select Fields Tyler, You probably need one or two

RE: [PHP-DB] select statement

2002-10-25 Thread Michael Hazelden
What's the error? -Original Message- From: Steve Dodkins [mailto:Steve.Dodkins;ebm-ziehl.co.uk] Sent: 25 October 2002 16:46 To: Php-Db (E-mail) Subject: [PHP-DB] select statement Hi I get an error message with the following statement, if I remove the 'AND

RE: [PHP-DB] SELECT statement problem

2002-08-15 Thread Hutchins, Richard
Can you echo out the sql going in and any errors you're getting when the query doesn't work then post that info to this list? It'll help both you and us diagnose what might be going wrong. In addition, what datatype are the columns named start and end in your database? (Assuming database is

RE: [PHP-DB] SELECT statement problem

2002-08-15 Thread Evan S. Weiner
= $row[total_billable]; -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 2:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] SELECT statement problem SELECT * FROM tickets_work WHERE employee_id = '$tech_id' AND start '$start

RE: [PHP-DB] SELECT statement problem

2002-08-15 Thread Miles Thompson
]; $total_billable = $row[total_billable]; -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 2:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] SELECT statement problem SELECT * FROM tickets_work WHERE employee_id = '$tech_id' AND start

Re: [PHP-DB] select distinct with all columns

2002-08-13 Thread leo g. divinagracia iii
you maybe using it the wrong way. read the doc: russ arbuthnot wrote: I have a mysql table named equipment with 11 columns named: id, staff_member, class, type, manufacturer, model, description, picture, created, modified, and published. I'm trying to write a select statement similar to

[PHP-DB] oops...Re: [PHP-DB] select distinct with all columns

2002-08-13 Thread leo g. divinagracia iii
oops, i accidentally sent it without finishing... anyway, what i wanted to say was DISTINCT, at least how i learned it, was working with rows instead of colums: http://www.mysql.com/doc/en/DISTINCT_optimisation.html is there a reason why you dont want to list the columns? russ arbuthnot

RE: [PHP-DB] select distinct with all columns

2002-08-12 Thread Ryan Jameson (USA)
SELECT DISTINCT type,* FROM equipement WHERE class = microphones; Ryan -Original Message- From: russ arbuthnot [mailto:[EMAIL PROTECTED]] Sent: Monday, August 12, 2002 12:07 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] select distinct with all columns I have a mysql table named

RE: [PHP-DB] select distinct with all columns

2002-08-12 Thread Ryan Jameson (USA)
or not be the correct function to use depending on what your need is. Ryan -Original Message- From: Ryan Jameson (USA) Sent: Monday, August 12, 2002 12:22 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] select distinct with all columns SELECT DISTINCT type,* FROM equipement WHERE class

Re: [PHP-DB] Select * from t1.id where not equal to t2.id ???

2002-08-03 Thread Miles Thompson
Why not: select * from table1 where table1.id != table2.id or it may be necessary to incorporate a fragment of table2 select table1.8, table2.id from table1, table2 where table1.id != table2.id Note this tests against only one the current table2.id, not all of them. So

Re: [PHP-DB] select from two tables

2002-08-03 Thread Caleb Walker
: RE: [PHP-DB] select from two tables Well, I'm just a beginner myself, but I would say that: echoi by ; echo ($albumby[xoops_artist.artist]); echoibr; should at least be: echoi by ; echo ($album[xoops_artist.artist]); echoibr; or even: echoi by ; echo ($album[artist]); echoibr; Hope

Re: [PHP-DB] select from two tables

2002-07-29 Thread JJ Harrison
I would try replacing: echoi by ; echo ($albumby[xoops_artist.artist]); echoibr; with this: echoi by ; echo $albumby[artist]; echoibr; or even better this(notice the dots instead of different echos and the single qoutes): echo'i by '.$albumby[artist].'ibr'; I would say that you have a

RE: [PHP-DB] select from two tables

2002-07-27 Thread Herman Verkade
Well, I'm just a beginner myself, but I would say that: echoi by ; echo ($albumby[xoops_artist.artist]); echoibr; should at least be: echoi by ; echo ($album[xoops_artist.artist]); echoibr; or even: echoi by ; echo ($album[artist]); echoibr; Hope this helps, Herman -- PHP Database

RE: [PHP-DB] select from two tables

2002-07-27 Thread Barry Rumsey
Ok I tired this but it did not help, but thank you. -Original Message- From: Herman Verkade [mailto:[EMAIL PROTECTED]] Sent: Sunday, 28 July 2002 1:18 a.m. To: 'Barry Rumsey' Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] select from two tables Well, I'm just a beginner myself, but I

Re: [PHP-DB] select from two tables

2002-07-27 Thread Cornelia Boenigk
Hi Barry $query = SELECT * FROM xoops_album,xoops_artist WHERE xoops_album.artist_id = xoops_artist.artist_id; If you only need two fields, it is not necessary to retrieve all fields $query = SELECT xoops_album.album, xoops_artist.artist FROM xoops_album, xoops_artist WHERE

RE: [PHP-DB] Select a subset?

2002-07-17 Thread joakim . andersson
From: Clive Bruton [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 16, 2002 10:24 PM Joakim, thanks, that sorted it. Just one note, numrows in the sql query should be num_rows? That's how I got it to work anyway. Yes, that's totally correct. Just a typo. Joakim -- PHP Database Mailing

RE: [PHP-DB] Select a subset?

2002-07-16 Thread joakim . andersson
From: Clive Bruton [mailto:[EMAIL PROTECTED]] Sent: Monday, July 15, 2002 5:01 PM How do I get both the number of rows found (5,000) and get a subset of the records (ie 0-9, 10-19, 20-29...) so that a user can browse through the records rather than getting 5,000 at a time (but still

RE: [PHP-DB] Select a subset?

2002-07-16 Thread Clive Bruton
[EMAIL PROTECTED] wrote at 16/07/02 09:44 $result = mysql_query(SELECT COUNT(*) as numrows FROM table,$db); $row = mysql_fetch_array($result); $num_rows = $row['num_rows']; Joakim, thanks, that sorted it. Just one note, numrows in the sql query should be num_rows?

RE: [PHP-DB] Select a subset?

2002-07-15 Thread Gary . Every
I think the paging function is what you want SELECT * from table limit 0,10 for the first ten records SELECT * from table limit 11,20 for the next ten, etc. Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 Pay It Forward mailto:[EMAIL PROTECTED] http://accessingram.com

Re: [PHP-DB] Select a subset?

2002-07-15 Thread Clive Bruton
Adam Alkins wrote at 15/07/02 04:06 mysql_num_rows just counts the amount of rows in a query, so if you only selected 10 rows, it will return 10. If you want to count all the rows in the table, its best to use the COUNT() function SELECT COUNT(*) FROM table In my example, I've selected all

Re: [PHP-DB] Select a subset?

2002-07-14 Thread Adam Alkins
ie start at record 10 and show the next 10. But this delivers back 10 as the $num_rows variable, when I want the total number of rows. I don't really have to complete two querys to get the appropriate values do I? mysql_num_rows just counts the amount of rows in a query, so if you only

RE: [PHP-DB] Select string.

2002-07-10 Thread Shrock, Court
$login = mysql_query(SELECT * FROM Users WHERE Username ='$User_Name'); -Original Message- From: Shiloh Madsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 4:48 PM To: php-db Subject: [PHP-DB] Select string. Yet another thing i need some quick help with. What is

Re: [PHP-DB] select and sort question

2002-04-27 Thread mike
There are many ways to sort by date. I use something like this SELECT * FROM newsitems WHERE newsdate=(whatever date you want); For selecting records for the current date I use php's date function to get the current date in the right format. $current_date = date(Ymd); SELECT * FROM newsitems

RE: [PHP-DB] select rows from more than one table, how?

2002-03-11 Thread Rick Emery
First: show us your exact query Second: show us your exact error response Third: show us your exact code and table structure -Original Message- From: Sander Peters [mailto:[EMAIL PROTECTED]] Sent: Monday, March 11, 2002 3:03 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] select rows from

Re: [PHP-DB] SELECT where something exists but something else does not

2002-02-21 Thread George Lioumis
Hi! I think I have solved your problem... I have attached an sql file to create the sample DB I created for my test and a PHP file for you to run to see how I have implemented it. First create the tables with the .sql file an then execute the .php file from your browser. Hope these help.

Re: [PHP-DB] SELECT where something exists but something else does not

2002-02-21 Thread George Lioumis
I think I forgot something usefull... - Original Message - From: Beau Lebens [EMAIL PROTECTED] To: PHP DB (E-mail) [EMAIL PROTECTED] Sent: Thursday, February 21, 2002 3:59 AM Subject: [PHP-DB] SELECT where something exists but something else does not Hey guys, I am a little stuck

RE: [PHP-DB] Select rows where ?

2002-02-12 Thread Rick Emery
select * from tablename where field NOT LIKE %A%; -Original Message- From: Dave Carrera [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 12:39 PM To: php List Subject: [PHP-DB] Select rows where ? Hi All How do I select the rows that DO NOT contain a certain character. I.e.

Re: [PHP-DB] Select rows where ?

2002-02-12 Thread Jim Lucas [php]
select * from table where columnsomething select * from table where column NOT LIKE %something% Jim Lucas - Original Message - From: Dave Carrera [EMAIL PROTECTED] To: php List [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 10:39 AM Subject: [PHP-DB] Select rows where ? Hi All

RE: [PHP-DB] Select rows where ?

2002-02-12 Thread Gurhan Ozen
SELECT * FROM table WHERE COLUMN_NAME NOT LIKE '%unwanted_String%'; when the field type is number you can use SELECT * FROM table WHERE COLUMN_NAME != unwanted_number; or SELECT * FROM table WHERE COLUMN_NAME unwanted_number; Gurhan -Original Message- From: Dave Carrera

RE: [PHP-DB] SELECT statement does not return rows

2002-02-01 Thread Rick Emery
Did you print out the value of $sql before executing it? Was it as you expected? If so, did you print out mysql_num_rows() to verify it's greater than 0? -Original Message- From: Todd Williamsen [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 2:52 PM To: [EMAIL PROTECTED]

Re: [PHP-DB] SELECT statement does not return rows

2002-02-01 Thread biorn
Is your id an integer or a char/varchar? If it is an integer, take the quotes off $id in your select statement. Todd Williamsen [EMAIL PROTECTED] said: Weird.. I want to be able to edit records, which I have done in the past, and I cannot see why it isn't working... I have tried

RE: [PHP-DB] SELECT statement does not return rows

2002-02-01 Thread Shrock, Court
I am assuming that this code is NOT the file do_mod_job.php. What happens if you do this next line right after you execute your query?: echo 'num rows fetched: '.mysql_num_rows($result).'br'; also, the while loop shouldn't really be necessary as the query should only return one record if I

RE: [PHP-DB] SELECT statement does not return rows

2002-02-01 Thread Shrock, Court
oops.forgot a semicolon on the first line of the multi-line code segment -Original Message- $row = mysql_fetch_array($result) echo 'tabletrthcolumn/ththvalue/th/tr'; while(list($key, $val) = each($row)) { // $row has two key/value pairs per column -- one integer, one

Re: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread Miles Thompson
Check the manual for the mysql_fetch_array() function, it shows you how to extract data from $result. You will use the while loop (as shown in the manual's example) to fill your combo box / selct list /drop down menu, whatever we're calling that creature today. Miles At 12:45 PM 1/30/2002

RE: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread Rick Emery
? $db = mysql_connect($dbserver, $dbuser, $dbpass); mysql_select_db($dbname,$db); $sortby = name ASC; $sql=SELECT * FROM webl_players ORDER BY $sortby; $result=mysql_query($sql,$db); print select name=canidate; while( $row = mysql_fetch_array($result) ) { $FirstName = $row['FirstName'];

Re: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread biorn
You will need to put the option tag in a loop to get all of the records in the table. select name=canidate (this can go anywhere but in while loop) ? $db = mysql_connect($dbserver, $dbuser, $dbpass); mysql_select_db($dbname,$db); $sortby = name ASC; $sql=SELECT * FROM webl_players ORDER BY

RE: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread Todd Williamsen
Nope, that doesn't work -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 1:01 PM To: 'Todd Williamsen'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Select statement only returns 1 record ? $db = mysql_connect($dbserver, $dbuser, $dbpass

RE: [PHP-DB] select and update together

2002-01-21 Thread Robert V. Zwink
http://www.mysql.com/doc/U/P/UPDATE.html UPDATE catalogs SET PROCESSED = Y WHERE PROCESSED IS NULL LIMIT $i,10 Is this what you are looking for? Robert V. Zwink http://www.zwink.net/daid.php -Original Message- From: James Kupernik [mailto:[EMAIL PROTECTED]] Sent: Monday, January 21,

Re: [PHP-DB] select into array

2002-01-16 Thread Miles Thompson
George, Whether you can select into an array directly depends on your database. In any case, PHP executes database queries and returns a handle or container which is accessed as an array. Here's the example from http://www.php.ca/manual/en/function.mysql-fetch-array.php ?php

Re: [PHP-DB] SELECT giving too much :)

2001-08-29 Thread Doug Semig
Hi Beau-- This is just a wild guess (I've only glanced at your SQL), but do you have two locations in your locations table? You might want to try yanking locations out of the join since you're not using it in your WHERE clause or showing any info from it. Doug At 12:06 PM 8/30/01 +0800, Beau

RE: [PHP-DB] SELECT giving too much :)

2001-08-29 Thread Beau Lebens
- // From: Doug Semig [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 30 August 2001 12:31 PM // To: [EMAIL PROTECTED] // Subject: Re: [PHP-DB] SELECT giving too much :) // // // Hi Beau-- // // This is just a wild guess (I've only glanced at your SQL), // but do you have // two locations in your

RE: [PHP-DB] SELECT giving too much :)

2001-08-29 Thread Doug Semig
Hi Beau-- Alternatively you could probably include an AND for the location ID to link up with whatever it is supposed to link up to in the WHERE clause. But I have no idea how you responded to my message in 2 minutes flat! Are you a remarkably complex AI autoresponder that knocks the socks off

<    1   2   3   >