[PHP-DB] question about best practice for coding sql statements

2011-11-12 Thread tamouse mailing lists
I'm curious how others feel about this. When I'm creating an SQL string, either for a non-prepared or prepared execution, I build it in a variable and then pass the variable to the query or prepare function. This lets me easily add something to view the SQL statement, and also if there's an error,

[PHP-DB] question about Zend PHP Studio ...Zend gave useless answer

2008-12-02 Thread Fred Silsbee
I have Fedora 9/Apache 2/PHP 5.2.6 Everything is great but I cannot add the libraries for oci8 1.3.4 I have in a directory. The entries are grayed out. I was getting an error oci_connect not found. I rebooted! The php program runs **great** from /var/www/html under Apache here is the erro

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

[PHP-DB] Question about databases and foreign keys

2008-09-15 Thread Jason Pruim
Hi everyone, I just wanted to make sure that I am not making something more complicated then it has to be. I am working on a time clock application to use at my company, and so far, I have a login table, and with a foreign key that links to the time table. The thinking being, that when so

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,

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

2008-08-26 Thread Jason Pruim
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, and it'

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
to be able to pull the correct one based on date bastien > To: php-db@lists.php.net > From: [EMAIL PROTECTED] > Date: Wed, 24 Oct 2007 09:06:29 -0400 > Subject: [PHP-DB] Question about database design > > I sent this to the MySQL list but didn't receive any >

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
addresses to be able to pull the correct one based on date bastien> To: php-db@lists.php.net> From: [EMAIL PROTECTED]> Date: Wed, 24 Oct 2007 09:06:29 -0400> Subject: [PHP-DB] Question about database design> > I sent this to the MySQL list but didn't receive any > resp

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

[PHP-DB] Question about database design

2007-10-24 Thread Jason Pruim
I sent this to the MySQL list but didn't receive any response, My apologies if you have already received this. Hi Everyone, So having learned my lesson with the last application, I am trying to plan out the addition of a feature to my database application. Basically, some of my custom

[PHP-DB] Question about persistent DB connection, the LAST_INSERT_ID

2007-01-16 Thread cchereTieShou
HI, the question is whether there is any chance the LAST_INSERT_ID could be wrong during inserting with a persistent DB connection? For example, instance [AA] of a script insert one row with an auto-increment field, and retrieve the LAST_INSERT_ID after the operation, at the same time, there is a

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

[PHP-DB] Question about Classes

