Re: [PHP-DB] Query does not work

2014-07-02 Thread Lester Caine
On 02/07/14 04:43, Ethan Rosenberg, PhD wrote: while ($row31 = mysqli_fetch_row($result31)) { printf (%s %s %s %s %s\n, $row31[0], $row31[1], $row31[2], $row31[3]); Try print_r( $row31 ); } // no output How can I loose a db connection in the middle of a program? This is not showing

Re: [PHP-DB] Query does not work

2014-07-02 Thread Jim Giner
Once again you have provided the group with RANDOM pieces of code, completely out of context since you have already shown me that your query and db connection are being used in a function, hence your loss of $cxn. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP-DB] Query will not work - SOLVED

2013-02-02 Thread Ethan Rosenberg, PhD
I must be missing something fundamental!! Here is a code snippet: $sql13 = UPDATE Customers SET Lname = 'Barnet', City = 'Lakewood', State = 'NJ' WHERE Cust_Num = 1089; $result13 = mysqli_query($cxn, UPDATE Customers SET Lname = 'Bleich', City = 'Lakewood', State = 'NJ' WHERE Cust_Num

Re: [PHP-DB] Query will not work - SOLVED

2013-02-02 Thread Karl DeSaulniers
$sql13 = UPDATE `Customers` SET `Lname` = 'Barnet', `City` = 'Lakewood', `State` = 'NJ' WHERE `Cust_Num` = 1089; $result13 = mysqli_query($cxn, $sql13); if(mysqli_num_rows($result13) 0) { $row_cnt = mysqli_num_rows($result13); echo row count result13 is $row_cntbr /; } else { echo Ouch

Re: [PHP-DB] Query will not work - SOLVED

2013-02-02 Thread tamouse mailing lists
On Sat, Feb 2, 2013 at 8:08 PM, Ethan Rosenberg, PhD erosenb...@hygeiabiomedical.com wrote: I must be missing something fundamental!! Yes. I was using the worker@localhost, which did not have the Update privilege. Added the privilege that, and everything worked. Please explain why you are

Re: [PHP-DB] Query Question

2011-05-23 Thread maarten
I would keep the db names and/or schema names in your queries. It clarifies what you are doing with the query making it easier for someone else to debug, improve, ... Certainly for those not familiar with your db structure. I am not aware of any drawbacks that can result from this. (Ok, maybe

Re: [PHP-DB] Query Question

2011-05-23 Thread maarten
That's a very good point, but since I use postgres that's one point that doesn't affect me and as such didn't cross my mind at the time. (Postgres uses schemas where mysql uses databases, a different database on postgres usually means a different database machine. And joining tables from

[PHP-DB] Query Question

2011-05-22 Thread admin
I have been working on a class methods for some time now. I have reached a cross road when it comes to common practice of developing query structure. Long ago I wrote queries where I just called the field I wanted on a particular table unless I was joining them. Example: $query =

[PHP-DB] Query syntax error?

2011-01-13 Thread Harvey
Hello, I have a query on a page that used to work fine, but is now generating an error. I assume that the version of php or mysql was updated on the webhost server or something like that? Here is the query: select count(places_data.place_id) as areacount, boroughs.borough_name as boroname,

Re: [PHP-DB] Query syntax error?

2011-01-13 Thread jose
you have renamed places_data table to 'a' 2011/1/13 Harvey har...@harveyk.com: Hello, I have a query on a page that used to work fine, but is now generating an error. I assume that the version of php or mysql was updated on the webhost server or something like that? Here is the query:

RE: [PHP-DB] Query syntax error?

2011-01-13 Thread Harvey
Thanks, I got it working now, had to use the a/b/c thing a few times -Original Message- From: jose [mailto:jojap...@gmail.com] Sent: Thursday, January 13, 2011 9:52 AM Cc: php-db@lists.php.net Subject: Re: [PHP-DB] Query syntax error? you have renamed places_data table to 'a' 2011/1

[PHP-DB] query help

2010-11-17 Thread Vinay Kannan
Hello PHP Gurus, I need your help on an insert query. I wanted to know if there is way to insert an array of values into a DB. An eg would explain this better : If I have 2 tables in a DB, 1) users has 3 columns 2) hobbies = 5 columns I was thinking of having a single function which will

Re: [PHP-DB] query help

2010-11-17 Thread Artur Ejsmont
well i guess you could do that. but it gets complicated after a while and there will be a lot of work and probably after a while you will get into some problems. You have to handle escaping, special types etc. Then what about performance? how to query the data ... using similar approach or is

Re: [PHP-DB] query help

2010-11-17 Thread Bastien Koert
On Wed, Nov 17, 2010 at 8:51 AM, Vinay Kannan viny...@gmail.com wrote: Hello PHP Gurus, I need your help on an insert query. I wanted to know if there is way to insert an array of values into a DB. An eg would explain this better : If I have 2 tables in a DB, 1) users has 3 columns 2)

