On Tue, 2006-10-31 at 11:58 +0100, Robin Vickery wrote:
> On 30/10/06, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Mon, 2006-10-30 at 12:28 +0100, Robin Vickery wrote:
> > > On 30/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote:
> > > > On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wr
On Tue, October 31, 2006 4:58 am, Robin Vickery wrote:
> On 30/10/06, Robert Cummings <[EMAIL PROTECTED]> wrote:
>> On Mon, 2006-10-30 at 12:28 +0100, Robin Vickery wrote:
>> > On 30/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote:
>> > > On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
On 30/10/06, Robert Cummings <[EMAIL PROTECTED]> wrote:
On Mon, 2006-10-30 at 12:28 +0100, Robin Vickery wrote:
> On 30/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote:
> > On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
> >
> > > On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
# [EMAIL PROTECTED] / 2006-10-27 20:14:58 +0200:
> > And the header("Location: ...") requires a full URL.
> Why?
HTTP protocol specification[1] says:
14.30 Location
The Location response-header field is used to redirect the recipient
to a location other than the Request-URI for completion
On Mon, 30 Oct 2006 12:28:29 +0100, Robin Vickery wrote:
> On 30/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote:
>> On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
>> > On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
>> >> On Friday 27 October 2006 19:34, Richard Lynch wrote:
>>
On Mon, 2006-10-30 at 12:28 +0100, Robin Vickery wrote:
> On 30/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote:
> > On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
> >
> > > On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
> > >> On Friday 27 October 2006 19:34, Richard Lynch wrot
On 30/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote:
On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
> On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
>> On Friday 27 October 2006 19:34, Richard Lynch wrote:
>>> And the header("Location: ...") requires a full URL.
>>
>> No it
On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
> On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
>> On Friday 27 October 2006 19:34, Richard Lynch wrote:
>>> And the header("Location: ...") requires a full URL.
>>
>> No it doesn't. but he's missing an ' at first glance
>
> Yes, it
On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
> On Friday 27 October 2006 19:34, Richard Lynch wrote:
>> And the header("Location: ...") requires a full URL.
>
> No it doesn't. but he's missing an ' at first glance
Yes, it does:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3
On Fri, October 27, 2006 12:14 pm, [EMAIL PROTECTED] wrote:
>> And the header("Location: ...") requires a full URL.
> Why?
Because the docs say so?
Because some user agents will not do what you want them to if you don't?
--
Some people have a "gift" link here.
Know what I want?
I want you to bu
On Friday 27 October 2006 19:34, Richard Lynch wrote:
> Your idea to use 'COUNT(Username)' is just about the ONLY part of that
> script that you are doing correctly...
>
> :-)
>
> Start reading here:
> http://phpsec.org/
>
> And the header("Location: ...") requires a full URL.
No it doesn't. but h
> Your idea to use 'COUNT(Username)' is just about the ONLY part of that
> script that you are doing correctly...
>
> :-)
:D
> And the header("Location: ...") requires a full URL.
Why?
> And you should have better error-checking, probably.
> [Though maybe you have a custom error handler not ap
Your idea to use 'COUNT(Username)' is just about the ONLY part of that
script that you are doing correctly...
:-)
Start reading here:
http://phpsec.org/
And the header("Location: ...") requires a full URL.
And you should have better error-checking, probably.
[Though maybe you have a custom erro
- Original Message -
From: "Paul Novitski" <[EMAIL PROTECTED]>
While we're talking about optimization, I'd want to check to make sure
COUNT(*) didn't ask MySQL to generate a throw-away recordset consisting of
all fields. I wonder if it would be more machine-efficient to use
COUNT(`la
>>Would it be ok to use the same code to check if customer is loged in?
>>
>>$query = mysql_query("
>>SELECT COUNT(Username) as NoOfRecords
>>FROM customers
>>WHERE Username = '$Username' AND Password =
>> '$Password'");
>>if (mysql_result($query, 0)
At 10/26/2006 11:16 AM, [EMAIL PROTECTED] wrote:
Would it be ok to use the same code to check if customer is loged in?
$query = mysql_query("
SELECT COUNT(Username) as NoOfRecords
FROM customers
WHERE Username = '$Username' AND Password = '$Password'"
> Would it be ok to use the same code to check if customer is loged in?
>
> $query = mysql_query("
>SELECT COUNT(Username) as NoOfRecords
>FROM customers
>WHERE Username = '$Username' AND Password = '$Password'");
> if (mysql_result($query, 0) == 0)
Why would you want to do that? Think about what you're trying to do. In the
first case you want a COUNT of records in the database, in the second you
just want to see if the user/password combination or whatever exist, so just
use a normal SELECT query, no need to use the wrong tool for the job...
Would it be ok to use the same code to check if customer is loged in?
$query = mysql_query("
SELECT COUNT(Username) as NoOfRecords
FROM customers
WHERE Username = '$Username' AND Password = '$Password'");
if (mysql_result($query, 0) == 0)
{
echo 'Ple
On Thu, October 26, 2006 12:57 pm, Paul Novitski wrote:
>>$query = mysql_query("
>> SELECT COUNT(*) as NoOfRecords
>> FROM customers
>> WHERE last_name = 'Smith'");
>>$result = mysql_fetch_array($query);
>>$NoOfRecords = $result['NoOfRecords'];
This
Sorry, my bad! It works jsut fine. I did misstake.
:)
>>
>>
>> > $query = mysql_query("
>> >SELECT COUNT(*) as NoOfRecords
>> >FROM customers
>> >WHERE last_name = 'Smith'");
>> > $result = mysql_result($query, 0);
>> >
--
PHP General Mailing List
At 10/26/2006 10:38 AM, [EMAIL PROTECTED] wrote:
what would be better solution to count records in table (e.g., how many
customers have last name 'Smith'):
$query = mysql_query("
SELECT COUNT(*) as NoOfRecords
FROM customers
WHERE last_name = 'Smit
Hm. There is a little problem - this doesn't work.
Warning: mysql_result(): supplied argument is not a valid MySQL result
resource in /var/www/html/xxx/tests/count.php on line 28
?
> $query = mysql_query("
>SELECT COUNT(*) as NoOfRecords
>FROM customers
>
WOW! That was fast!
:D
Thanks Dave!
-afan
> $query = mysql_query("
>SELECT COUNT(*) as NoOfRecords
>FROM customers
>WHERE last_name = 'Smith'");
> $result = mysql_result($query, 0);
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscr
$query = mysql_query("
SELECT COUNT(*) as NoOfRecords
FROM customers
WHERE last_name = 'Smith'");
$result = mysql_result($query, 0);
25 matches
Mail list logo