[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

[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

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

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

[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's

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, and it's

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

[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

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

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?

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

2008-06-11 Thread Wei, Alice J.
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 uncommented in your PHP.ini? Dan

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

[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

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

RE: [PHP-DB] Question about database design

2007-10-24 Thread Bastien Koert
in the 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 response, My apologies if you have

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 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 response, My apologies if you

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 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 saying here... On the main table just

[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

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

2006-06-22 Thread suad
() { 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: html head titletitle1/title /head frameset cols=*,200px

[PHP-DB] Question in js about frameset rows

2006-06-21 Thread suad
Hi, I have this page: html head titletitle1/title /head frameset cols=*,200px frameset id=frameset1 rows=10%,30%,10%,* frame src=/page1.phtml name=name1 frameborder=0 scrolling=no / frame src=/page2.phtml name=name2 frameborder=0 / frame src=/page3.phtml name=name3

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 div then dynamically change it using innerHTML hth On 6/21/06, suad [EMAIL

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

2006-06-21 Thread Bastien Koert
; } 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: html head titletitle1/title /head frameset cols=*,200pxframeset id=frameset1 rows=10%,30%,10%,* frame src

[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

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 until

[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-14 Thread reclmaples
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, reclmaples

[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

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

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
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 trying to write a statement that will basically do this: SELECT * FROM WEEKS WHERE BEGIN = CURDATE() and END = CURDATE

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
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:08 PM,

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 WHEREs. 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 WHERE BEGIN

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

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 on

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

[PHP-DB] Question about COUNT(*)

2005-07-06 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 | ---

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

2005-07-06 Thread Nandar
: [PHP-DB] Question about COUNT(*) 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 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 |

[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

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 Yahoo!?

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: php-db@lists.php.net 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 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

[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: For no results

2004-12-03 Thread graeme
You might want to use: mysql_num_rows function.mysql-num-rows.html -- 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

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

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 controlled by the

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: if

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 is the

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) { p

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. Alright it's

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. Alright it's

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) { ? p align=centerstrongNo Matches Found/strong/p ?php

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

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

2004-12-01 Thread Bastien Koert
']. '; $result = mysql_query($sql); ... bastien From: Stuart Felenstein [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] Question on the use of where statements Date: Wed, 1 Dec 2004 07:28:24 -0800 (PST) I posted this over on mysql list. Not trying to be redundant, but would like to get

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

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

2004-12-01 Thread Gryffyn, Trevor
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 AM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Question on the use

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: [PHP-DB

[PHP-DB] Question on FilesSessions

2004-11-19 Thread Kathy_A_Wright
Can you hold a file in a session? I am trying to send a file to a third page and it won't seem to work sending it in a session. Does anyone know how to do this? Thanks Kathy A Wright | Keane Inc. | Suite: Outside: 617-517-1706 | E-mail: [EMAIL PROTECTED] [ Mailing: 100 City Sq.

RE: [PHP-DB] Question on FilesSessions

2004-11-19 Thread Gryffyn, Trevor
about your situation. -TG -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, November 19, 2004 11:46 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Question on FilesSessions Can you hold a file in a session? I am trying to send a file to a third

RE: [PHP-DB] Question on FilesSessions

2004-11-19 Thread Bastien Koert
Better to save the file locally, the pass the name in a session variable. otherwise the overhead of holding a multi Kb or Mb file will be killer on the system. What are you trying to do with the file? Bastien From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] Question

RE: [PHP-DB] Question

2004-11-09 Thread Norland, Martin
those of St. Jude Children's Research Hospital. -Original Message- 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

[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 ///

[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

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_string

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(

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 a href='session2.php'next page/a; echo br.session_id(); } page 2:

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(

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; $icount($l_skill); $i++) loop or increment add $LUID within each

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

2004-10-17 Thread Graham Cossey
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 although I know where it is , I can't seem to figure

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

2004-10-17 Thread Stuart Felenstein
is the current situation? Iterating through the 3 arrays or inserting into MySQL? Graham -Original Message- From: Stuart Felenstein [mailto:[EMAIL PROTECTED] Sent: 17 October 2004 16:14 To: Stuart Felenstein; Graham Cossey; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Question

[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 skill3

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 skill text

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

[PHP-DB] Question on Registration Method

2004-09-26 Thread Stuart Felenstein
Right now my registration / login system works like this: 1-User goes to registration page and fills out form 2-User gets to choose username but password is autogenerated by system 3-System encrypts password in database 4-Password is unencrypted and sent along with username to registrant's email

RE: [PHP-DB] Question on Registration Method

2004-09-26 Thread Oscar Rylin
the lines of userid, tousergroup, activationcode). / rylin -Original Message- From: Stuart Felenstein [mailto:[EMAIL PROTECTED] Sent: den 26 september 2004 13:46 To: [EMAIL PROTECTED] Subject: [PHP-DB] Question on Registration Method Right now my registration / login system works like

RE: [PHP-DB] Question on Registration Method

2004-09-26 Thread Stuart Felenstein
Currently there are only 2 types of users planned Each has a basic access level. I don't think this is the same as a usergroup though. If I don't have usergroups, but access levels, then perhaps I should set the level to some less then what is required login till activated. Then it sounds like

Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread M Saleh EG
I'd do it this way... I'd add two column in the users table. 1- activated, 2- activation-hash once the registeration form is ubmited.. a-the username and user info will be saved in the users table. b-an encrypted hash would be made n saved in activation-hash column and sent along with the

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

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
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 random

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 WHERE

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

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, and

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 to

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

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 above the

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

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 activation

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 separate: -

[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 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%' :) Do you have some

RE: RE: [PHP-DB] question on select

2004-05-13 Thread hengameh
/td td id=right/td /tr /table /form /body /html -Original Message- From: Neil Smith [MVP, Digital media] [mailto:[EMAIL PROTECTED] Sent: Thursday, May 13, 2004 4:16 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re:RE: [PHP-DB] question on select That *should* read

[PHP-DB] Re:RE: [PHP-DB] question on select

2004-05-13 Thread Neil Smith [MVP, Digital media]
/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: [EMAIL PROTECTED] Subject: RE: [PHP-DB] question on select !-- function changeMenu() { document.fcountry.newcountry.value = document.fcountry.country.options[document.fcountry.country.selectedIndex].v alue; } -- /script

Re: [PHP-DB] question on select

2004-05-13 Thread Michael Forbes
this information from this point on. Can someone please tell me how I can use the selected item in my next SQL query? -Original Message- From: Tony S. Wu [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 12, 2004 11:07 AM To: hengameh Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] question on select

  1   2   >