Re: [PHP-DB] query help

2010-11-17 Thread Max E.K
From: Vinay Kannan viny...@gmail.com To: PHP DB php-db@lists.php.net, php mysql php_mysql_usergr...@yahoogroups.com Sent: Wednesday, November 17, 2010 2:51:35 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: [PHP-DB] query help Hello PHP Gurus, I need your help

Re: [PHP-DB] query help

2010-11-17 Thread Niel Archer
Hello PHP Gurus, I need your help on an insert query. I wanted to know if there is way to insert an array of values into a DB. An eg would explain this better : If I have 2 tables in a DB, 1) users has 3 columns 2) hobbies = 5 columns I was thinking of having a single function which

RE: [PHP-DB] query help

2010-11-17 Thread Constantin Brinzoi
[mailto:ejsmont.ar...@gmail.com] Sent: 17 noiembrie 2010 16:07 To: Vinay Kannan Cc: PHP DB; php mysql Subject: Re: [PHP-DB] query help well i guess you could do that. but it gets complicated after a while and there will be a lot of work and probably after a while you will get into some

RE: [PHP-DB] query help

2010-11-17 Thread Ashay Chaudhary
The most performant methods are to use well parameterized stored procedure or a prepared parameterized statement. : Ashay -Original Message- From: Niel Archer [mailto:n...@chance.now] Sent: Wednesday, November 17, 2010 6:30 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] query help

[PHP-DB] Query for duplicate records

2010-10-17 Thread Ron Piggott
Is there a query you could help me write a SELECT query that would search table `ministry_profiles` for where column `organization` has the same organization more than once? I am trying to delete the duplicate organization records, but I am working with 1,000+ businesses and I can't go

Re: [PHP-DB] Query for duplicate records

2010-10-17 Thread Chris
On 18/10/10 06:55, Ron Piggott wrote: Is there a query you could help me write a SELECT query that would search table `ministry_profiles` for where column `organization` has the same organization more than once? I am trying to delete the duplicate organization records, but I am working with

[PHP-DB] Query stopping after 2 records?

2009-04-27 Thread Miller, Terion
I need help/advice figuring out why my query dies after 2 records. Here is the query: // Build your INSERT statement here $query = INSERT into `warrants` (wid, name, age, warrant, bond, wnumber, crime) VALUES (; $query .= '$wid', '$name', '$age', '$warrant', '$bond',

Re: [PHP-DB] Query stopping after 2 records?

2009-04-27 Thread Bastien Koert
On Mon, Apr 27, 2009 at 10:19 AM, Miller, Terion tmil...@springfi.gannett.com wrote: I need help/advice figuring out why my query dies after 2 records. Here is the query: // Build your INSERT statement here $query = INSERT into `warrants` (wid, name, age, warrant, bond, wnumber,

Re: [PHP-DB] Query stopping after 2 records?

2009-04-27 Thread Hawx
On Mon, 27 Apr 2009 07:19:23 -0700, Miller, Terion tmil...@springfi.gannett.com wrote: I need help/advice figuring out why my query dies after 2 records. Here is the query: // Build your INSERT statement here $query = INSERT into `warrants` (wid, name, age, warrant,

Re: [PHP-DB] Query stopping after 2 records?

2009-04-27 Thread Chris
Hawx wrote: On Mon, 27 Apr 2009 07:19:23 -0700, Miller, Terion tmil...@springfi.gannett.com wrote: I need help/advice figuring out why my query dies after 2 records. Here is the query: // Build your INSERT statement here $query = INSERT into `warrants` (wid, name, age,

Re: [PHP-DB] query optimization

2008-09-28 Thread Chris
Yves Sucaet wrote: Hi Jack, I'm expecting less than 10 records in the resulting set. The BlockUnit table contains 337,253 records; the InteractionParts table contains 279,953 records. It takes currently 8.3 seconds to execute the query as I have it. Erh, this is embarassing but I'm going to

