Re: [PHP-DB] login script

2004-04-27 Thread Mikael Grön
Here you go: Table: ID Login PW Admin 1 admin abc123 1 2 normal bcd234 0 3 normal2 cde345 0 PHP: [BOF] if($_POST['login']) { $result = mysql_query("select * from users where login = '" . $_POST['login'] . "'") or die(mysql_error()); if (mysql_nu

Re: [PHP-DB] login script

2004-04-27 Thread Mikael Grön
Err... As usual I forgot the most important part... Add session_start() just above the if($_POST['login']) { row, or it won't work at all.. ;) Or rather, it'll work, but no sessions will be saved. Mike On Apr 27, 2004, at 08:48, Mikael Grön wrote: Here you go: Table: ID Login PW

Re: [PHP-DB] Session

2004-04-27 Thread Mikael Grön
Session objects has nothing to do with weak network connections. If your sessions gets un-set, it's most probably because you forgot the session_start(); command in the beginning of some file that is using sessions. Without that line, no sessions will be neither stored nor read. Mike On Apr 27

Re: [PHP-DB] Session

2004-04-27 Thread Ng Hwee Hwee
thanx Wendell for your suggestion. apparently i tried using cookies, but my cookies also get deleted after my session is "disconnected". (?!?!) i did not set an expiry date to my cookies because i need them to be deleted when the user closes his browser. what could i have done wrong?? - Origi

Re: [PHP-DB] Session

2004-04-27 Thread Ng Hwee Hwee
thanx Mike, i'm sure i have session_start() on all my pages. Why I'm so confident is because my session gets unset occassionally and not everytime. i cannot find a pattern and so it is not a consistent problem.. it's so unpredictable! what could be the problem?? - Original Message - From

Re: [PHP-DB] Session

2004-04-27 Thread Torsten Roehr
"Ng Hwee Hwee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > thanx Mike, > > i'm sure i have session_start() on all my pages. Why I'm so confident is > because my session gets unset occassionally and not everytime. i cannot find > a pattern and so it is not a consistent problem.. it

Re: [PHP-DB] Session

2004-04-27 Thread Ng Hwee Hwee
Hi Torsten, That is a wonderful insight!!! :o) thanxxx! okie, my 'session.gc_maxlifetime' = 1440 and session.gc_probability = 1. so, should I change it to something like 43,200 (12hours*60mins*60sec)?? for example, one person works a maximun of 12 hours a day. But does it mean that by lengtheni

Re: [PHP-DB] Session

2004-04-27 Thread Torsten Roehr
Hi Hwee, of course you could set it to 43200 seonds if you want. The session.gc_probability value should stay 1 which means that the session data is deleted with a probability of 1 percent. The session life time itself is not critical - the life time of the session DATA is. Which means you should

Re: [PHP-DB] Session

2004-04-27 Thread Ng Hwee Hwee
Hi Torsten, Thank you! Thank you! just would like to clarify what do you mean by >The session life time itself is not critical - the life time of the session > DATA is. Which means you should unset all session data after the desired > period of time. does it mean that if I set 'session.gc_maxli

Re: [PHP-DB] Session

2004-04-27 Thread Torsten Roehr
"Ng Hwee Hwee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi Torsten, > > Thank you! Thank you! > > just would like to clarify what do you mean by > > >The session life time itself is not critical - the life time of the session > > DATA is. Which means you should unset all sessio

Re: [PHP-DB] Session

2004-04-27 Thread John W. Holmes
From: "Ng Hwee Hwee" <[EMAIL PROTECTED]> > okie, my 'session.gc_maxlifetime' = 1440 and session.gc_probability = 1. > > so, should I change it to something like 43,200 (12hours*60mins*60sec)?? > for example, one person works a maximun of 12 hours a day. But does > it mean that by lengthening this

Re: [PHP-DB] Session

2004-04-27 Thread Hans Lellelid
Hi - John W. Holmes wrote: The session does not exist past the point of closing the browser unless you increase the lifetime of the session cookie itself. I would recommend you just leave it at zero, though, meaning it only persists for as long as the browser window is open. The longer you make th

Re: [PHP-DB] Session

2004-04-27 Thread John W. Holmes
From: "Hans Lellelid" <[EMAIL PROTECTED]> > - keep your gc_maxlifetime as small as possible; that way if a user does > close their browser their session won't remain active for 12+ hours. > You might want to consider ways of periodically refreshing the page > using an iframe or even just a soluti

Re: [PHP-DB] Session

2004-04-27 Thread Torsten Roehr
> On that note, here are a few things you might want to consider if you > want to make sessions more secure: > > - use only cookies for sessions. (session.use_only_cookies = 1) This > prevents the session ID from *ever* being added to the URL. URLs get > logged -- by apache, by proxy servers, by

[PHP-DB] Procedures in PHP (plphp RC1 released)

2004-04-27 Thread Joshua D. Drake
Hello, Anyone running PostgreSQL (or wanting to) can write stored procedures, functions (same thing), and triggers in PHP using the new release of plPHP. plPHP offers complete database access to such features as: SetOf Functions, Composite Types, Triggers, etc... plPHP is dual licensed under t

[PHP-DB] Request for help on (My)SQL Statement

2004-04-27 Thread John.Bedard
:::Novice Alert::: I've done simple select and insert statements, so I suppose this is the most complicated thing I've tried to do. but seems to me it should be pretty easy. But I'm a designer by background, not a developer or programmer. I've got everything else I'm trying to do working. I'

[PHP-DB] First letter

2004-04-27 Thread matthew perry
What PHP function returns just the first letter of a string? - Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Request for help on (My)SQL Statement

2004-04-27 Thread Swan, Nicole
Have you tried a nested query? I think your problem is that you're really using information from two different tables. Maybe: UPDATE ngc_polling SET lastrundate = (SELECT max(post_time) FROM nuke_phpbb_posts); --Nicole --- Nicole Swan Web Programming Specialist Carroll

Re: [PHP-DB] First letter

2004-04-27 Thread Daniel Clark
$rest = substr("abcdef", 1, 3); // returns "bcd" http://www.phpbuilder.com/manual/function.substr.php > What PHP function returns just the first letter of a string? > - Matt > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PH

Re: [PHP-DB] Request for help on (My)SQL Statement

2004-04-27 Thread Micah Stevens
That would be the way to do it except that MySQL doesn't support sub-selects until version 4.1, which is in alpha still. -Micah On Tuesday 27 April 2004 04:05 pm, Swan, Nicole wrote: > Have you tried a nested query? I think your problem is that you're really > using information from two diffe

RE: [PHP-DB] Request for help on (My)SQL Statement

2004-04-27 Thread John.Bedard
So you're saying there's no way to do it in this version with a single statement? Thanks, John -Original Message- From: Micah Stevens [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 27, 2004 5:00 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Request for help on (My)SQL Statement That

RE: [PHP-DB] Request for help on (My)SQL Statement

2004-04-27 Thread Swan, Nicole
You're right, of course, Micah. I guess I've been using my development server (which has MySQL 4.1a) for so long, that I've forgotten. :) I guess, then, that two queries would need to be used instead. --Nicole -Original Message- From: Micah Stevens [mailto:[EMAIL PROTECTED] Sent: Tuesd

RE: [PHP-DB] Request for help on (My)SQL Statement

2004-04-27 Thread John.Bedard
Okay, I'll go in that direction. Thanks! John -Original Message- From: Swan, Nicole [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 27, 2004 5:17 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Request for help on (My)SQL Statement You're right, of course, Micah. I guess I've been using

Re: [PHP-DB] First letter

2004-04-27 Thread Cornelia Boenigk
Hi Matt You can teat a string like an Array $first = $string[0]; $second = $string[1] and so on. Regards Conni -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] First letter

2004-04-27 Thread George Patterson
On Tue, 27 Apr 2004 16:05:32 -0700 (PDT) "Daniel Clark" <[EMAIL PROTECTED]> wrote: > $rest = substr("abcdef", 1, 3); // returns "bcd" > > http://www.phpbuilder.com/manual/function.substr.php > > > > What PHP function returns just the first letter of a string? > > - Matt > > Or to properly answ

Re: [PHP-DB] Request for help on (My)SQL Statement

2004-04-27 Thread Micah Stevens
Not with MySQL that I know of, some local guru might have an idea.. Why are you storing the data in another table? Usually duplicating data in a database is a big signal of flawed design. If you're using it somewhere else, just select it from the originating table each time. Unless you're tryin

Re: [PHP-DB] Request for help on (My)SQL Statement

2004-04-27 Thread Rachel Rodriguez
> UPDATE ngc_polling SET lastrundate = > max(nuke_phpbb_posts.post_time) > > It returns "Invalid use of group function." > John, you're getting that error message because the max() function requires a GROUP BY clause. Try this: SELECT max(nuke_phpbb_posts.post_time) FROM nuke_phpbb_posts

RE: [PHP-DB] Request for help on (My)SQL Statement

2004-04-27 Thread John.Bedard
I'm running a notification script that does an action if the date of the last post is greater than the last time the script ran, which is the value stored in the other table. The action is to notify the members if there has been a new post in the past 24 hours. The client is trying to generate

Re: [PHP-DB] Request for help on (My)SQL Statement

2004-04-27 Thread Rachel Rodriguez
> > John, you're getting that error message because the > max() function requires a GROUP BY clause. > Ooops, my bad. It requires a GROUP BY if you are pulling from more than one column. = ~Rachel __ Do you Yahoo!? Win a $20,0

Re: [PHP-DB] Request for help on (My)SQL Statement

2004-04-27 Thread Micah Stevens
Well then there's no reason to copy the value. Just select from the BB table. Just: $l = mysql_fetch_array(mysql_query("SELECT max(post_time) as latest_post FROM nuke_phpbb_posts")); $s = mysql_fetch_array(mysql_query("SELECT max(script_run_date) as latest_script from script_data") if ($l['lat

Re: [PHP-DB] First letter

2004-04-27 Thread holmes072000
> From: matthew perry <[EMAIL PROTECTED]> > What PHP function returns just the first letter of a string? echo substr($str,0,1); or echo $str{0}; ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Session

2004-04-27 Thread Sukanto Kho
Hi, I have a problem in handling session... so I just reply in this topic. I have created a site... when user login from one browser ..i set a session['user'] the problem is that when user open another browser ...he is not login ...he have to login again... So that 1 pc may login as 2 or mor

Re: [PHP-DB] Session

2004-04-27 Thread Daniel Clark
Depends on the browser. IE and Netscsape handle opening another window differently. > Hi, I have a problem in handling session... so I just reply in this topic. > > I have created a site... when user login from one browser ..i set a > session['user'] > > the problem is that when user open an

Re: [PHP-DB] Session

2004-04-27 Thread Marcjon Louwersheimer
Do you mean a new browser window or a new browser? Like using IE first and then netscape? If it's the latter, it wont be saved. It generates a new session ID and wont use the same session as the first browser. -- Marcjon -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP-DB] Cursor in text box.

2004-04-27 Thread matthew perry
My users complain about everything. The most common is "Why do I have to move the mouse over to this box every time? Wh!" How do I get the cursor to que into the first input area of my form? -Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/

[PHP-DB] Scrolling drop down menu

2004-04-27 Thread matthew perry
When my users choose an option in the drop down menu, they sometimes accidentally change what they have chosen when the move the center scrolling button of their mouse. I was giving a presentation in front of my company's owner and did this myself. 5 or so index fingers instantly pointed at me

Re: [PHP-DB] Cursor in text box.

2004-04-27 Thread John W. Holmes
matthew perry wrote: My users complain about everything. The most common is "Why do I have to move the mouse over to this box every time? Wh!" How do I get the cursor to que into the first input area of my form? JavaScript, not PHP. document.yourform.yourtextbox.focus(), I think. -- ---John

Re: [PHP-DB] Scrolling drop down menu

2004-04-27 Thread John W. Holmes
matthew perry wrote: When my users choose an option in the drop down menu, they sometimes accidentally change what they have chosen when the move the center scrolling button of their mouse. I was giving a presentation in front of my company's owner and did this myself. 5 or so index fingers ins

Re: [PHP-DB] Cursor in text box.

2004-04-27 Thread Justin Patrin
John W. Holmes wrote: matthew perry wrote: My users complain about everything. The most common is "Why do I have to move the mouse over to this box every time? Wh!" How do I get the cursor to que into the first input area of my form? JavaScript, not PHP. document.yourform.yourtextbox.foc

Re: [PHP-DB] Scrolling drop down menu

2004-04-27 Thread Justin Patrin
John W. Holmes wrote: matthew perry wrote: When my users choose an option in the drop down menu, they sometimes accidentally change what they have chosen when the move the center scrolling button of their mouse. I was giving a presentation in front of my company's owner and did this myself. 5

[PHP-DB] scrolling drop down menu

2004-04-27 Thread matthew perry
Then I withdraw the question. Thank you for your time. John W. Holmes wrote: matthew perry wrote: When my users choose an option in the drop down menu, they sometimes accidentally change what they have chosen when the move the center scrolling button of their mouse. I was giving a presentation

Re: [PHP-DB] Cursor in text box.

2004-04-27 Thread Uzi Klein
- Original Message - From: "matthew perry" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 28, 2004 5:44 AM Subject: [PHP-DB] Cursor in text box. > My users complain about everything. > The most common is "Why do I have to move the mouse over to this box > every tim

[PHP-DB] MySQL - counting number of instances of a word in a field

2004-04-27 Thread Gavin Amm
Hi guys, I'm trying to find a MySQL function(s) that will allow me to count the number of words in a field. For eg: [table: pages] id - title - keywords - body 1 - Home - home, page - This is my home page. Enjoy your stay. 2 - Feedback - feedback, form, contact - Please enter any feedback or

[PHP-DB] Re: Session

2004-04-27 Thread JeRRy
Hi, Regarding the recent thread on sessions. If you want cookies to expire after the user leaves the sie or closes the browser do not leave the expiry date emty. 9 times out of 10 the cookie will remain. All you need to do is set a date that has passed. Like 1st Jan 2000. Most set it way bac

[PHP-DB] PostgreSQL lib and character case

2004-04-27 Thread Tumurbaatar S.
I use pg_fetch_array() to get a record content. But it seems that to access elements of the returned associative array, I should use lowercase field names. Is there any way to use case-insensitive field names? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.p