Re: [PHP-DB] Question about databases and foreign keys

2008-09-15 Thread Philip Thompson
On Sep 15, 2008, at 2:12 PM, Micah Gersten wrote: You'll actually want to have the User Id in the clocking table, not the other way around. User Id is the foreign key because it has a many to one relationship with the time logging. Thank you, Micah Gersten onShore Networks Internal Developer

Re: [PHP-DB] Question about databases and foreign keys

2008-09-15 Thread Micah Gersten
You'll actually want to have the User Id in the clocking table, not the other way around. User Id is the foreign key because it has a many to one relationship with the time logging. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Philip Thompson wrote: > > >

Re: [PHP-DB] Question about databases and foreign keys

2008-09-15 Thread Thodoris
On Sep 15, 2008, at 10:59 AM, Micah Gersten wrote: Use 2 tables. You never know what the app might grow into and you should do it right the first time. That's what I was thinking too... Just wanted to hear it from someone else... NOW I get to learn about foreign keys and how to update thi

Re: [PHP-DB] Question about databases and foreign keys

2008-09-15 Thread Philip Thompson
On Sep 15, 2008, at 10:03 AM, Jason Pruim wrote: On Sep 15, 2008, at 10:59 AM, Micah Gersten wrote: Use 2 tables. You never know what the app might grow into and you should do it right the first time. That's what I was thinking too... Just wanted to hear it from someone else... NOW I get

Re: [PHP-DB] Question about databases and foreign keys

2008-09-15 Thread Jason Pruim
On Sep 15, 2008, at 10:59 AM, Micah Gersten wrote: Use 2 tables. You never know what the app might grow into and you should do it right the first time. That's what I was thinking too... Just wanted to hear it from someone else... NOW I get to learn about foreign keys and how to update thin

Re: [PHP-DB] Question about databases and foreign keys

2008-09-15 Thread Micah Gersten
Use 2 tables. You never know what the app might grow into and you should do it right the first time. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Jason Pruim wrote: > Hi everyone, > > I just wanted to make sure that I am not making something more > compli

Re: [PHP-DB] Question about access rights in php/mysql

2008-08-26 Thread Jason Pruim
On Aug 26, 2008, at 8:32 AM, Dan Shirah wrote: Hi Everyone, I am attempting to wrap my head around an issue and wanted to see if I was thinking right. I am attempting to setup a pURL site, one where they go to something like: example.com/purl.php?purl=jason1234 and the site says "Welcome

Re: [PHP-DB] Question about access rights in php/mysql

2008-08-26 Thread Dan Shirah
> > Hi Everyone, > > I am attempting to wrap my head around an issue and wanted to see if I was > thinking right. > > I am attempting to setup a pURL site, one where they go to something like: > example.com/purl.php?purl=jason1234 and the site says "Welcome Jason". I > have that part of it working,

RE: [PHP-DB] Question about database design

2007-10-24 Thread Bastien Koert
Nope, you got it Bastien > CC: php-db@lists.php.net> From: [EMAIL PROTECTED]> Subject: Re: [PHP-DB] Question about database design> Date: Wed, 24 Oct 2007 15:18:05 -0400> To: [EMAIL PROTECTED]>> I think I understand what you are sayin

Re: [PHP-DB] Question about database design

2007-10-24 Thread Tony Grimes
A second address table is definitely the way to go (the '*' signifies the primary key): People Table *user_id first_name last_name etc Address Table (compound primary key) = *user_id (fk to People Table) *address_id *obs_no (you can skip this if you don't want to keep an

Re: [PHP-DB] Question about database design

2007-10-24 Thread Jason Pruim
I think I understand what you are saying here... On the main table just list the persons name and then on a second table use a 1 to many relationship on a foreign key to link all the addresses into the name? Or did I miss the mark? :) On Oct 24, 2007, at 9:30 AM, Bastien Koert wrote: I wo

Re: [PHP-DB] Question about database design

2007-10-24 Thread Jason Pruim
Hi Tim, Right now the customer I have has about 1,000 records which I know isn't alot for MySQL to handle, but if people like the application we could end up with 15 to 20 all having around 1,000 or more records which would add up more on the database. Although right now I plan to have a

RE: [PHP-DB] Question about database design

2007-10-24 Thread Bastien Koert
I would approach this by having a main people table (with a unique id of course) and then create a second addresses table which uses the people Id key as the foreign key to this table...then you can have multiple (more than two) addresses for those users, you could add a season in the addresses

Re: [PHP-DB] Question about database design

2007-10-24 Thread Tim McGeary
Hi Jason, There are a couple ways you could do this. Yes, this would make it a relational database. If you go with a second table, you'll want to be sure to include the UID from the main address table in the "SnowBirds" table so that they are linked. The UID in the second table would actua