Fwd: [PHP-DB] query optimization

2008-09-28 Thread Bastien Koert
On Sun, Sep 28, 2008 at 6:28 PM, Chris [EMAIL PROTECTED] wrote: Yves Sucaet wrote: Hi Jack, I'm expecting less than 10 records in the resulting set. The BlockUnit table contains 337,253 records; the InteractionParts table contains 279,953 records. It takes currently 8.3 seconds to

Re: [PHP-DB] query optimization

2008-09-26 Thread Yves Sucaet
-writing it with EXISTS... Thanks for the help so far, Yves - Original Message - From: Jack van Zanen To: Chris Cc: YVES SUCAET ; php-db@lists.php.net Sent: Thursday, September 25, 2008 7:49 PM Subject: Re: [PHP-DB] query optimization If you can answer the other questions

Re: [PHP-DB] query optimization - DB

2008-09-26 Thread Yves Sucaet
Oh, sorry I forgot to mention this. It's a MySQL database. - Original Message - From: Micah Gersten [EMAIL PROTECTED] To: YVES SUCAET [EMAIL PROTECTED] Cc: php-db@lists.php.net Sent: Thursday, September 25, 2008 7:55 PM Subject: Re: [PHP-DB] query optimization Other question

Re: [PHP-DB] query optimization - DB

2008-09-26 Thread Micah Gersten
. - Original Message - From: Micah Gersten [EMAIL PROTECTED] To: YVES SUCAET [EMAIL PROTECTED] Cc: php-db@lists.php.net Sent: Thursday, September 25, 2008 7:55 PM Subject: Re: [PHP-DB] query optimization Other question is, what DB is this for? Thank you, Micah Gersten onShore Networks Internal

Re: [PHP-DB] query optimization - DB

2008-09-26 Thread Yves Sucaet
you help out rewriting the query using EXISTS syntax? Thanks in advance, Yves - Original Message - From: Micah Gersten [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Friday, September 26, 2008 11:47 AM Subject: Re: [PHP-DB] query optimization - DB MySQL queries use 1 index per

Re: [PHP-DB] query optimization - DB

2008-09-26 Thread Glen Synergy
PROTECTED] To: YVES SUCAET [EMAIL PROTECTED] Cc: php-db@lists.php.net Sent: Thursday, September 25, 2008 7:55 PM Subject: Re: [PHP-DB] query optimization Other question is, what DB is this for? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com

[PHP-DB] query optimization

