[PHP-DB] Re: Query does not work

2014-07-01 Thread Jim Giner
How about just showing us the section of code instead of disjoint pieces that WE cannot be sure are applied correctly? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: Query does not work

2014-07-01 Thread Aziz Saleh
On Tue, Jul 1, 2014 at 10:02 AM, Jim Giner jim.gi...@albanyhandball.com wrote: How about just showing us the section of code instead of disjoint pieces that WE cannot be sure are applied correctly? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP-DB] Re: Query does not work

2014-07-01 Thread Jim Giner
On 7/1/2014 10:26 AM, Aziz Saleh wrote: On Tue, Jul 1, 2014 at 10:02 AM, Jim Giner jim.gi...@albanyhandball.com wrote: How about just showing us the section of code instead of disjoint pieces that WE cannot be sure are applied correctly? -- PHP Database Mailing List (http://www.php.net/) To

[PHP-DB] Re: Query does not work

2014-07-01 Thread Jim Giner
Ethan - is error checking turned on as I showed you how to do EXACTLY last time you posted -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] mysql query

2013-08-22 Thread Michael Oki
To: Daniel Krook/White Plains/IBM@IBMUS Cc: PHP Database List php-db@lists.php.net Date: 08/21/2013 11:59 PM Subject: Re: [PHP-DB] mysql query On 08/21/2013 11:30 PM, Daniel Krook wrote: Ethan, It's hard to tell from the code formatting in your email what the exact problem might

Re: [PHP-DB] mysql query

2013-08-22 Thread Vinay Kannan
: From: Ethan Rosenberg erosenb...@hygeiabiomedical.com To: Daniel Krook/White Plains/IBM@IBMUS Cc: PHP Database List php-db@lists.php.net Date: 08/21/2013 11:59 PM Subject: Re: [PHP-DB] mysql query On 08/21/2013 11:30 PM, Daniel Krook wrote: Ethan, It's hard to tell from

[PHP-DB] mysql query

2013-08-21 Thread Ethan Rosenberg
Dear List - I can't figure this out mysql describe Inventory; +-+-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra | +-+-+--+-+-+---+ | UPC | varchar(14) | YES | |

Re: [PHP-DB] mysql query

2013-08-21 Thread Toby Hart Dyke
1) What is the error message? 2) This has an error: values ('$upc', $qnt,'$mnf','$itm', odrpt, 0, $stk) Missing '$' in front of 'odrpt'. Toby On 8/22/2013 12:48 AM, Ethan Rosenberg wrote: Dear List - I can't figure this out mysql describe Inventory;

Re: [PHP-DB] mysql query

2013-08-21 Thread Ethan Rosenberg
On 08/21/2013 07:52 PM, Toby Hart Dyke wrote: 1) What is the error message? 2) This has an error: values ('$upc', $qnt,'$mnf','$itm', odrpt, 0, $stk) Missing '$' in front of 'odrpt'. Toby On 8/22/2013 12:48 AM, Ethan Rosenberg wrote: Dear List - I can't figure this out mysql

Re: [PHP-DB] mysql query

2013-08-21 Thread Daniel Krook
/21/2013 07:48:12 PM: From: Ethan Rosenberg erosenb...@hygeiabiomedical.com To: PHP Database List php-db@lists.php.net Date: 08/21/2013 07:48 PM Subject: [PHP-DB] mysql query Dear List - I can't figure this out mysql describe Inventory

Re: [PHP-DB] mysql query

2013-08-21 Thread Daniel Krook
@IBMUS Cc: PHP Database List php-db@lists.php.net Date: 08/21/2013 11:59 PM Subject: Re: [PHP-DB] mysql query On 08/21/2013 11:30 PM, Daniel Krook wrote: Ethan, It's hard to tell from the code formatting in your email what the exact problem might be, but a few reasons that this might fail

[PHP-DB] One query, different tables?

2013-08-09 Thread Karl-Arne Gjersøyen
Hello. I am newbie in this and need som basic help. I have a form witch checkbox'es with different serialnumbers. The serialnumbers reflect different products and every product category have their own tables. I can transfer items from store to truck but can't transfer them back to store. I have

Re: [PHP-DB] One query, different tables?

2013-08-09 Thread Niel Archer
Hello. I am newbie in this and need som basic help. I have a form witch checkbox'es with different serialnumbers. The serialnumbers reflect different products and every product category have their own tables. This sounds like a database design question more than a PHP one. I can

Re: [PHP-DB] One query, different tables?