Re: [PHP-DB] Question about Classes

2006-06-08 Thread Chris
Andrew Darby wrote: Hello, all. I have a sort of theoretical/sort of dumb question about PHP classes, which I haven't really worked with and don't entirely understand the purpose of, so here goes: Say i want to handle the add or update or delete of an item to a MySQL db, and instead of having t

RE: [PHP-DB] Question about COUNT(*)

2005-07-07 Thread Erick Wellem
Thanks Rory, This query solves the problem: SELECT client.client_name, IFNULL( COUNT( sales.sale_id ) , 0 ) AS total FROM CLIENT LEFT JOIN sales ON client.client_id = sales.client_id GROUP BY client.client_name ORDER BY total DESC Also thanks to Nandar and Prabhu, but MySQL does not recognize '*

Re: [PHP-DB] Question about COUNT(*)

2005-07-06 Thread Rory McKinley
[EMAIL PROTECTED] wrote: > Hi, > > Let's say that I have 2 tables: client and sales > --- > | client_id | client_name | > --- > | 1 | John| > | 2 | Mark| > | 3 | Luke| > | 4 | Matthew | > --

Re: [PHP-DB] Question about COUNT(*)

2005-07-06 Thread Nandar
try this SELECT client_name, COUNT(sale.client_id) as total FROM client, sale WHERE client.client_id *= sale.client_id GROUP BY client_name ORDER BY total DESC nandar - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Wednesday, July 06, 2005 1:11 PM Subject: [PHP-DB] Question abo

Re: [PHP-DB] Question about undices for inversed LIKE statesments.

2004-05-31 Thread Daniel Clark
The index should still work normally. >>Hello. >>I have a question about behaviour of indices in queries with inversed LIKE >>in MySQL. I mean something like this: >> >>"select foo from bar where '$some_string' LIKE some_field" >> >>where in the `some_field` I have a strings like 'symbols%' :) >>

Re: [PHP-DB] question about '

2003-07-18 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Hi there, > > The problem is the data is already in the DB, it was mass-added with the ' > already there, what I need is a way to retrieve the ' that is already in the > DB. > > Thanks > > Chris > > > yes, by adding stripslashes it wi

Re: [PHP-DB] question about '

2003-07-11 Thread Chris Payne
Hi there, The problem is the data is already in the DB, it was mass-added with the ' already there, what I need is a way to retrieve the ' that is already in the DB. Thanks Chris > yes, by adding stripslashes it will somewhat escape those quotes ('), > but when displaying the results there will

Re: [PHP-DB] question about '

2003-07-11 Thread Shahmat Dahlan
yes, by adding stripslashes it will somewhat escape those quotes ('), but when displaying the results there will not be any need to do so. unless it is your wish to actually store the backslash into the db. Jerry wrote: I think you should use addslashes to store the text in the database and the

RE: [PHP-DB] question about '

2003-07-11 Thread Jerry
I think you should use addslashes to store the text in the database and then stripslashes when displaying the text. I think that should work, but I'm new to PHP so I might be wrong. Jerry -Original Message- From: Chris Payne [mailto:[EMAIL PROTECTED] Sent: Saturday, July 12, 2003 2:11 P

Re: [PHP-DB] Question about replacing large textfields

2003-02-14 Thread Doug Thompson
http://www.hotscripts.com/PHP/ One example: http://www.hotscripts.com/Detailed/9026.html Good luck, Doug On Fri, 14 Feb 2003 16:09:34 +0100, Ingen, Wart van wrote: >Hi there, > >I'm looking for a way to let people without any knowledge of coding replace >large fields of text and images on thei

Re: [PHP-DB] question about access

2003-02-10 Thread Doug Thompson
If your client's friend wants to do learning/development, let him load PHPTriad, FoxServ, or one of the other trinity setups onto his computer. It is truly remarkable that you/your company would even consider such a request for longer than it takes to say: Never in a million years. Also, if I wer

Re: [PHP-DB] Question about Load Data to mysql through php

2002-04-30 Thread Jason Wong
On Tuesday 30 April 2002 16:56, Jack wrote: > Dear Jason > Thx for the reply, but do you know where i should copy that file to in > serverside? > is it got to be the same directory of mysql? It doesn't matter where as long as it is readable by the process running PHP (ie the process running your

Re: [PHP-DB] Question about Load Data to mysql through php

2002-04-30 Thread Jack
TED]> Sent: Tuesday, April 30, 2002 2:45 PM Subject: Re: [PHP-DB] Question about Load Data to mysql through php > On Tuesday 30 April 2002 14:33, Jack wrote: > > Dear all > > i'm a newbie in mysql, but there is one question about LOAD Data command in > > mysql, let s

Re: [PHP-DB] Question about Load Data to mysql through php

2002-04-29 Thread Jason Wong
On Tuesday 30 April 2002 14:33, Jack wrote: > Dear all > i'm a newbie in mysql, but there is one question about LOAD Data command in > mysql, let say if i had a CSV file in client side and i want to load this > file's data into particular table , so do i need to copy this CSV file into > Web serve

RE: [PHP-DB] Question about PHP Arrays syntax

2002-04-22 Thread Vania Smrkovski
> Hello, folks, and I apologize in advance if I break any rules here. This > is my first post on this list and I couldn't find any archive to review > existing posts for the answer to this question. http://www.php.net/mailing-lists.php Thanks for the URL. I feel stupid for having missed it, c

Re: [PHP-DB] Question about PHP Arrays syntax

2002-04-21 Thread pan
From: "Vania Smrkovski" <[EMAIL PROTECTED]> > host with PHP and MySQL support. > > a) How would you change the following the automatically find the tables and > run through the iteration. You should rtfm as php/mysql makes a lot of the torturous VB/MS/Access methods very simple. All the function