2008-09-25 Thread YVES SUCAET
How could I rewrite the following query so it runs faster: select distinct location from blockunit where blockid in ( select bu.blockid from blockunit bu inner join interactionparts ip on (bu.blockid = ip.part) where ip.blockid in

Re: [PHP-DB] query optimization

2008-09-25 Thread Micah Gersten
What indices do you have? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com YVES SUCAET wrote: How could I rewrite the following query so it runs faster: select distinct location from blockunit where blockid in ( select bu.blockid from blockunit bu inner

Re: [PHP-DB] query optimization

2008-09-25 Thread Chris
Micah Gersten wrote: What indices do you have? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com YVES SUCAET wrote: How could I rewrite the following query so it runs faster: select distinct location from blockunit where blockid in ( select bu.blockid

Re: [PHP-DB] query optimization

2008-09-25 Thread Jack van Zanen
Hi If I am not mistaken, the second part of the union contains all rows that are in the first part of the union. just remove the first part. Also What is the table sizes of the tables? How many records are expected to come back from the union sub query? How many records are expected to

Re: [PHP-DB] query optimization

2008-09-25 Thread Chris
Jack van Zanen wrote: Hi If I am not mistaken, the second part of the union contains all rows that are in the first part of the union. just remove the first part. Kind of. The first part is a join, the second isn't. I was going to suggest rewriting the subquery into a single: where

Re: [PHP-DB] query optimization

2008-09-25 Thread Jack van Zanen
If you can answer the other questions that would help as well you can try rewriting using exist instead of in But without the basic information like number of records expected and explain plan it is very hard to come up with a better solution. Brgds Jack 2008/9/26 Chris [EMAIL PROTECTED]

Re: [PHP-DB] query optimization

2008-09-25 Thread Micah Gersten
Other question is, what DB is this for? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com YVES SUCAET wrote: How could I rewrite the following query so it runs faster: select distinct location from blockunit where blockid in ( select bu.blockid from

[PHP-DB] Query

2008-04-30 Thread Ron Piggott
I have an interesting question. When I run the following query through my PHP script it produces 1 result. I know this because I echo the value of $num to the screen from the following syntax: $num=mysql_numrows($result); When I do the query in the SQL tab of phpMyAdmin there are 6 results. The

Re: [PHP-DB] Query

2008-04-30 Thread Chris
Ron Piggott wrote: I have an interesting question. When I run the following query through my PHP script it produces 1 result. I know this because I echo the value of $num to the screen from the following syntax: $num=mysql_numrows($result); When I do the query in the SQL tab of

Re: [PHP-DB] Query

2008-04-30 Thread Ron Piggott
You just drew my attention my include that brings in the site menu and was changing the conflict. Thanks :) Ron On Thu, 2008-05-01 at 13:19 +1000, Chris wrote: Ron Piggott wrote: I have an interesting question. When I run the following query through my PHP script it produces 1

[PHP-DB] Query Criteria

2008-04-28 Thread Nasreen Laghari
Hi All, I need help in below coding as it is not working. What I'm trying to do here, if $type contains today value then bring all record which has today's date, If $type contains tomorrow bring all tomorrow's record. Do you think below coding is correct? becuase when I run this query I get

Re: [PHP-DB] Query Across DBMS Boundaries (Linked Database Servers?)

2008-03-24 Thread Chris
Dee Ayy wrote: Is there something which can perform a query across different database systems? It would extend the database.table.field notation to maybe dbms.database.table.field and allow queries across MySQL and MSSQL I don't think so. Both mysql and mssql would need to know how to parse

[PHP-DB] Query Across DBMS Boundaries (Linked Database Servers?)

2008-03-20 Thread Dee Ayy
Is there something which can perform a query across different database systems? It would extend the database.table.field notation to maybe dbms.database.table.field and allow queries across MySQL and MSSQL such as: //$sql = SELECT MySQLidentifier.aDatabase.aTable.aField,

Re: [PHP-DB] Query table / results to an array

2008-02-29 Thread Daniel Brown
On Fri, Feb 29, 2008 at 12:22 AM, Ron Piggott [EMAIL PROTECTED] wrote: $reference_number = mysql_result($search_result,$i,reference_number); $description = mysql_result($search_result,$i,description); ? $sql = SELECT reference_number FROM table WHERE this='whatever' OR that NOT LIKE

[PHP-DB] Query table / results to an array

2008-02-28 Thread Ron Piggott
I need help populating an array based on the output of a mysql query. $reference_number is a value assigned by auto_increment $description is what I want the value of the array to be --- a few words in length $reference_number = mysql_result($search_result,$i,reference_number); $description =

Re: [PHP-DB] Query table / results to an array

2008-02-28 Thread Chris
Ron Piggott wrote: I need help populating an array based on the output of a mysql query. $reference_number is a value assigned by auto_increment $description is what I want the value of the array to be --- a few words in length $reference_number =

Re: [PHP-DB] Query table / results to an array

2008-02-28 Thread Chris
Ron Piggott wrote: This line of code while ($row = mysql_fetch_assoc($result)) { Gave me this error message: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource I ran select reference, description from table in mySQL and it worked --- Any idea what caused

[PHP-DB] Query executing

2007-10-05 Thread ron.php
How would I know if this mySQL query: DELETE FROM `table` WHERE `date_to_be_deleted` LIKE '$todays_date' actually deleted any rows from the table? Ron

RE: [PHP-DB] Query executing

2007-10-05 Thread Hutchins, Richard
:[EMAIL PROTECTED] Sent: Friday, October 05, 2007 9:52 AM To: php-db@lists.php.net Subject: [PHP-DB] Query executing How would I know if this mySQL query: DELETE FROM `table` WHERE `date_to_be_deleted` LIKE '$todays_date' actually deleted any rows from the table? Ron -- PHP Database Mailing

[PHP-DB] Query syntax

2007-09-15 Thread ron.php
$query=SELECT * FROM table WHERE listing_type LIKE '%$listing_type%' AND listing_approved = '1' OR listing_approved = '2' ORDER BY name ASC; My question is how can I search for records where listing_approved has a value of either 1 or 2 (while in the same search I am searching for

Re: [PHP-DB] Query syntax

2007-09-15 Thread TG
%' AND listing_approved IN ('1', '2') ORDER BY name ASC Good luck! -TG - Original Message - From: ron.php [EMAIL PROTECTED] To: php-db@lists.php.net Date: Sat, 15 Sep 2007 15:04:59 -0400 Subject: [PHP-DB] Query syntax $query=SELECT * FROM table WHERE listing_type LIKE '%$listing_type

[PHP-DB] Query Object in PHP?

2007-02-24 Thread js
Hi list, Is there any implementation of Query Object [1] written in PHP? I spent some time searching on the net but no clues're found. Thank you in advance. [1] http://www.martinfowler.com/eaaCatalog/queryObject.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP-DB] Query select value on MAX Date

2006-02-25 Thread Neil Smith [MVP, Digital media]
At 08:47 25/02/2006, you wrote: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=_=_NextPart_001_01C63997.1A6B1B7D Date: Sat, 25 Feb 2006 08:07:36 +0900 Message-ID: [EMAIL PROTECTED] From: [EMAIL PROTECTED] To: 'php-db@lists.php.net' Subject: FW: [PHP-DB] Query select

RE: [PHP-DB] Query select value on MAX Date

2006-02-24 Thread Nur_Adman
Dear All, I have table like this : Id | Category | Date| Value 1 | A | 2005-02-21 | 2000 2 | A | 2004-01-21 | 3000 3 | B |

FW: [PHP-DB] Query select value on MAX Date

2006-02-24 Thread Nur_Adman
Regards, Anita From: Adman, Nur anita Sent: Saturday, February 25, 2006 6:05 AM To: 'php-db@lists.php.net' Subject: RE: [PHP-DB] Query select value on MAX Date Dear All, I have table like this : Id | Category | Date

[PHP-DB] query on database determines image swap in php-coded page?

2005-07-27 Thread Elaine Miller
Hi, I'm a designer of simple webpages, and an enthusiastic user of PHP applications that run with MySQL -- but I don't write, or think in, PHP, so I can't quite figure how to do this: I run phpbb forum software (yes, I've asked at phpbb and at phpbbhacks, no luck) and I have installed for our

[PHP-DB] query error

2005-04-16 Thread pete M
I've got a database table with a whole list of windows file paths. eg Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Binder.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Excel.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Office Setup.lnk Advent Tower

[PHP-DB] Query that generates href links

2005-03-20 Thread John Burroughs
Hi everyone, I've created a database for my poetry that I've written. I have a table called Titles. It is made up of: title_id (a different number for every poem title. It's the primary key.) title (the title of the poem) title_date (the date I wrote the poem. stored in Date format.) I want to

Re: [PHP-DB] Query that generates href links

2005-03-20 Thread Evert | Rooftop Solutions
John Burroughs wrote: Hi everyone, I've created a database for my poetry that I've written. I have a table called Titles. It is made up of: [snip] How can I do this. Everytime I tried adding to the above code, I kept getting error messages in php saying that there was an unexpected ''character

RE: [PHP-DB] Query that generates href links

2005-03-20 Thread Juffermans, Jos
@lists.php.net Subject: [PHP-DB] Query that generates href links Hi everyone, I've created a database for my poetry that I've written. I have a table called Titles. It is made up of: title_id (a different number for every poem title. It's the primary key.) title (the title of the poem) title_date

[PHP-DB] Query was empty - Strange problem

2005-03-16 Thread Vinayakam Murugan
Hi I have an application in which i am connecting to three different databases. I have three connect and query procedure. I am facing problems with one of these databases.

Re: [PHP-DB] Query was empty - Strange problem

2005-03-16 Thread Vinayakam Murugan
This is a common procedure. $Query is being passed to it. As I had said before, i had tried echoing $Query before and after the mysql_query statement and it displays a proper query. That's what driving me nuts! :-( On Wed, 16 Mar 2005 22:36:13 -0800, Stephen Johnson [EMAIL PROTECTED] wrote: I

Re: [PHP-DB] Query was empty - Strange problem

2005-03-16 Thread Vinayakam Murugan
Here is the entire function function Executequery($Query) { global $Error, $Hostname,$Loginname,$Passwd,$Dbname,$Conn; $Conn = mysql_pconnect($Hostname,$Loginname,$Passwd);

Re: [PHP-DB] Query was empty - Strange problem

2005-03-16 Thread Stephen Johnson
I do not see where you are populating $Query -- therefore your query would be empty -- On Mar 16, 2005, at 10:30 PM, Vinayakam Murugan wrote: Hi I have an application in which i am connecting to three different databases. I have three connect and query procedure. I am facing problems with one

Re: [PHP-DB] query is not executing data is not entering in created database

2004-12-26 Thread amol patil
hallo, see below code. query is not executing and data is not shown in table of database.after submit button hit. how to evaluate $submit true. have Tried these statements before if statement echo --$submit--; echo --$_POST[submit]--; echoSubmit = $submit ; but still query is not

Re: [PHP-DB] query is not executing data is not entering in created database

2004-12-26 Thread John Holmes
amol patil wrote: hallo, see below code. query is not executing and data is not shown in table of database.after submit button hit. how to evaluate $submit true. have Tried these statements before if statement echo --$submit--; echo --$_POST[submit]--; echoSubmit = $submit ; but still

[PHP-DB] query of two tables returns too many rows, many more than the two tables contain

2004-11-11 Thread Chip Wiegand
I have two tables I want to get out the rows that are different between them. The results I am getting is almost 50,000 rows, but the two tables, combined, contain only about 600 rows total. Here is the select statement - SELECT dealers.account_no, dealers.DealerName,

RE: [PHP-DB] query of two tables returns too many rows, many more than the two tables contain

2004-11-11 Thread Gryffyn, Trevor
:[EMAIL PROTECTED] Sent: Thursday, November 11, 2004 4:28 PM To: PHP DB Subject: [PHP-DB] query of two tables returns too many rows, many more than the two tables contain I have two tables I want to get out the rows that are different between them. The results I am getting is almost 50,000

RE: [PHP-DB] query of two tables returns too many rows, many more than the two tables contain

2004-11-11 Thread Norland, Martin
-Original Message- From: Chip Wiegand [mailto:[EMAIL PROTECTED] Sent: Thursday, November 11, 2004 3:28 PM To: PHP DB Subject: [PHP-DB] query of two tables returns too many rows, many more than the two tables contain I have two tables I want to get out the rows that are different between

RE: [PHP-DB] query of two tables returns too many rows, many more than the two tables contain

2004-11-11 Thread Chip Wiegand
PM To: PHP DB Subject: [PHP-DB] query of two tables returns too many rows, many more than the two tables contain I have two tables I want to get out the rows that are different between them. The results I am getting is almost 50,000 rows, but the two tables, combined

[PHP-DB] query parser

2004-09-30 Thread Aditya Ivaturi
We have a content management system and one of its features is what we call a databse browser. What it allows you to do is take a table and display contents in the way it is useful for the relevant audience. One of the new features that was requested was editing the content which will in turn be

[PHP-DB] query parser

2004-09-30 Thread Aditya Ivaturi
We have a content management system and one of its features is what we call a databse browser. What it allows you to do is take a table and display contents in the way it is useful for the relevant audience. One of the new features that was requested was editing the content which will in turn

[PHP-DB] Query returns duplicate rows

2004-07-21 Thread Brock Jimmy D Contr 74 MDSS/SGSI
My query is returning duplicates rows. table: elements elementId standardId elementtext category mcode linenum table: scores scoreId taskId scores Here's my query: SELECT distinct elementtext,cateogy,mcode,linenum,scores,scoreId FROM elements, scores WHERE scores.taskId='12' AND

Re: [PHP-DB] Query returns duplicate rows

2004-07-21 Thread Justin Patrin
On Wed, 21 Jul 2004 16:29:37 -0400, Brock Jimmy D Contr 74 MDSS/SGSI [EMAIL PROTECTED] wrote: My query is returning duplicates rows. table: elements elementId standardId elementtext category mcode linenum table: scores scoreId taskId scores Here's my query: SELECT distinct

RE: [PHP-DB] Query returns duplicate rows

2004-07-21 Thread Brock Jimmy D Contr 74 MDSS/SGSI
the criteria for that particular element. Thanks for the help though. -Original Message- From: Justin Patrin To: Brock Jimmy D Contr 74 MDSS/SGSI Cc: [EMAIL PROTECTED] Sent: 7/21/2004 5:02 PM Subject: Re: [PHP-DB] Query returns duplicate rows On Wed, 21 Jul 2004 16:29:37 -0400, Brock Jimmy D

Re: [PHP-DB] Query returns duplicate rows

2004-07-21 Thread Justin Patrin
a join without an ON clause is IMHO not a good choice. -Original Message- From: Justin Patrin To: Brock Jimmy D Contr 74 MDSS/SGSI Cc: [EMAIL PROTECTED] Sent: 7/21/2004 5:02 PM Subject: Re: [PHP-DB] Query returns duplicate rows On Wed, 21 Jul 2004 16:29:37 -0400, Brock Jimmy D Contr

[PHP-DB] query problem..

2004-07-14 Thread Micah Stevens
Hi, I'm getting an unknown colum `num` in where clause error with this query: $options = mysql_query(select options.*, count(option_items.optionID) as `num` from options left join

[PHP-DB] Query help

2004-07-09 Thread Craig Hoffman
Hey Everyone, I can use some help here I have query where one can selects an style then a area and finally rating through a drop menu. When some selects a rating they select a range of ratings. For example: Style: Traditional Area: Yosemite Rating: From: 5.5 To: 5.10c This should pull

[PHP-DB] Query: Top 3 Results grouped by Category

2004-07-08 Thread John Van Vranken
Hi all, I am working on a search result query in which the user types a keyword and the top 3 results for each category are displayed with 24 or so total results on the page. The database is large (8 GB) and the table in which the fulltext search occurs has 3 million rows. Tables: product

[PHP-DB] Query for Most Recent Entry

2004-07-02 Thread Thompson, Jimi
Hi, I'm trying to figure out how to write a MySQL query that will return the highest primary key a table. Thanks, Ms. Jimi Thompson, CISSP Manager, Web Operations Cox School of Business Southern Methodist University What kind of peace do we seek? Not a 'Pax Americana' enforced

Re: [PHP-DB] Query for Most Recent Entry

2004-07-02 Thread John W. Holmes
Thompson, Jimi wrote: I'm trying to figure out how to write a MySQL query that will return the highest primary key a table. 1) Why? 2) SELECT MAX(id) FROM table 3) If you're trying to find the key of the last row inserted to an auto_increment column, use mysql_insert_id() or LAST_INSERT_ID() in

[PHP-DB] Query Help!

2004-04-08 Thread JeRRy
Hi Everyone, Happy Easter to you all. I have this query, reasoning for posting on this Mailing List is under it. :) SELECT `username` , `score` FROM round . $round_number . WHERE 1 ORDER BY `score` DESC LIMIT 0, 30 Is there a way to make it output the $round_number -1 (minus one number)? I

Re: [PHP-DB] query repeating results???

2004-03-26 Thread Brent Baisley
Try left joining your states table also. MySQL may be joining the property_photos and the states table first, which would screw up your left join. Haven't had my morning coffee yet so I can't say for sure. Put EXPLAIN in front of your query to see what MySQL is doing. SELECT ... FROM

[PHP-DB] query repeating results???

2004-03-25 Thread Katie Dewees
I am running the following query: SELECT ...stuff... FROM properties LEFT JOIN property_photos ON property_photos.property_id=properties.id, states WHERE states.code='fl' AND properties.state_id=states.id LIMIT 0, 10 (not sure if the JOIN

RE: [PHP-DB] Query to Array to Echo Problem--Thank you

2004-02-25 Thread Karen Resplendo
($result);. Though that doesn't explain your column names being in the array unless that's what's in the table. Ryan -Original Message- From: Karen Resplendo [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 5:18 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Query to Array to Echo

[PHP-DB] Query

2004-02-24 Thread peppe
Hi I have this query $sql = SELECT * FROM events WHERE ( YEAR(datum) = ' . $year . ') ORDER BY datum ASC; $result = mysql_query($sql); $numRows = mysql_num_rows($result); for ($row = 1; $row = $numRows; $row++) { $rowArray = mysql_fetch_array($result); $datum=

[PHP-DB] Re: php-db Query

2004-02-24 Thread Frank Flynn
Peppe Don't search by month at all - use a start and stop date then order by date. Now you have one result set with all the dates in it and you can use your PHP code to figure out where to close one table and open a net one: $result = mysql_query($sql); echo TABLE; $thisMonth = $result[3];

[PHP-DB] Query to Array to Echo Problem

2004-02-24 Thread Karen Resplendo
Here is the webpage that demonstrates my code problem: http://170.104.158.16/chemlatestPAGETEST.php3?pwsno=00100 I'm so close I can smell it. Hoping someone can troubleshoot my code. Here is the piece that doesn't work. It returns the 2 column names, over and over. For some reason I'm not

RE: [PHP-DB] Query to Array to Echo Problem

2004-02-24 Thread Ryan Jameson (USA)
, February 24, 2004 5:18 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Query to Array to Echo Problem Here is the webpage that demonstrates my code problem: http://170.104.158.16/chemlatestPAGETEST.php3?pwsno=00100 I'm so close I can smell it. Hoping someone can troubleshoot my code. Here

[PHP-DB] Query Sum problem

2003-12-16 Thread Larry Sandwick
I need to sum the field *COST* in this query where data in *STATUS* is equal to HELD and OPEN, so I will have 2 totals passed below and do not know where to begin . All information is in 1 table. Original query select distinct(Company_name), account, City, State from table where number =

Re: [PHP-DB] Query Sum problem

2003-12-16 Thread CPT John W. Holmes
From: Larry Sandwick [EMAIL PROTECTED] I need to sum the field *COST* in this query where data in *STATUS* is equal to HELD and OPEN, so I will have 2 totals passed below and do not know where to begin . SELECT status, SUM(cost) FROM Table WHERE status IN ('HELD','OPEN') GROUP BY status

[PHP-DB] Query Problem

2003-12-16 Thread Larry Sandwick
I need to sum the field *COST* in this query where data in *STATUS* is equal to HELD and OPEN, so I will have 2 totals passed below and do not know where to begin . All information is in 1 table. Original query select distinct(Company_name), account, City, State from table where number =

Re: [PHP-DB] Query Sum problem

2003-12-16 Thread CPT John W. Holmes
From: Larry Sandwick [EMAIL PROTECTED] I appreciate the quick response, but I should have been more clear. I understand the query below, but I would only have 2 total and it is not group by the companies. The query below gives me the main information without totals. How do I add the 2

[PHP-DB] Query and math

2003-12-16 Thread Patrik Fomin
Hi, q1) i got a database with 2 diffrent tables, i want to take out all the information that arent duplicated from on of the tables, like this: $sql = SELECT t1.rubrik, t1.info, t2.priser FROM table1 AS t1, table2 AS t2 WHERE t1.arkiv = '0' ORDER BY t1.rubrik; the problem is that i got alot of

Re: [PHP-DB] Query Case In-sensitive

2003-11-19 Thread mustafa ocak
]; [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 5:46 AM Subject: Re: [PHP-DB] Query Case In-sensitive Generally in DBs, data is case sensitive. Simply you can do an uppercase or lowercase conversion in both sides. Ex : Select item number from item where upper(item_code) = upper(m1234

Re: [PHP-DB] Query Case In-sensitive

2003-11-19 Thread roy.a.jones
] cc Subject Re: [PHP-DB] Query Case In-sensitive Use LIKE clause instead of = SELECT item_number FROM item WHERE item_code LIKE 'M1234' ; This will perform case-insensitive matching on all databases I used before (Including Oracle, MySQL, SQL-Server) - Original Message

Re: [PHP-DB] Query Case In-sensitive

2003-11-19 Thread mustafa ocak
19, 2003 2:36 PM Subject: Re: [PHP-DB] Query Case In-sensitive As an Oracle DBA (9+ years, versions 7.x - 9.x) I just wanted to make a correction. The LIKE command uses wild card characters ( _ and % ) for substitutions. Oracle IS a case-sensitive RDBMS and the LIKE command will NOT do

Re: [PHP-DB] Query Case In-sensitive

2003-11-18 Thread Andrei Migatchev
] To [EMAIL PROTECTED] cc Subject [PHP-DB] Query Case In-sensitive Is there a way to run a query so that it ignores the case, and the query is not case sensitive? The data being stored is m1234 Query Select item number from item where item_code = M1234 ; The query above should return

[PHP-DB] Query Case In-sensitive

2003-11-17 Thread Larry Sandwick
Is there a way to run a query so that it ignores the case, and the query is not case sensitive? The data being stored is m1234 Query Select item number from item where item_code = M1234 ; The query above should return the data above. TIA Larry Sandwick Sarreid, Ltd.

  1   2   3   >