[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 on PHP connect MS SQL 2005

2008-06-11 Thread Ken Keefe
I know the package you need is called php-sybase in ubuntu. It's probably something similar in Fedora. Know that this package will only let you do a subset of the mssql function calls. If you are just connecting and doing a normal query, it will suffice. If you need to do prepared statements for st

RE: [PHP-DB] Question on PHP connect MS SQL 2005

2008-06-11 Thread Wei, Alice J.
11, 2008 9:43 AM To: Wei, Alice J. Cc: php-db@lists.php.net Subject: Re: [PHP-DB] Question on PHP connect MS SQL 2005 Alice, In regards to: "Call to undefined function mssql_connect() in /home/TDC/Desktop/create_new_entry_master.php on line 20" Do you have the MSSQL extension uncomme

RE: [PHP-DB] Question on PHP connect MS SQL 2005

2008-06-11 Thread Wei, Alice J.
Hi, This may sound really stupid, but I installed Fedora and checked on the box for web development to allow PHP and other web scripts on the platform. Therefore, I could run PHP scripts fine, and the mentioning of this file, would you be able to offer me suggestions on where it might be? Th

Re: [PHP-DB] Question on PHP connect MS SQL 2005

2008-06-11 Thread Dan Shirah
Alice, In regards to: "Call to undefined function mssql_connect() in /home/TDC/Desktop/create_new_entry_master.php on line 20" Do you have the MSSQL extension uncommented in your PHP.ini? Dan

[PHP-DB] Question on PHP connect MS SQL 2005

2008-06-11 Thread Wei, Alice J.
Hi, I have just installed the Apache on a Linux machine, and tried to run the script that contains a // connection to the database $dbhandle= mssql_connect($myServer, $myUser, $myPass) or die("Couldn't connect to SQL Server on $myServer"); When I try to run the PHP script, it gives me thi

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 in js about frameset rows

2006-06-21 Thread suad
quot;; } function expand() { top.document.getElementById("TOP").rows = "65,*,200,46,0"; } bastien From: suad <[EMAIL PROTECTED]> To: php-db@lists.php.net Subject: [PHP-DB] Question in js about frameset rows Date: Wed, 21 Jun 2006 11:44:07 +0200 Hi, I have this page:

RE: [PHP-DB] Question in js about frameset rows

2006-06-21 Thread Bastien Koert
Id("TOP").rows = "65,*,200,46,0"; } bastien From: suad <[EMAIL PROTECTED]> To: php-db@lists.php.net Subject: [PHP-DB] Question in js about frameset rows Date: Wed, 21 Jun 2006 11:44:07 +0200 Hi, I have this page: title1 rows="10%,30%,10%,*"> /&g

Re: [PHP-DB] Question in js about frameset rows

2006-06-21 Thread J R
appologies to the list. i think this should not be asked here. anyway i'll answer. IMHO, there is no easy way to do what you like. what i would suggest is use "document.write()" or inclosing your frameset in a container "" then dynamically change it using "innerHTML" hth On 6/21/06, suad <[EMAI

[PHP-DB] Question in js about frameset rows