Re: [PHP-DB] Question about PHP Arrays syntax

2002-04-21 Thread Jason Wong
On Monday 22 April 2002 12:54, Vania Smrkovski wrote: > Hello, folks, and I apologize in advance if I break any rules here. This > is my first post on this list and I couldn't find any archive to review > existing posts for the answer to this question. http://www.php.net/mailing-lists.php > a)

Re: [PHP-DB] Question about setting up multiple relations

2002-02-28 Thread Paul Burney
on 2/28/02 2:21 AM, Monty at [EMAIL PROTECTED] appended the following bits to my mbox: > I have an Image table in a MySQL database that will be used to store the > location of all images used on my site. Some images will relate to an > Article table (article.id) and some images may relate to a Me

Re: [PHP-DB] Question about advanced SQL

2002-02-27 Thread Sommai Fongnamthip
Hi, I assumed that you was used MySQL for database. With MySQL you can used this SQL to find different row select tblcd.* from tblcd left join tblorder on tblcd.cdid=tblorder.cdid where tblorder.cdid is null sommai At 12:37 28/2/2002 +1000, Adam Royle wrote: >Hi. > >I need

Re: [PHP-DB] Question about advanced SQL

2002-02-27 Thread Bill Morrow
select * from tblCd where cdId not in (select distinct cdId from tblOrders); On Thu, Feb 28, 2002 at 12:37:49PM +1000, Adam Royle wrote: > Hi. > > I need some guidance for writing an effective query (instead of processing > through PHP). > > I lets says I have two tables, tblCDs and tblOrders.

RE: [PHP-DB] Question about advanced SQL

2002-02-27 Thread Kearns, Terry
SELECT tblCD.cdID, tblCD.cdTitle, tblCD.cdArtist FROM tblCD, tblOrders WHERE tblOrders.cdID = tblCD.cdID AND tblCD.cdID NOT IN ( SELECT cdID FROM tblOrders ) The support for this sort of "nested query" will very betwe

RE: [PHP-DB] Question about strlen .. I think

2001-07-16 Thread Ben Bleything
You could split the string on the slashes with explode('/',$string) and then manipulate the array elements you get back. Good luck, Ben -Original Message- From: Dennis Kaandorp [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 15, 2001 9:21 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Questio

Re: [PHP-DB] question about OCIBindByName(add some comment)

2001-05-22 Thread Thies C. Arntzen
On Tue, May 22, 2001 at 09:41:25AM +0900, Michael Cheung wrote: > > On Mon, 21 May 2001 16:39:05 +0200 > "Thies C. Arntzen" <[EMAIL PROTECTED]> wrote: > > > On Mon, May 21, 2001 at 11:35:36PM +0900, Michael Cheung wrote: > > > Hi; > > > Linux 2.2.18 + oracle 8.1.7i + php-4.0.5 + oci8 interface

Re: [PHP-DB] question about OCIBindByName(add some comment)

2001-05-21 Thread Thies C. Arntzen
On Mon, May 21, 2001 at 11:35:36PM +0900, Michael Cheung wrote: > Hi; > Linux 2.2.18 + oracle 8.1.7i + php-4.0.5 + oci8 interface. > > I use the following lines to get a result from database; > But It give me result 0, it is incorrect; > > $sql="Select count(*) From member wher

Re: [PHP-DB] Question about using php with Microsoft SQL server

2001-01-23 Thread signup
> Hello, I'm trying to use the mssql_connect function to connect to the > Microsoft SQL server with php4.0.3pl1 for window, but the return is "Fatal > error: Call to undefined function: mssql_connect()". And another mssql > function are also with the same result, but I have try use the mysql and >