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
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
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
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
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
"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
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
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
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
"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
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
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
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
> 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
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
:::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'
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
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
$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
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
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
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
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
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
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
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
> 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
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
>
> 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
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
> 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
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
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
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:
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/
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
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
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
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
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
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
- 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
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
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
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
45 matches
Mail list logo