[PHP] PHP and mySQL

2002-03-04 Thread Max Mouse

I have a little problem when trying to count the number of results returned
in a mysql query. I was using mysql_num_rows() to do it with no problems,
but this isn't as quick as using mySQL's COUNT(*), or so I have been told so
I swtiched. Here's a snipit of the code...

$sqlinfo = "SELECT username, COUNT(username) as count FROM usertable WHERE
username='me' GROUP BY username";
$sqlresult = mysql_query($sqlinfo)
  or die(mysql_error());

$count = mysql_result($sqlresult,0,"count");

if ($count <= 0) {
  FAILED
} else {
  while ($row = mysql_fetch_array($sqlresult)) {
$username = $row['username'];
  }
}

The count value is set correctly but:  when the while() loop is
executed...no values are set (there are a lot more, but I shortened it for
spaces sake). So, $username is null. If I remove the $count line, it
worksany suggestions?

Max


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] $HTTP_COOKIE_VARS

2002-03-21 Thread Max Mouse

I've tried using $HTTP_COOKIE_VARS to get information about the cookie has
been passed to the current script but I always get a cookie size of 1
containing no information. I have also tried using $_COOKIE but with no
success. I'm running apache1.2.23 and php 4.1.2. Suggestions?

Max


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Problem

2001-11-12 Thread Max Mouse

I'm trying to update from the CVS...and when I try to make I get the
following error..

[root@freedom:~/php4]# make
Making all in Zend
byacc -p zend -v -d ./zend_language_parser.y -o zend_language_parser.c
usage: yacc [-dlrtv] [-b file_prefix] [-o output_filename]
[-p symbol_prefix] filename
*** Error code 1

Stop in /usr/home/maxmouse/php4/Zend.
*** Error code 1

Stop in /usr/home/maxmouse/php4.

Now, here's the specs on my machine FreeBSD 4.4-Release, libtool-1.4.1,
bison-1.30, autoconf-2.13, automake-1.4-p5.

Any ideas?

Max


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Cookie Help

2001-08-13 Thread Max Mouse

Hi, I have a problem with setting cookies...I am able to set cookies and
retreive the information when using IE but not netscape. I'm not totally
sure what the problem is. Here is the syntax that I am using, any
suggestions are welcomed.

$cookiedata = "Mmmm";
$time = mktime()+900;
$expire = date("l, d-M-y H:i:s", ($time));
setcookie("cookiemonster", $cookiedata, $expire, "/", "domain.com.", 1);

It needs to be secure, hence the 1. Also, I need the domain to be
"domain.com" and it cannot be www.domain.com. Can anyone help me at all?
Thanks!

Max


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] IDE

2001-08-18 Thread Max Mouse

Can anyone suggest a decent IDE for php? Currently, I'm using phped and I'm
not overly happy with it's performance...

Max


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Attaching stuff

2001-09-03 Thread Max Mouse

I want to be able to include a graphic or something of that sort in a form
mail (using mail() from ). Is this possible?

Max



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Email checking

2001-09-13 Thread Max Mouse

I've been looking to check the validity of an email address when it's
entered by a person on a from. So far, I have found many different versions
of code to do this, but I have yet to find one that actually works. I would
like to be able to check to see that: the email is in the correct format and
the domain actually exists. Can anyone lend a hand?

Max


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Counting

2001-09-17 Thread Max Mouse

I'm using php/mysql. I want to be able to count the number of records that
match something.
I've used mysql_num_rows() and it does work, but is there a better way?
Something like COUNT(*)? I've tried to use it, but all I get is Resource ID
#1 or something similar. Any ideas for the best way to do this?

Max


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]