2013-08-09 Thread Bastien Koert
Why do you have to tables with products? Couldn't you have a type or category column and then have to only query one table? Bastien On Fri, Aug 9, 2013 at 11:52 AM, Niel Archer n...@chance.now wrote: Hello. I am newbie in this and need som basic help. I have a form witch checkbox'es

[PHP-DB] excec / query on Sqlite3

2013-05-20 Thread Gilles
Hello, I'm not sure if it's a bug : $o_sqlite3=new SQLite3('test.sqlite'); $r=$o_sqlite3-exec(''); echo'pre';var_dump($r);echo'/pre'; // bool(true) $r=$o_sqlite3-query(''); echo'pre';var_dump($r);echo'/pre'; // bool(false) $r=$o_sqlite3-exec(false); echo'pre';var_dump($r);echo'/pre'; //

Re: [PHP-DB] excec / query on Sqlite3

2013-05-20 Thread Matijn Woudt
On Mon, May 20, 2013 at 2:35 PM, Gilles g...@live.fr wrote: Hello, I'm not sure if it's a bug : $o_sqlite3=new SQLite3('test.sqlite'); $r=$o_sqlite3-exec(''); echo'pre';var_dump($r);echo'**/pre'; // bool(true) $r=$o_sqlite3-query(''); echo'pre';var_dump($r);echo'**/pre'; //

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

2013-02-03 Thread David Robley
Ethan Rosenberg, PhD wrote: What am I doing wrong?? Not checking the errors that mysql returns? -- Cheers David Robley Tennis in the Bible: Moses served in Pharaoh's court... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Insert query error

2011-08-06 Thread Gavin Chalkley
Chris, Why not escape, and extract the data prior to Insert string? On 06/08/2011 05:41, Chris Stinemetz wrote: I am getting the following error trying to run the below query. Any suggestions on what I am doing wrong? Thank you, Something went wrong while inserting your store visitCannot add

Re: [PHP-DB] Insert query error

2011-08-06 Thread Amit Tandon
Chris The error is indicated by the keywords a foreign key constraint fails, This implies that some value in store table is missing which u are trying to insert in posts. So check for the value u are trying to input in post table. U have to check for the values of post_store field from the input

[PHP-DB] Insert query error