2006-06-21 Thread suad
Hi, I have this page: title1 And this is the content of the page page1.phtml: name1 change size of frame 2 How can I change (using js) the rows of the frameset to: Thanks Suad -- PHP Database Mailing List (http://www.php.net/) To unsubscri

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 regarding the scope of pg_prepare

2006-04-14 Thread chris smith
On 4/14/06, Will Chapman <[EMAIL PROTECTED]> wrote: > I have a few different pg_prepare statements in my PHP script. I was > wondering what scope they lie in. Im assuming they are not saved in the > PSQL database, so it is just for the script? They are inside of > functions... does it only last

[PHP-DB] Question regarding the scope of pg_prepare

2006-04-14 Thread Will Chapman
I have a few different pg_prepare statements in my PHP script. I was wondering what scope they lie in. Im assuming they are not saved in the PSQL database, so it is just for the script? They are inside of functions... does it only last until the function exists? I just dont want to keep on call

RE: [PHP-DB] Question on CURDATE()

2005-09-14 Thread reclmaples
.16 Sorry for not including that. Thanks -Rich -Original Message- From: Micah Stevens [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 13, 2005 9:13 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] Question on CURDATE() What SQL server are you using? On Tuesday 13 September 2005 7:08 pm

[PHP-DB] Question on CURDATE()

2005-09-14 Thread reclmaples
** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461,

Re: [PHP-DB] Question on CURDATE()

2005-09-13 Thread Micah Stevens
Hi, I just noticed I was wrong, the original SQL statement would return rows, but only if BEGIN = CURDATE(). I stated it would never happen, and that's wrong. Sorry. :) -Micah On Tuesday 13 September 2005 9:42 pm, Micah Stevens wrote: > Hi Jordan, > > Syntactically, there is no restriction

Re: [PHP-DB] Question on CURDATE()

2005-09-13 Thread Micah Stevens
Hi Jordan, Syntactically, there is no restriction on OR'ing or AND'ing conditions. You could very well do this: Select somefield where otherfield = 1 and otherfield = 2; Of course, otherfield would never be both 1 and 2, so this is a worthless select statement, however, my point is, there woul

Re: [PHP-DB] Question on CURDATE()

2005-09-13 Thread Jordan Miller
Micah, Oh, my bad. I was trying to remember how I did something like this before, stringing together a lot of "WHERE"s. You're right, though, it wasn't "WHERE", it was "OR". Rich, I think you need "OR" instead of "AND", OR else I'm just totally out to lunch tonight: SELECT * FROM WEEKS WH

Re: [PHP-DB] Question on CURDATE()

2005-09-13 Thread Micah Stevens
You can't do that in SQL, that would give you a big fat syntax error. On Tuesday 13 September 2005 7:45 pm, Jordan Miller wrote: > Rich, > > Did you try putting "WHERE" twice? > > try: > SELECT * FROM WEEKS WHERE BEGIN >= CURDATE() and WHERE END <= CURDATE; > > Jordan > > On Sep 13, 2005, at 9:0

Re: [PHP-DB] Question on CURDATE()

2005-09-13 Thread Jordan Miller
Rich, Did you try putting "WHERE" twice? try: SELECT * FROM WEEKS WHERE BEGIN >= CURDATE() and WHERE END <= CURDATE; Jordan On Sep 13, 2005, at 9:08 PM, reclmaples wrote: I am trying to write a statement that will basically do this: SELECT * FROM WEEKS WHERE BEGIN >= CURDATE() and END <=

Re: [PHP-DB] Question on CURDATE()

2005-09-13 Thread Micah Stevens
om: Micah Stevens [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 13, 2005 9:13 PM > To: php-db@lists.php.net > Subject: Re: [PHP-DB] Question on CURDATE() > > > > What SQL server are you using? > > On Tuesday 13 September 2005 7:08 pm, reclmaples wrote: > > I am t

RE: [PHP-DB] Question on CURDATE()

2005-09-13 Thread reclmaples
I am using mysql Ver 12.22 Distrib 4.0.16 Sorry for not including that. Thanks -Rich -Original Message- From: Micah Stevens [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 13, 2005 9:13 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] Question on CURDATE() What SQL server are you

Re: [PHP-DB] Question on CURDATE()

2005-09-13 Thread Micah Stevens
What SQL server are you using? On Tuesday 13 September 2005 7:08 pm, reclmaples wrote: > I am trying to write a statement that will basically do this: > > SELECT * FROM WEEKS WHERE BEGIN >= CURDATE() and END <= CURDATE; > > But for some reason I can only use one CURDATE() reference in my sql > s

[PHP-DB] Question on CURDATE()

2005-09-13 Thread reclmaples
I am trying to write a statement that will basically do this: SELECT * FROM WEEKS WHERE BEGIN >= CURDATE() and END <= CURDATE; But for some reason I can only use one CURDATE() reference in my sql statement, does anyone know why? Is there a way I can get around this? Any help would be greatly a

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 regarding how-to stop the form inputting empty data at end of the form that is empty due to a carriage return

2005-01-13 Thread Manjiri Mahajan
Hi Mike, I would suggest that you look for [A-Z],[a-z] and [0-9] characters and build up your string for Media ID instead of replacing "\r" and "\n". I have gone through the same situation for bar code scanning. Regards, Manjiri __ Do you Yaho

Re: [PHP-DB] Question regarding how-to stop the form inputting empty data at end of the form that is empty due to a carriage return

2005-01-11 Thread Rory McKinley
Mike Millner wrote: Hello everyone, I have this form that we use for keeping track of tapes we send off site for storage where I work. The form works almost perfectly with the help of a few people. We use a scanner to input the tape id's. The scanner automatically puts a carriage return at the

RE: [PHP-DB] Question regarding how-to stop the form inputting empty data at end

2005-01-11 Thread Bastien Koert
if the media_ID field is an autonumber, then there is no need to do anything with it...mysql will take the null and generate the next id. bastien From: "Mike Millner" <[EMAIL PROTECTED]> To: Subject: [PHP-DB] Question regarding how-to stop the form inputting empty data at end

Re: [PHP-DB] Question regarding how-to stop the form inputting empty data at end of the form that is empty due to a carriage return

2005-01-11 Thread Santa
В сообщении от Среда 12 Январь 2005 04:52 Mike Millner написал(a): > 243 Query INSERT INTO tape_tracking_test > (media_id,retention,out_date,return_date,box_id) values > ('','7WK=%s','2005-01-11','2005-3-01','006455C5092800') > > > How can I get PHP to ignore that line that has empty data in

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Stuart Felenstein
--- "Ford, Mike" <[EMAIL PROTECTED]> wrote: > And, by the way, why on earth are you using a > print_r an a straight literal > string? Seems to me you could just put that text in > as part of the HTML: > >if ($row_rsCS == false) { >?> > No Matches > Found > exit; >} >

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 03 December 2004 15:26, Stuart Felenstein wrote: > --- "Ford, Mike" <[EMAIL PROTECTED]> wrote: > > > Well, your taste seems to be to use { }, so :-endif is irrelevant. > > > Al

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 03 December 2004 15:26, Stuart Felenstein wrote: > --- "Ford, Mike" <[EMAIL PROTECTED]> wrote: > > > Well, your taste seems to be to use { }, so :-endif is irrelevant. > > > Al

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Stuart Felenstein
--- "Ford, Mike" <[EMAIL PROTECTED]> wrote: > Well, your taste seems to be to use { }, so :-endif > is irrelevant. > Alright it's Friday, I'm punchy but we're all in a good mood ! Yes, I like the closing curlies So, then where do these lovely ladies go here ? if ($row_rsCS == false) { exit;

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 03 December 2004 15:16, Stuart Felenstein wrote: > --- Stuart Felenstein <[EMAIL PROTECTED]> wrote: > > > The reason the close is there is because the next > > line > > of code

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 03 December 2004 15:06, Stuart Felenstein wrote: > > The closing ?> of a PHP segment also implies an > > end-of-statement semicolon > > -- so the above is equivalent to: > > > >

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Stuart Felenstein
--- Stuart Felenstein <[EMAIL PROTECTED]> wrote: > The reason the close is there is because the next > line > of code is the print_r , and I put some html in > there. > So this works great: if ($row_rsCS == false) { print_r ("No Matches Found"); exit; } But because I want to have some html f

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Stuart Felenstein
> The closing ?> of a PHP segment also implies an > end-of-statement semicolon > -- so the above is equivalent to: > >if ($row_rsCS == false) ; >?> > > Which, of course, means that the scope of the if > doesn't extend to anything > beyond this point. > > You need to mark the block contro

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 03 December 2004 14:39, Stuart Felenstein wrote: > I want to send back a message when no matches are > found on my search page. Basically "No matches > found". I assumed that m

Re: [PHP-DB] Question: For no results

2004-12-03 Thread graeme
You might want to use: mysql_num_rows -- Get number of rows in result Stuart Felenstein wrote: I want to send back a message when no matches are found on my search page. Basically "No matches found". I assumed that mysql_fetch_assoc would be the determining factor on whether any rows will com

[PHP-DB] Question: For no results

2004-12-03 Thread Stuart Felenstein
I want to send back a message when no matches are found on my search page. Basically "No matches found". I assumed that mysql_fetch_assoc would be the determining factor on whether any rows will come back. As you can see below I do a if ($row_rsCS == false). Apparently though (while the message

RE: [PHP-DB] Question on the use of where statements

2004-12-01 Thread Bastien Koert
actually that would reduce it since a fewwer number of rows would potentially match the query...ensure that there is a composite index on a good selection of the columns to mkae the query quicker bastien From: Stuart Felenstein <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: RE: [

RE: [PHP-DB] Question on the use of where statements

2004-12-01 Thread Gryffyn, Trevor
thing under the WHERE clause or max length of SELECT statement. If you find anything interesting, let us know. Sorry couldn't give you a better answer. -TG > -Original Message- > From: Stuart Felenstein [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 01, 2004 10:56

RE: [PHP-DB] Question on the use of where statements

2004-12-01 Thread Stuart Felenstein
--- Bastien Koert <[EMAIL PROTECTED]> wrote: > so...best to build the statement dynamically and > execute it once only if the > input box has a value in it... > And that is the way I'm building it. Just thinking about the scenario that somone actually chooses 75% of the options - would that po

RE: [PHP-DB] Question on the use of where statements

2004-12-01 Thread Bastien Koert
(isset($_POST['fieldN'])){ $sql .= " and columnN = '".$_POST['fieldN']. "'"; $result = mysql_query($sql); ... bastien From: Stuart Felenstein <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [PHP-DB] Question on the use of where statement

Re: [PHP-DB] Question on the use of where statements

2004-12-01 Thread Stuart Felenstein
Sorry ..hit the wrong button --- Stuart Felenstein <[EMAIL PROTECTED]> wrote: I posted this over on mysql list. Not trying to be redundant, but would like to get some feedback. Basically I'm wondering. I am creating a search form , dynamic query, that could potentially have in the area of 4

[PHP-DB] Question on the use of where statements

2004-12-01 Thread Stuart Felenstein
I posted this over on mysql list. Not trying to be redundant, but would like to get some feedback. Basically I'm wondering. I am creating a search form , dynamic query, that could potentially have in the area of 40+ where statements. i.3. 1- where x = y and -- PHP Database Mailing List (http:

RE: [PHP-DB] Question

2004-11-09 Thread Norland, Martin
--- From: Jacob Hackamack [mailto:[EMAIL PROTECTED] Sent: Monday, November 08, 2004 11:54 PM To: PHP Databases Subject: [PHP-DB] Question Hello, I am using PostNuke and have decided to create a page for a local basketball team. I have this as the create team function: // /// Create a new Tea

[PHP-DB] Question

2004-11-08 Thread Jacob Hackamack
Hello, I am using PostNuke and have decided to create a page for a local basketball team. I have this as the create team function: // /// Create a new Team for the given Tournament /// /// Parameters: /// 'cid' = Tournament ID ///'team' = Team name ///

RE: [PHP-DB] Question: Copy and paste text into mysql text column

2004-10-19 Thread Ed Lazor
> I have a textarea field that will allow users to copy > and paste text into , it might be plain text, or it > might come out of word. > I'm wondering what type of validations I should > perform on this field ? > > Any suggestions / ideas ? Hi Stuart, Check out the strip_tags and mysql_escape_

[PHP-DB] Question: Copy and paste text into mysql text column

2004-10-19 Thread Stuart Felenstein
I have a textarea field that will allow users to copy and paste text into , it might be plain text, or it might come out of word. I'm wondering what type of validations I should perform on this field ? Any suggestions / ideas ? Thank you, Stuart -- PHP Database Mailing List (http://www.php.net

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-17 Thread Stuart Felenstein
> > To: Stuart Felenstein; Graham Cossey; > [EMAIL PROTECTED] > > Subject: RE: [PHP-DB] Question: Putting separate > form elements into an > > array > > > > > > Changed my direction somewhat but keep getting a > parse > > error and

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-17 Thread Graham Cossey
ein [mailto:[EMAIL PROTECTED] > Sent: 17 October 2004 16:14 > To: Stuart Felenstein; Graham Cossey; [EMAIL PROTECTED] > Subject: RE: [PHP-DB] Question: Putting separate form elements into an > array > > > Changed my direction somewhat but keep getting a parse > error and althoug

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-17 Thread Graham Cossey
Stuart, what does your echo($query) line output? I would hazard a guess that your quotes are wrong and you are not getting what you expect. What is &LUID? I believe you will need to execute an INSERT query within each "for($i=0; $i > This is how I am trying to get them into the database: > > $qu

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-17 Thread Stuart Felenstein
Changed my direction somewhat but keep getting a parse error and although I know where it is , I can't seem to figure out what I need to do to make it syntax correct: This is how I am passing the arrays: if ( empty( $_SESSION['l_skill'] ) ) { $_SESSION['l_skill']=array(); } if ( is_array( $_REQU

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-17 Thread H. J. Wils
Hi everybody, For quite a while i'm struggeled with my session. It doesn't seem to work, can anyone help me? This is my code: page 1: session_start(); $_SESSION["test"] = "tryin..."; if (isset($_SESSION["test"])) { echo "next page"; echo "".session_id(); } page 2: session_start(); if (isset($

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-17 Thread Stuart Felenstein
Not exactly sure what I did here. there are 5 skill textfields name skill[] then the years sky[] then the last used slu[] I was following the format of my other arrays, so stored them list this: if ( empty( $_SESSION['l_skill'] ) ) { $_SESSION['l_skill']=array(); } if ( is_array( $_REQUEST['sk

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-16 Thread Graham Cossey
> > > Have you tried naming your form elements such as > > skill[], sky[] and slu[] ? > > (You could also use skill[1], skill[2], skill[3] > > etc... within your form.) > > Yes that makes sense. Good. This of course means you can build your form within a for loop (or similar). So to place 10 skil

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-16 Thread Stuart Felenstein
See interspersed: --- Graham Cossey <[EMAIL PROTECTED]> wrote: > Have you tried naming your form elements such as > skill[], sky[] and slu[] ? > (You could also use skill[1], skill[2], skill[3] > etc... within your form.) Yes that makes sense. > You can just as easily store the arrays in your

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-16 Thread Graham Cossey
..) HTH Graham > -Original Message- > From: Stuart Felenstein [mailto:[EMAIL PROTECTED] > Sent: 16 October 2004 22:48 > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Question: Putting seperate form elements into an array > > > Right now this seems something like solving a r

[PHP-DB] Question: Putting seperate form elements into an array

2004-10-16 Thread Stuart Felenstein
Right now this seems something like solving a rubic's cube. While I process, I hope it's alright that i'm asking here. I think my quantity of posts have been high :) I have these form elements:(these are the names of the elements) skill1sky1 slu1 skill2sky2 slu2 skill3sky

Re: [PHP-DB] Question on Registration Method

2004-09-28 Thread Stuart Felenstein
Well, finally suceeding to get by activation page working, where the 0 is flipped to 1 to mean actived, I'm stuck on the login page. Unfortunately I'm stuck :) with what I have below. It's part of an authentication system. This code doesn't include the includes, but I thought maybe significant en

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Joseph Crawford
$_GET['activation_hash] is missing the end ' On Mon, 27 Sep 2004 03:20:22 +0800, Jason Wong <[EMAIL PROTECTED]> wrote: > On Monday 27 September 2004 03:01, Stuart Felenstein wrote: > > How are they any different? > > > > I'm seeing the same thing as your method. > > These two methods are separat

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Jason Wong
On Monday 27 September 2004 03:01, Stuart Felenstein wrote: > How are they any different? > > I'm seeing the same thing as your method. These two methods are separate: > > - Send user a system generated password with which > > they can login and > > subsequently change. OR > > - Send user an ac

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread M Saleh EG
Stuart... u got the logic now. check ur syntax problems urself... this is the only way ull learn it! a hint... if ur database query is giving u errors... try echoing it before sending it to mysql_query. ull find out the problem yourself then ;) another hint... mysql_query always returns a

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Stuart Felenstein
How are they any different? I'm seeing the same thing as your method. Stuart --- Jason Wong <[EMAIL PROTECTED]> wrote: > On Sunday 26 September 2004 19:45, Stuart Felenstein > wrote: > > > While I'm okay with mine, not completely > satisfied. > > I'd like to change it to the type where like abo

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Stuart Felenstein
Unknown column 'a338265f' in 'where clause' is the latest problem (and should be the last). I had this same error earlier while just doing a straight sql to the database. I corrected it then by putting apostrophes around the column name. That didn't help here , not quotes , maybe double apostrop

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Jason Wong
On Sunday 26 September 2004 19:45, Stuart Felenstein wrote: > While I'm okay with mine, not completely satisfied. > I'd like to change it to the type where like above the > username and password is sent via email, but with the > addition of a link in the email whereby the user must > click on link

RE: [PHP-DB] Question on Registration Method

2004-09-26 Thread Webmaster
> I'm getting an error using the > "mysql_num_rows($result)" > Warning: mysql_num_rows(): supplied argument is not a > valid MySQL result resource in > /home/lurkkcom/public_html/lurktivate.php on line 7 Did you happen to remember to change "fields" in the query string to your table column names,

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Stuart Felenstein
I'm getting an error using the "mysql_num_rows($result)" Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/lurkkcom/public_html/lurktivate.php on line 7 Why am I counting the number of rows in the table? Shouldn't I be looking to see if the code I was pas

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Joseph Crawford
no you dont need a user id or anything, here is some sample code to give you the idea $result = mysql_query("SELECT fields FROM table WHERE code=".$_GET['code']); if(mysql_num_rows($result) > 0) { // we have a match, activate the account $result1 = mysql_query("UPDATE table SET activated=1 WHE

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Stuart Felenstein
Nothing like sharing my pain ;) sorry! It seems that in order to compare the code to the one in the database, don't I need the userid or something? or just that it exists in the database? Thank you, Stuart --- Joseph Crawford <[EMAIL PROTECTED]> wrote: > what i did is i used php to create a rand

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Joseph Crawford
that is done when they click the link in thier email if they are sent to domain.com/page.php?code=X4rfkj490T the code in page.php will $_GET['code'] and compare it to the one in the database, if they match, flip the switch if not show an error. On Sun, 26 Sep 2004 06:35:59 -0700 (PDT), Stuart

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Stuart Felenstein
K...I've added the 2 columns, my names - activate and activate_hash. Upon registration, the activate_hash has a generated string inserted. activate column is default to 0. I can compare it to the database - but not sure how to flip the switch on the activate column 0->1 Is that done through an up

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Joseph Crawford
what i did is i used php to create a random string of numbers and letters about 15 chars long, then i store this in the db, and in the email i make the link page.php?code=RandomStringHere, then on the page.php i get the code and compare it to the ont in the database. If they match activate the use

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Stuart Felenstein
Ok , I think this is along the lines of what I've started. I added a column called "active" with a default to 0. It's a tiny int since I'm think 0=fales, 1=true. So can you explain a tad more about this hash stuff ? Is that specific to a sql field or just a name you've chose ? I'm not sure what

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Joseph Crawford
currently i do it the same way M Saleh EG does it ;) i have found that is the easiest way and works perfect. > On Sun, 26 Sep 2004 16:34:16 +0400, M Saleh EG <[EMAIL PROTECTED]> wrote: > > I'd do it this way... > > > > I'd add two column in the users table. 1- activated, 2- activation-hash > > >

  1   2   3   >