2006-06-08 Thread Andrew Darby
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 three functions (funct

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

[PHP-DB] Question about COUNT(*)

2005-07-05 Thread erick
Hi, Let's say that I have 2 tables: client and sales --- | client_id | client_name | --- | 1 | John| | 2 | Mark| | 3 | Luke| | 4 | Matthew | ---

[PHP-DB] Question about clients

2005-04-07 Thread karl james
Team, How do most of you get your clients, are their any other tricks besides word of mouth. I really want to become a freelance web designer, or work for a provider of clients. Also/or for a major coporation that. Does anybody have any suggestions on how I can start getting paid for what I know

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%' :) >>

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

2004-05-31 Thread Alexey Kupershtokh
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%' :) Do you have some ideas? WBR, Wicked -- PHP Database

Re: [PHP-DB] question about '

2003-07-18 Thread David Robley
; > > > >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 > > > > &

Re: [PHP-DB] question about '

2003-07-11 Thread Chris Payne
at 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 PM > >To: php > >Subject: [PHP-DB] question about

Re: [PHP-DB] question about '

2003-07-11 Thread Shahmat Dahlan
e 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 PM To: php Subject: [PHP-DB] question about ' Hi there

RE: [PHP-DB] question about '

2003-07-11 Thread Jerry
2:11 PM To: php Subject: [PHP-DB] question about ' Hi there everyone, I am having alittle problem. I am calling some text that has a ' in it in the DB, but when it is being displayed on the screen the ' becomes a ? any ideas? I'm displaying just with a and everything wo

[PHP-DB] question about '

2003-07-11 Thread Chris Payne
Hi there everyone, I am having alittle problem. I am calling some text that has a ' in it in the DB, but when it is being displayed on the screen the ' becomes a ? any ideas? I'm displaying just with a and everything works great except that. I just read about addslashes and stripslashes etc

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

[PHP-DB] Question about replacing large textfields

2003-02-14 Thread Ingen, Wart van
Hi there, I'm looking for a way to let people without any knowledge of coding replace large fields of text and images on their website. Is there anyone who knows some way to do this with MySQL and PHP ? Maybe someone knows where I can find an online tutorial about this? Thanks a bunch

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

[PHP-DB] question about access

2003-02-10 Thread Terry Romine
I'd like to get some opinions from the list. We run php/mysql on our linux servers located behind a firewall. Many of our clients have scripts that access their databases via php running on the hosting server, and the general access is set up as: $hostname = "localhost"; $database = "clients

[PHP-DB] question about OCIFetchInto

2003-01-16 Thread ys_zhu
hi XP+IIS5.1+PHP4.3+ORACLE9.2(client) ERROR - Could not connect to Oracle"; exit; } $sql = "Select count(*) from t1"; $stmt = OCIParse($conn, $sql); if(!$stmt) echo "ERROR - Could not parse SQL statement."; exit; } OCIExecute($stmt); OCIFetchInto($stmt, &$total_rows); if ( !$total_rows[0] ) ech

[PHP-DB] Question about rollback in mysql

2002-12-30 Thread Arno Kruit (Stichting Eljakim)
I have php 4.2.3 and Mysql- Max 3.23.54b. If I use the rollback or Commit function it wil work until the scripts ends Is it possible to rollback or commit commands after the scripts ends with a another script? or is rollback only possible in the same script? A.J. Kruit -- PHP Database Mailing L

[PHP-DB] Question about ODBC databases

2002-05-17 Thread Gerardo Morales
I have a little problem. I must design a little system in a linux server, this should be in php. The system must read a MS Access DB in a remote server (Win NT). After a single process the system must update a MySQL DB in the same server (Linux) and the Access DB. The current code works fine

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

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

2002-04-29 Thread Jack
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 server side where the Mysql is or i will be able to load it

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)

[PHP-DB] Question about PHP Arrays syntax

2002-04-21 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. I'm an advanced HTML/JavaScript/DHTML programmer with relational database experience using FileMaker an

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

[PHP-DB] Question about setting up multiple relations

2002-02-27 Thread Monty
Hi, 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 Member table (member.id). As it's possible that there may be an article.id that is the sam

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
ll vary. I havn't tested the above query but it should work :-) Although it probably isn't the most efficient. [TK] > -Original Message- > From: Adam Royle [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 28 February 2002 1:38 PM > To: [EMAIL PROTECTED] > Subject: [

[PHP-DB] Question about advanced SQL

2002-02-27 Thread Adam Royle
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. tblCD cdID| cdTitle | cdArtist -- 1 | Great Hits | Bon Jovi 2 | Forever

[PHP-DB] Question about MySQL, ORDER

2001-11-01 Thread BlueBytes
http://paa.fragland.net/hosted/myquestion/ here you find my question, thx -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

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

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

2001-07-15 Thread Dennis Kaandorp
Hello, On my site users can submit ftp's. Is there a way to replace the spaces between the paths? This is what I mean: /uploads//by/ /dennis/ must become /uploads/<4sp>/by/<3sp>dennis/ Thnx, Dennis -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTE

Re[2]: [PHP-DB] question about OCIBindByName(Resolved)

2001-05-22 Thread Michael Cheung
Thanks for all the reply. I have resolve the problem by specified the bind type to 96(SLQT_AFC). By explore the source, the default has been set to (SQLT_CHR). as my data type is char(64), so I have to set it to 96, to get the correct result. modified source: $sql="Select count(*) From member wh

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[2]: [PHP-DB] question about OCIBindByName(add some comment)

2001-05-21 Thread Michael Cheung
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. > > > > I use the following lines to get a result from database;

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

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

2001-05-21 Thread Michael Cheung
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 where email=:email"; $sth=OCIParse($dbh,$sql); OCIBindByName($sth,"email",$e

[PHP-DB] question about

2001-05-21 Thread Michael Cheung
Hi; 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 where email=:email"; $sth=OCIParse($dbh,$sql); OCIBindByName($sth,"email",$email,64); OCIExecute($sth); OCIFetchInto($sth,$data); but when I directly u

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 >