2011-08-05 Thread Chris Stinemetz
I am getting the following error trying to run the below query. Any suggestions on what I am doing wrong? Thank you, Something went wrong while inserting your store visitCannot add or update a child row: a foreign key constraint fails (`store`.`posts`, CONSTRAINT `posts_ibfk_1` FOREIGN KEY

[PHP-DB] UPDATE query

2011-03-08 Thread Ron Piggott
I am wondering if there is a way to do an UPDATE query where only some of the text changes. The column I need to modify is named “toll_free” What I need to search for is: 800- I need it to replace it with is 1-800- - BUT I don’t want to change instances of 1-800- - I need to leave the rest

Re: [PHP-DB] UPDATE query

2011-03-08 Thread Bastien Koert
On Tue, Mar 8, 2011 at 11:16 AM, Ron Piggott ron.pigg...@actsministries.org wrote: I am wondering if there is a way to do an UPDATE query where only some of the text changes. The column I need to modify is named “toll_free” What I need to search for is: 800- I need it to replace it with is

Re: [PHP-DB] UPDATE query

2011-03-08 Thread Ron Piggott
I was wondering this Bastien. Ron The Verse of the Day “Encouragement from God’s Word” http://www.TheVerseOfTheDay.info -Original Message- From: Bastien Koert Sent: Tuesday, March 08, 2011 11:20 AM To: Ron Piggott Cc: php-db@lists.php.net Subject: Re: [PHP-DB] UPDATE query On Tue

Re: [PHP-DB] UPDATE query

2011-03-08 Thread Ron Piggott
, March 08, 2011 11:20 AM To: Ron Piggott Cc: php-db@lists.php.net Subject: Re: [PHP-DB] UPDATE query On Tue, Mar 8, 2011 at 11:16 AM, Ron Piggott ron.pigg...@actsministries.org wrote: I am wondering if there is a way to do an UPDATE query where only some of the text changes. The column I need

[PHP-DB] COUNT() query help

2010-08-13 Thread Ron Piggott
I am making a Bible concordance. I need help with the query that figures out how many times each word is in the Bible. The COUNT() in the query below is giving me the total number of words for the letter of the alphabet, not the specific word, and is causing there to be only 1 search result. I

Re: [PHP-DB] COUNT() query help

2010-08-13 Thread Richard Quadling
On 13 August 2010 13:43, Ron Piggott ron.pigg...@actsministries.org wrote: SELECT `bible_concordance_words`.`reference`, `bible_concordance_words`.`word`, COUNT(`bible_concordance_word_reference`.`bible_concordance_words_reference`) AS occurrences FROM `bible_concordance_words` INNER JOIN

[PHP-DB] Broken query

2010-07-11 Thread Ron Piggott
I am trying to write a query to select a trivia question, but I don't want the trivia question category to be the same two days in a row so I added a second SELECT syntax to find out what category was used yesterday. This works when I test it live, but doesn't work when it is part of a cron job.

Re: [PHP-DB] Broken query

2010-07-11 Thread Patrick Price
How is the last mailing date variable set? Have you tried printing out the queries that are run when it is run manually and when it is run as a cron to find any differences? -patrick On Jul 11, 2010 8:23 AM, Ron Piggott ron.pigg...@actsministries.org wrote: I am trying to write a query to

Re: [PHP-DB] Broken query

2010-07-11 Thread Niel Archer
I am trying to write a query to select a trivia question, but I don't want the trivia question category to be the same two days in a row so I added a second SELECT syntax to find out what category was used yesterday. This works when I test it live, but doesn't work when it is part of a cron

[PHP-DB] Login query

2010-02-18 Thread Ron Piggott
I am wondering what others do for a login query. I think there could be two results: correct e-mail password; correct e-mail wrong password So far my login query is: SELECT * FROM `member` WHERE `email` = '$my_email' AND `pass` LIKE BINARY '$my_password' LIMIT 1 This wouldn't tell me if the

Re: [PHP-DB] Login query

2010-02-18 Thread Bastien Koert
On Thu, Feb 18, 2010 at 4:40 PM, Ron Piggott ron@actsministries.org wrote: I am wondering what others do for a login query.  I think there could be two results: correct e-mail password; correct e-mail wrong password So far my login query is: SELECT * FROM `member` WHERE `email` =

Re: [PHP-DB] Login query

2010-02-18 Thread Chris
Bastien Koert wrote: On Thu, Feb 18, 2010 at 4:40 PM, Ron Piggott ron@actsministries.org wrote: I am wondering what others do for a login query. I think there could be two results: correct e-mail password; correct e-mail wrong password So far my login query is: SELECT * FROM `member`

Re: [PHP-DB] Mysql query

2009-12-14 Thread Chris
ron.pigg...@actsministries.org wrote: The query from my previous post was only part of a larger query. This is the entire query: SELECT GREATEST( IF( CURDATE( ) = DATE_SUB( DATE( FROM_UNIXTIME( 1239508800 ) ) , INTERVAL LEAST( 14, ( SELECT COUNT( * ) FROM `verse_of_the_day_Bible_verses` WHERE

Re: [PHP-DB] Mysql query

2009-12-14 Thread ron . piggott
Chris I spent 3 hours debugging this query myself. I got as far as putting '' around 2009-12-25 to get the desired results. I just added the word DATE. It works, thanks. Chris I run a verse of the day e-mail list. This query determines the logic of the content (year round, Easter and

[PHP-DB] Mysql query

2009-12-13 Thread ron . piggott
Does anyone see anything wrong with this query? Do I have one of the , = or mixed up? The purpose is to figure out if it is within 14 days of Christmas AND if there is content for Christmas available. 2 is symbolic in the database being Christmas. Ron IF( CURDATE( ) = DATE_SUB(

[PHP-DB] Mysql query

2009-12-13 Thread ron . piggott
The query from my previous post was only part of a larger query. This is the entire query: SELECT GREATEST( IF( CURDATE( ) = DATE_SUB( DATE( FROM_UNIXTIME( 1239508800 ) ) , INTERVAL LEAST( 14, ( SELECT COUNT( * ) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use =1 ) ) DAY ) AND CURDATE(

[PHP-DB] mySQL query syntax error

2009-11-14 Thread Ron Piggott
I am getting the following error message: #1054 - Unknown column 'customers.email' in 'order clause' from the query below --- I don't understand why. Would someone help me please? Ron SELECT 'first_name', 'last_name', 'email' FROM ( ( SELECT `firstname` , `lastname` , `buyer_email` FROM

Re: [PHP-DB] mySQL query syntax error

2009-11-14 Thread Ron Piggott
I found the problem. The first subquery needed AS aliases. I am learning more of what mySQL is capable of and appreciate the help. Ron -Original Message- From: TG tg-...@gryffyndevelopment.com To: ron.pigg...@actsministries.org Subject: Re: [PHP-DB] mySQL query syntax error Date: Sat

RE: [PHP-DB] Postgres query failing, not enough info for debugging...

2009-06-17 Thread Ford, Mike
On 16 June 2009 15:57, Carol Walter advised: Hello, I'm using PHP 5 and PostgreSQL 8.3.6. I have a query that is failing and I don't know how to troubleshoot the problem. The error message that it is giving is quite vague. The error message is as follows: Warning: pg_query_params()

[PHP-DB] Postgres query failing, not enough info for debugging...

2009-06-16 Thread Carol Walter
Hello, I'm using PHP 5 and PostgreSQL 8.3.6. I have a query that is failing and I don't know how to troubleshoot the problem. The error message that it is giving is quite vague. The error message is as follows: Warning: pg_query_params() [function.pg-query-params]: Query failed:

Re: [PHP-DB] Postgres query failing, not enough info for debugging...

2009-06-16 Thread Carol Walter
Yes, I have read that documentation. I have other queries in this same program with a similar structure that do work. One of these is as follows: $pg_pres_ins4 = pg_query_params(INSERT INTO \brdgPresenters \ (\peopleId\,\presentationEventId\) VALUES ($1,

Re: [PHP-DB] PostgreSQL query many escape characters?

2009-05-02 Thread John DeSoi
On May 1, 2009, at 3:59 PM, Carol Walter wrote: It would be much easier to read and write like this: $query = 'INSERT INTO tblPeople(fName,mName,lName, ivlweb, cnsweb)' . VALUES ($new_f_name_new, $new_m_name_new, $new_l_name_new, $new_ivl_web_peop, $new_cns_web_peop);; First query:

[PHP-DB] PostgreSQL query many escape characters?

2009-05-01 Thread Carol Walter
Hello, I am very new to this process, so please forgive me if this is a silly question. I have a number of PostgreSQL tables that use the naming convention that capitalizes the first character of each word, therefor the data names require quotes. When I put together my queries using

Re: [PHP-DB] PostgreSQL query many escape characters?

2009-05-01 Thread danaketh
Hi, you should post the INSERT query too. I'd recommend you to print the query before running it. Just put echo $query; before/after pg_query(). You'll see what are you sending to the database. This may help you find the problem. Also using ` instead of in query may help you to make it

Re: [PHP-DB] PostgreSQL query many escape characters?

2009-05-01 Thread Carol Walter
Okay, Here are the queries I've written. I gave up on trying to make pg_query_params() work but this is what I have using pg_query(). I have been printing the query. In fact, I can take the query as constructed, paste it into psql and it runs just fine. I would be grateful for any

RE: [PHP-DB] MySQL query executes outside of PHP, but not in PHP

2009-01-26 Thread Dave.McGovern
snip error_log(Hey, the SQL is: $sql); Then look in your php error log (you do have error logging enabled, right?) [McGovern, Dave] Enabled, yes. Usefully enabled, no (correcting this helped a lot). If that SQL in the error log is fine, then your problem is

[PHP-DB] MySQL query executes outside of PHP, but not in PHP

2009-01-23 Thread Dave.McGovern
Hi, I am running: PHP 5.2.8, Apache 2.2.11, MySQL 5.1.30 on Win32/XP. I have a number of queries on my page which are very similar in structure, and they all work except for the following one. $mysql['process'] = $client2-real_escape_string($clean['process']); $sql = SELECT f.name,

Re: [PHP-DB] MySQL query executes outside of PHP, but not in PHP

2009-01-23 Thread Peter Beckman
On Fri, 23 Jan 2009, dave.mcgov...@sungard.com wrote: Hi, I am running: PHP 5.2.8, Apache 2.2.11, MySQL 5.1.30 on Win32/XP. I have a number of queries on my page which are very similar in structure, and they all work except for the following one. $mysql['process'] =

[PHP-DB] SELECT query

2008-12-21 Thread Ron Piggott
I am working on a web based Bible searching query. So far I am able to generate: SELECT * FROM `bible_verses` INNER JOIN `bible_books` ON `bible_books`.`id` = `bible_verses`.`b` WHERE `t` IN ( 'Lord' , 'Jesus' ) LIMIT 0 , 10 Is an IN the correct syntax to use? I am trying to take what the user

Re: [PHP-DB] MySQL Query Timeout program in PHP

2008-10-31 Thread Thodoris
Man- when the query is fired through the web interface- it rans on mysql server max_execution_time - wont' help evn I stop apache itself... Yes it will. Apache will be instructed to stop execution of any script by the mod_php module (assuming you are using mod_php). But mysql

[PHP-DB] MySQL Query Timeout program in PHP

2008-10-15 Thread Piyush Kumar
I'm using http://myclient.polarlava.com/ as web query interface for mysql server Now I want to add Query Timeout functionality to it For that I need to get the PID for last ran mysql query and then using kill PID - I can kill the process on MySQL server Please explain how to do that in PHP

Re: [PHP-DB] MySQL Query Timeout program in PHP

2008-10-15 Thread Chris
Piyush Kumar wrote: I'm using http://myclient.polarlava.com/ as web query interface for mysql server Now I want to add Query Timeout functionality to it For that I need to get the PID for last ran mysql query and then using kill PID - I can kill the process on MySQL server Please explain how

Re: [PHP-DB] MySQL Query Timeout program in PHP

2008-10-15 Thread Jack van Zanen
Just put the time out in your PHP.INI file max_execution_time = 30 ; Maximum execution time of each script, in seconds 2008/10/16 Piyush Kumar [EMAIL PROTECTED] I'm using http://myclient.polarlava.com/ as web query interface for mysql server Now I want to add Query Timeout functionality

Re: [PHP-DB] MySQL Query Timeout program in PHP

2008-10-15 Thread Piyush Kumar
Man- when the query is fired through the web interface- it rans on mysql server max_execution_time - wont' help evn I stop apache itself... The query runs on mysql server - so I have to kill the PID on server itself... Thanks Piyush On Thu, Oct 16, 2008 at 7:57 AM, Jack van Zanen [EMAIL

Fwd: [PHP-DB] MySQL Query Timeout program in PHP

2008-10-15 Thread Piyush Kumar
-- Forwarded message -- From: Piyush Kumar [EMAIL PROTECTED] Date: Thu, Oct 16, 2008 at 9:09 AM Subject: Re: [PHP-DB] MySQL Query Timeout program in PHP To: Chris [EMAIL PROTECTED] Hi Chris, As I mentioned in my query I want to Kill only the query ran by web client not all

Re: [PHP-DB] MySQL Query Timeout program in PHP

2008-10-15 Thread Chris
Piyush Kumar wrote: Hi Chris, As I mentioned in my query I want to Kill only the query ran by web client not all queries running on the server. The perl script kill all queries - which are been running from for last 120(or any threshold set) Issues: How do I get the PID of my last select

Re: [PHP-DB] MySQL Query Timeout program in PHP

2008-10-15 Thread Chris
Piyush Kumar wrote: show full processlist ; gives me whole query -- but I want some php function -- like mysql_info() -- to return the PID of last run query Please do not email me directly. Always send to the mailing list. If it's not listed under php.net/mysql somewhere, then it's not

Re: [PHP-DB] If( Query)

2008-09-08 Thread Chris Hale
Niel Archer wrote: Hi I have the following function: function add_item($item_name,$item_desc,$item_price,$item_man_id,$item_cat_id,$item_pix) { connect(); if($item_pix == ) { $sql = INSERT INTO items (item_name,item_desc,item_price,item_man_id,item_cat_id) VALUES

Re: [PHP-DB] If( Query)

2008-09-08 Thread Evert Lammerts
You need to run mysql_real_escape_string() on all of your input variables before using them: function editproduct($item_id, $item_name, $item_desc, $item_price, $item_pix, $item_man_id, $item_cat_id) { $item_id = mysql_real_escape_string($item_id); $item_name =

Re: [PHP-DB] If( Query)

2008-09-08 Thread Evert Lammerts
Do a print on the query: function editproduct($item_id, $item_name, $item_desc, $item_price, $item_pix, $item_man_id, $item_cat_id) { $item_id = mysql_real_escape_string($item_id); $item_name = mysql_real_escape_string($item_name); $item_desc =

Re: [PHP-DB] If( Query)

2008-09-08 Thread Evert Lammerts
all of us do, it's subscribed to the list. i filter it out. On Mon, Sep 8, 2008 at 7:06 PM, Chris Hale [EMAIL PROTECTED] wrote: Evert Lammerts wrote: My bad! Forgot the dollar signs This should work: function editproduct($item_id, $item_name, $item_desc, $item_price, $item_pix,

Re: [PHP-DB] If( Query)

2008-09-07 Thread Evert Lammerts
Is your table set up in the same way on your webserver? Maybe you forgot to set the default value to na.gif in your item_pix column. If not, can you send your table definition? On Sat, Sep 6, 2008 at 9:02 PM, Chris Hale [EMAIL PROTECTED] wrote: I have the following function: function

Re: [PHP-DB] If( Query)

2008-09-07 Thread Niel Archer
Hi I have the following function: function add_item($item_name,$item_desc,$item_price,$item_man_id,$item_cat_id,$item_pix) { connect(); if($item_pix == ) { $sql = INSERT INTO items (item_name,item_desc,item_price,item_man_id,item_cat_id) VALUES

Re: [PHP-DB] If( Query)

2008-09-07 Thread Chris Hale
Niel Archer wrote: Hi I have the following function: function add_item($item_name,$item_desc,$item_price,$item_man_id,$item_cat_id,$item_pix) { connect(); if($item_pix == ) { $sql = INSERT INTO items (item_name,item_desc,item_price,item_man_id,item_cat_id) VALUES

[PHP-DB] If( Query)

2008-09-06 Thread Chris Hale
I have the following function: function add_item($item_name,$item_desc,$item_price,$item_man_id,$item_cat_id,$item_pix) { connect(); if($item_pix == ) { $sql = INSERT INTO items (item_name,item_desc,item_price,item_man_id,item_cat_id) VALUES

[PHP-DB] Slow query

2008-07-23 Thread Steven Macintyre
Hi all, Below is the query we are getting a slow response on ... 2seconds ... with 4 records we were hoping to get it much quicker. Can someone advise if i can optimise this? SELECT s.movie_id, m.movie_name, movie_shortname, image_name, image_extension, m.trailerAvail FROM sessions AS s LEFT

Re: [PHP-DB] Slow query

2008-07-23 Thread Chris
Steven Macintyre wrote: Hi all, Below is the query we are getting a slow response on ... 2seconds ... with 4 records we were hoping to get it much quicker. Can someone advise if i can optimise this? SELECT s.movie_id, m.movie_name, movie_shortname, image_name, image_extension,

Re: [PHP-DB] Slow query

2008-07-23 Thread Bastien Koert
On Wed, Jul 23, 2008 at 4:48 AM, Chris [EMAIL PROTECTED] wrote: Steven Macintyre wrote: Hi all, Below is the query we are getting a slow response on ... 2seconds ... with 4 records we were hoping to get it much quicker. Can someone advise if i can optimise this? SELECT

[PHP-DB] Select query with Forein key Relation

2008-04-23 Thread Nasreen Laghari
Hi, I have a table which contains 2 foreign key relation columns. I'm trying to get all columns from main table as well as all column from those 2 foreign key relation tables. The query i'm using is : select * from gig where gig.gigid = $gigDetail LEFT JOIN genre ON

Re: [PHP-DB] Select query with Forein key Relation

2008-04-23 Thread Evert Lammerts
SELECT * FROM gig LEFT JOIN genre ON gig.genreId = genre.genreId LEFT JOIN venue ON gig.venueID = venue.vid WHERE gig.gigid = $gigdetail I'd replace the dash with [table].[columnames]. Also, you're using four different naming conventions in your columns - gigid, genreId, venueID and vid. If I

Re: [PHP-DB] Select query with Forein key Relation

2008-04-23 Thread Evert Lammerts
($result)) {/ /$sub= $row[venue].[vname];/ /}/ Regards - Original Message From: Evert Lammerts [EMAIL PROTECTED] To: Nasreen Laghari [EMAIL PROTECTED] Cc: php-db@lists.php.net Sent: Wednesday, April 23, 2008 11:48:39 AM Subject: Re: [PHP-DB] Select query with Forein key Relation

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

2008-03-21 Thread Neil Smith [MVP, Digital media]
At 14:12 21/03/2008, you wrote: Message-ID: [EMAIL PROTECTED] Date: Thu, 20 Mar 2008 11:05:22 -0500 From: Dee Ayy [EMAIL PROTECTED] To: php-db@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: Query Across DBMS Boundaries

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

2008-03-20 Thread Dee Ayy
Wow! I just found the Federated Storage Engine. http://dev.mysql.com/tech-resources/articles/mysql-federated-storage.html It's not in our SHOW ENGINES though. I still welcome comments. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] SELECT query from two tables

2008-03-09 Thread Ron Piggott
I am wondering what is wrong with this syntax? SELECT * FROM ministry_directory INNER JOIN ministry_directory_listing_categories ON ministry_directory.entry = ministry_directory_listing_categories.ministry_directory_entry WHERE ministry_directory.listing_type = 2 AND

Re: [PHP-DB] SELECT query from two tables

2008-03-09 Thread Chris
ministry_directory_listing_categories.ministry_directory_category_reference = 10 AND ministry_directory_listing_categories.ministry_directory_category_reference = 11 Can a record really have a reference for two different id's like this? ie can it be both '10' and '11' at the same time?

Re: [PHP-DB] SELECT query from two tables

2008-03-09 Thread Ron Piggott
Two different rows Chris. reference ministry_directory_entry ministry_directory_category_reference 13 1 10 14 1 11 What I am trying to do is allow the user to make a more specific search. Ron On Mon, 2008-03-10 at 10:37 +1100, Chris wrote:

Re: [PHP-DB] SELECT query from two tables

2008-03-09 Thread Chris
Ron Piggott wrote: Two different rows Chris. That's the problem then. Your query is saying get records with category_reference of 10 and it has to have category_reference of 11 as well. No such rows exist. Maybe that should be an 'or' or 'in' (same thing). ...

Re: [PHP-DB] SELECT query from two tables

2008-03-09 Thread Bruce Cowin
I think what you mean to do is use IN(). And I would suggest table aliases. So it could look like this: SELECT * FROM ministry_directory md INNER JOIN ministry_directory_listing_categories mdlc ON md.entry = mdlc.ministry_directory_entry WHERE md.listing_type = 2 AND

Re: [PHP-DB] SELECT query from two tables

2008-03-09 Thread Ron Piggott
Thanks On Mon, 2008-03-10 at 12:56 +1300, Bruce Cowin wrote: I think what you mean to do is use IN(). And I would suggest table aliases. So it could look like this: SELECT * FROM ministry_directory md INNER JOIN ministry_directory_listing_categories mdlc ON md.entry =

[PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Nasreen Laghari
Hi All, Thank you for increasing my knowledge about PHP/MYSQL. I am creating a SEARCH, by only using one table. The search form is same as Inserting item (search has form of all fields in table ), difference is SEARCH page doesnt have validation . Therefore user can enter information in any

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Chris
$query = mysql_query(SELECT * from gig WHERE gigName='$gig_name' OR WHERE gig_fdate='$sdate'); This one. I'd suggest you get a book to help you with the basics, something like this should do (first hit in amazon, haven't actually read this particular book):

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Greg Bowser
In MySQL, both OR and || are valid logical or operators. You can only have one Where clause, thus your last example is correct. --GREG On Wed, Feb 27, 2008 at 6:44 PM, Nasreen Laghari [EMAIL PROTECTED] wrote: Hi All, Thank you for increasing my knowledge about PHP/MYSQL. I am creating a

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Chris
Greg Bowser wrote: In MySQL, both OR and || are valid logical or operators. You can only have one Where clause, thus your last example is correct. Though in postgresql and db2 (and some other dbs) || means concatenate so stick with using the word OR in this situation otherwise you'll run

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Daniel Brown
On Wed, Feb 27, 2008 at 6:44 PM, Nasreen Laghari [EMAIL PROTECTED] wrote: I am creating a SEARCH, by only using one table. The search form is same as Inserting item (search has form of all fields in table ), difference is SEARCH page doesnt have validation . Therefore user can enter

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Stut
On 27 Feb 2008, at 23:44, Nasreen Laghari wrote: Thank you for increasing my knowledge about PHP/MYSQL. The question you ask below is basic SQL syntax. Please read the MySQL manual before asking here - answers at this level are all in there. http://mysql.com/doc Oh, and once you have it

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Stephen Johnson
http://www.fortheloveofgeeks.com I¹m a geek and I¹m OK! -- From: Nasreen Laghari [EMAIL PROTECTED] Date: Wed, 27 Feb 2008 15:44:23 -0800 (PST) To: php-db@lists.php.net Subject: [PHP-DB] SELECT query with multiple WHERE Clause $query = mysql_query(SELECT * from gig WHERE gigName

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread TG
PROTECTED] To: php-db@lists.php.net Date: Wed, 27 Feb 2008 15:44:23 -0800 (PST) Subject: [PHP-DB] SELECT query with multiple WHERE Clause Hi All, Thank you for increasing my knowledge about PHP/MYSQL. I am creating a SEARCH, by only using one table. The search form is same as Inserting item

RES: [PHP-DB] INSERT query with Primary and foreign key

2008-02-26 Thread Thiago Pojda
This is more SQL than PHP, how did you create your constraints? Did you set insert on CASCADE? -Mensagem original- De: Nasreen Laghari [mailto:[EMAIL PROTECTED] Enviada em: segunda-feira, 25 de fevereiro de 2008 22:15 Para: php-db@lists.php.net Assunto: [PHP-DB] INSERT query

RE: RES: [PHP-DB] INSERT query with Primary and foreign key

2008-02-26 Thread Bastien Koert
: [PHP-DB] INSERT query with Primary and foreign key This is more SQL than PHP, how did you create your constraints? Did you set insert on CASCADE? -Mensagem original- De: Nasreen Laghari [mailto:[EMAIL PROTECTED] Enviada em: segunda-feira, 25 de fevereiro de 2008 22:15 Para: php

Re: [PHP-DB] INSERT query with Primary and foreign key

2008-02-26 Thread Daniel Brown
On Mon, Feb 25, 2008 at 8:15 PM, Nasreen Laghari [EMAIL PROTECTED] wrote: Hi, I need help to insert date into two tables when tables have primary and foreign key relationship using php. I tried simple INSERT query but foreign key colum is storing NULL. What's your SQL query string,

[PHP-DB] INSERT query with Primary and foreign key

2008-02-25 Thread Nasreen Laghari
Hi, I need help to insert date into two tables when tables have primary and foreign key relationship using php. I tried simple INSERT query but foreign key colum is storing NULL. Regards Nasreen Be a

[PHP-DB] Corrupted query results in memory.

2007-11-09 Thread Max Thayer
I posted an issue to the mysql dev forums last week with regards to an issue we are encountering. The issue as we understood it last week was simple...after some time (undetermined as of then) query results from the web app (a PHP/MySQL/Javascript Ajax app.) would come back all 'wonky.' Upon

RE: [PHP-DB] Corrupted query results in memory.

2007-11-09 Thread Instruct ICC
This morning I figured out how to replicate the issue. Issue a double request for the mysql result set. Due to the Ajaxy nature of my web app it isn't the same as a double HTTPRequest of POST, as it is requesting a result set back from the database twice in a row before the response is

RE: [PHP-DB] Corrupted query results in memory.

2007-11-09 Thread Bastien Koert
so the simple solution is to disable the button after the call until the results are returned bastien Date: Fri, 9 Nov 2007 15:02:31 -0500 From: [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] Corrupted query results in memory. I posted an issue to the mysql dev forums last

[PHP-DB] Re: Query executing

2007-10-05 Thread Thomas Tschernich
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? www.php.net/mysql_affected_rows Greetings, Thomas Tschernich -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP-DB] multiple query deletion in mysql

2007-07-25 Thread lameck kassana
hey i have many records in my database and i want delete many records with checkbox form .I did many ways but no success. please help -- laskkkassana

Re: [PHP-DB] Optimizing Query

2007-07-25 Thread OKi98
Arie Nugraha napsal(a): Hi list, I Have a problem with my query that fetch about 22.000 records from database, the query is like this : SELECT SQL_CALC_FOUND_ROWS DISTINCT b.biblio_id, b.title, a.author_name FROMbiblio AS b LEFT JOIN biblio_author AS ba ON b.biblio_id=ba.biblio_id LEFT JOIN

Re: [PHP-DB] multiple query deletion in mysql

2007-07-25 Thread Chris
lameck kassana wrote: hey i have many records in my database and i want delete many records with checkbox form .I did many ways but no success. I've used this technique many times and it works fine. Are you getting the checkbox values to come through your form properly? Are you having

Re: [PHP-DB] Slooooow query in MySQL.

2007-07-24 Thread Aleksandar Vojnovic
In addition to Chris's suggestions you should also alter the homeid column (set default to NULL and update the whole database which shouldn't be a problem) so you don't have to do a double check on the same column. I would also suggest that the TSCN_MEDIAid column should be an int not a

[PHP-DB] Optimizing Query

2007-07-24 Thread Arie Nugraha
Hi list, I Have a problem with my query that fetch about 22.000 records from database, the query is like this : SELECT SQL_CALC_FOUND_ROWS DISTINCT b.biblio_id, b.title, a.author_name FROMbiblio AS b LEFT JOIN biblio_author AS ba ON b.biblio_id=ba.biblio_id LEFT JOIN mst_author AS a ON

  1   2   3   4   5   >