RE: [PHP-DB] Mail problem

2002-08-01 Thread Russ

Could you not simply extract all the email addresses from the DB as you
would any other data, then loop thru the result set calling PHP's mail()
function for every record retrieved?

while($row=mysql_fetch_assoc($result))
{
extract($row);
//Presume's '$email ' is the name of the field in which email addresses
are stored in your DB:
@mail($email,$from,$subject,$body);
}

or am I missing something??
Russ

-Original Message-
From: Bartek Pawlik [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 2:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Mail problem


Sorry to be a little bit off topic.

I need a tool or script in PHP, that will automaticaly send e-mails to
receipients taken from database.
For example 1 the same e-mail to 1000 receipients. B

Mail server is on different machine.

Thanks in advance

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




Re: [PHP-DB] Mail problem

2002-08-01 Thread Bartek Pawlik

Of course, but

PHP is on Linux machine where I don't have sendmail, because my 
mail server is on different machine, and that's my problem

Bartek

- Original Message - 
From: Russ [EMAIL PROTECTED]
To: Bartek Pawlik [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 8:38 AM
Subject: RE: [PHP-DB] Mail problem


Could you not simply extract all the email addresses from the DB as you
would any other data, then loop thru the result set calling PHP's mail()
function for every record retrieved?

while($row=mysql_fetch_assoc($result))
{
extract($row);
//Presume's '$email ' is the name of the field in which email addresses
are stored in your DB:
@mail($email,$from,$subject,$body);
}

or am I missing something??
Russ

-Original Message-
From: Bartek Pawlik [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 2:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Mail problem


Sorry to be a little bit off topic.

I need a tool or script in PHP, that will automaticaly send e-mails to
receipients taken from database.
For example 1 the same e-mail to 1000 receipients. B

Mail server is on different machine.

Thanks in advance

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



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




RE: [PHP-DB] Mail problem

2002-08-01 Thread Russ

Just looking at our php.ini file and we use an external machine to send
mail with when calling the mail() function.

I think you just need to change the directive for the path/URI to the
mail server you wish PHP to use, in your php.ini file.

HTH :-)
Russ

-Original Message-
From: Bartek Pawlik [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 2:47 PM
To: [EMAIL PROTECTED]; Russ
Subject: Re: [PHP-DB] Mail problem


Of course, but

PHP is on Linux machine where I don't have sendmail, because my 
mail server is on different machine, and that's my problem

Bartek

- Original Message - 
From: Russ [EMAIL PROTECTED]
To: Bartek Pawlik [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 8:38 AM
Subject: RE: [PHP-DB] Mail problem


Could you not simply extract all the email addresses from the DB as you
would any other data, then loop thru the result set calling PHP's mail()
function for every record retrieved?

while($row=mysql_fetch_assoc($result))
{
extract($row);
//Presume's '$email ' is the name of the field in which email addresses
are stored in your DB:
@mail($email,$from,$subject,$body);
}

or am I missing something??
Russ

-Original Message-
From: Bartek Pawlik [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 2:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Mail problem


Sorry to be a little bit off topic.

I need a tool or script in PHP, that will automaticaly send e-mails to
receipients taken from database.
For example 1 the same e-mail to 1000 receipients. B

Mail server is on different machine.

Thanks in advance

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



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




[PHP-DB] php mysql external server

2002-08-01 Thread Meethoo Salim

hello there ,
i have my Mysql server installed on a different machine- how ca li access
it?
can someone help me out please
regards



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




RE: [PHP-DB] php mysql external server

2002-08-01 Thread Beau Lebens

Meethoo
as it says in the PHP documentation, you can access a MySQL server whether
it's on the same machine as the PHP install or not.

ie. mysql_connect('localhost', $user, $pass)
OR mysql_connect('111.111.111.111', $user, $pass)

Beau

// -Original Message-
// From: Meethoo Salim [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 1 August 2002 3:24 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] php mysql external server
// 
// 
// hello there ,
// i have my Mysql server installed on a different machine- how 
// ca li access
// it?
// can someone help me out please
// regards
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




[PHP-DB] Date Add

2002-08-01 Thread John Fishworld

I thought I had this working, but it seems unfortunately not !!!

I'm trying to list events for each month and my select query is as follows

SELECT DISTINCT t_city_name,t_city_id_city FROM
t_city,t_zipcodecity,t_location,t_event WHERE (t_city_id_city =
t_zipcodecity_id_city) AND (t_zipcodecity_zipcode = t_location_zipcode ) AND
((t_location_sex = 4) OR (t_location_sex = 6) OR (t_location_sex = 0)) AND
(t_location_id_location = t_event_id_location) AND (t_event_date 
(DATE_ADD('2002-08-01 00:00:00', INTERVAL 31 day)) ) AND (t_event_date 
'2002-08-01 00:00:00') ORDER by t_city_name

this is for August and seems to work fine, but my problem is that in the
running month I only want to show the still forthcoming events so for today
July the 31 st my query looks like this

SELECT DISTINCT t_city_name,t_city_id_city FROM
t_city,t_zipcodecity,t_location,t_event WHERE (t_city_id_city =
t_zipcodecity_id_city) AND (t_zipcodecity_zipcode = t_location_zipcode ) AND
((t_location_sex = 4) OR (t_location_sex = 6) OR (t_location_sex = 0)) AND
(t_location_id_location = t_event_id_location) AND (t_event_date 
(DATE_ADD('2002-07-31 00:00:00', INTERVAL 0 day)) ) AND (t_event_date 
'2002-07-31 00:00:00') ORDER by t_city_name

But it doesn't work ??
Can anyone give me a hint in the right direction ??
The problem is definately in the last part  (t_event_date 
(DATE_ADD('2002-07-31 00:00:00', INTERVAL 0 day)) ) AND (t_event_date 
'2002-07-31 00:00:00')

Thanks in advance





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




[PHP-DB] Multiple select ?

2002-08-01 Thread Dave Carrera

Hi All
I have a situation where I need to do select on my mysql db.

Here is what I am trying to do

Select * from table_name where col1=1 and col2=1 and col3=0

But this refuses to work.

If I change the above to this.

Select * from table_name where col1=1 OR col2=1 and col3=0

What I get is all rows whether or not col3 is 0 or 1.

I am confused ☹

Any help or guidance is very much appreciated.

Thanks in advance

Dave C


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




[PHP-DB] PHP --with-pgsql

2002-08-01 Thread Jan Feller

Hello!

I´have a problem compiling PHP 4.1.2 with PostgreSQL.
Running the Makefile returns this problem:

ld: fatal: library -lpq: not found

I edited the Makefile adding some lib-paths. But none of ´em worked.
Which library is missing and what can I do?

Thx in advance  

Regards 

Jan 

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


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




Re: [PHP-DB] PHP --with-pgsql

2002-08-01 Thread Rasmus Lerdorf

It is obviously missing libpq

You need to installed the postgresql libraries.  If you are installing
from packages, install the postgresql-devel package.

-Rasmus

On Thu, 1 Aug 2002, Jan Feller wrote:

 Hello!

 I´have a problem compiling PHP 4.1.2 with PostgreSQL.
 Running the Makefile returns this problem:

 ld: fatal: library -lpq: not found

 I edited the Makefile adding some lib-paths. But none of ´em worked.
 Which library is missing and what can I do?

 Thx in advance

 Regards

 Jan

 --
 GMX - Die Kommunikationsplattform im Internet.
 http://www.gmx.net


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



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




Re: [PHP-DB] Multiple select ?

2002-08-01 Thread Jason Wong

On Thursday 01 August 2002 17:06, Dave Carrera wrote:
 Hi All
 I have a situation where I need to do select on my mysql db.

 Here is what I am trying to do

 Select * from table_name where col1=1 and col2=1 and col3=0

 But this refuses to work.

How does it refuse to work? Any error messages?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
A good memory does not equal pale ink.
*/


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




Re: [PHP-DB] Mail problem

2002-08-01 Thread Manuel Lemos

Hello,

On 12/31/1969 09:00 PM, Unknown Sender wrote:
 Of course, but
 
 PHP is on Linux machine where I don't have sendmail, because my 
 mail server is on different machine, and that's my problem

If you are allowed, you can install sendmail in your machine and 
configure to route all mail through the mail server.

If you can't, all you can do is to use some PHP SMTP client code to send 
your messages.

In this case you may want to try this class that is optimized for 
queuing messages for many recipients as you need.

http://www.phpclasses.org/smtpclass

You are strongly recommended to put all recipients in Bcc: because 
queuing via SMTP is much slower than using a local mailer like sendmail 
and it would take you a long time to queue if you send separate messages 
for each recipient.

-- 

Regards,
Manuel Lemos


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




[PHP-DB] Novice to PHP. Database connection help needed

2002-08-01 Thread Ing. Rajesh Kumar

Hi everybody
I am normally working with ASP and ASPX. Now I want to try PHP. I installed
and tried some simple scripts and they are running fine. Now it is time to
working with database but i could not find something helpful in the manual.
Can someone give me a link or better a code how to connect to a database
(SQl and ACCESS)

Thanks in advance
Raja




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




Re: [PHP-DB] Novice to PHP. Database connection help needed

2002-08-01 Thread Josh Trutwin

You might want to look at some of the free abstraction layers out there
like ADODB (http://php.weblogs.com/ADODB).

http://www.devshed.com/Server_Side/PHP/ has a couple nice articles on
using ADODB.

Good luck.

Josh

 Hi everybody
 I am normally working with ASP and ASPX. Now I want to try PHP. I
 installed and tried some simple scripts and they are running fine. Now
 it is time to working with database but i could not find something
 helpful in the manual. Can someone give me a link or better a code how
 to connect to a database (SQl and ACCESS)

 Thanks in advance
 Raja




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




Re: [PHP-DB] Novice to PHP. Database connection help needed

2002-08-01 Thread Jason Wong

On Thursday 01 August 2002 19:52, Ing. Rajesh Kumar wrote:
 Hi everybody
 I am normally working with ASP and ASPX. Now I want to try PHP. I installed
 and tried some simple scripts and they are running fine. Now it is time to
 working with database but i could not find something helpful in the manual.
 Can someone give me a link or better a code how to connect to a database
 (SQl and ACCESS)

PHP has support for MS-SQL (I assume that is what you mean by SQl), manual has 
examples on use. To connect to Access you would probably have to use ODBC.

Anyway if the examples in the manual aren't enough for you, search google for 
plenty of tutorials.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
Those who don't know, talk.  Those who don't talk, know.
*/


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




[PHP-DB] Re: please help.. serial number generator

2002-08-01 Thread Hugh Bothwell


Rainydays Sunshine [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I need to create some kind of 10 digits serial number where I can generate
 and check that it is valid. Sort of like a checksum..

How many unique values do you need, and how hard-to-fake?

I would consider something like 7+3 digits - the first seven digits
are generated more or less randomly, and the last three are
checksums...  this gives you 10 million valid combinations, and
a one-in-a-thousand chance of any random number being valid.
Obviously, the quickest way to increase security is to increase
the number of digits.

Each checksum can be any formula you can imagine, for example

// Expects:
//   d (digits) - array [0..6] of integer in [0..9]
function checksum1($d) {
// scrambler array
$s = array( 24, 78, 63, 501, 88, 89, 53, 14, 34, 266 );

return(
(
   ( $s[$d[0]] * $s[$d[6]] *  5) % 29
+ ( $s[$d[1]] * $s[$d[5]] *  7) % 31
+ ( $s[$d[2]] * $s[$d[1]] * 11) % 37
+ ( $s[$d[3]] * $s[$d[2]] * 13) % 41
+ ( $s[$d[4]] * $s[$d[0]] * 17) % 43
+ ( $s[$d[5]] * $s[$d[4]] * 19) % 47
+ ( $s[$d[6]] * $s[$d[3]] * 23) % 53
)
% 10
);
}

Hope this helps...



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




[PHP-DB] Help Needed

2002-08-01 Thread Manoj Japher

hi,
  I have started working with PHP-MySQL recently. I have been 
getting a
warning message which i am not able to debug. Could some one  pls 
help
me out?

The message is
Warning: mysql_num_rows(): supplied argument is not a valid 
MySQL
result resource in /usr/local/apache2/htdocs/verify.php on line 
37

The code is
   
$db=mysql_pconnect(localhost:/var/lib/mysql/mysql.sock,,);
 

   if(!$db)
   {
echo  The Server is Busy. Please Try Later ;
exit;
   }


  mysql_select_db(userinfo);

  $query = select * from userinfo;

  $mysql_results = mysql_query($query,$db);

line 37:$num_result = mysql_num_rows($mysql_results);

  if($num_result == 0)
   {
 echo PInvalid Username or Password entered/P;
 exit;
   }

Regards,

Manoj


'I have miles to go before I sleep, and promises to keep'

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




[PHP-DB] get row id back on INSERT?

2002-08-01 Thread Michael Zornek

Ok, 

So I'm creating the usually MySQL backend

I have a page that I want to create a new record with some name, then I'd
like to capture the new records id (which is an auto-increment int field) so
I can pass it to the edit.php?id=$theId URL

I could run a reach for the newly inserted row by name .. but that's not
guaranteed to be unique. Maybe name search .. SORT by creation time ? (but
how?)

Any way to do this?

~ Mike
-- 
Mike Zornek | Project Leader
Apple Student Developers
The Insanely Great Site with the Insanely Long URL
http://www.applestudentdevelopers.org

Personal Site: 
http://www.mikezornek.com


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




Re: [PHP-DB] get row id back on INSERT?

2002-08-01 Thread Jason Wong

On Friday 02 August 2002 03:27, Michael Zornek wrote:
 Ok,

 So I'm creating the usually MySQL backend

 I have a page that I want to create a new record with some name, then I'd
 like to capture the new records id (which is an auto-increment int field)
 so I can pass it to the edit.php?id=$theId URL

 I could run a reach for the newly inserted row by name .. but that's not
 guaranteed to be unique. Maybe name search .. SORT by creation time ? (but
 how?)

 Any way to do this?

rtfm ? mysql_insert_id()

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
All the troubles you have will pass away very quickly.
*/


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




[PHP-DB] Whats the best way to update...

2002-08-01 Thread Jas

I need to know the best way to update a record based on something like the
session id being the same, except the other fields are not.  Any examples of
this would help...

$table = cm_sessions;
 $sql_insert_form = INSERT INTO $table
(session,ipaddy,host,referrer,hck,nrml,hour,date_stamp) VALUES
('$holy_cow','$ipaddy','$host','$domain_b','$hck','-','$hour','$date');
 $result = mysql_query($sql_insert_form,$dbh) or die(MYSQL_ERROR());

or

$sql_insert = UPDATE $table WHERE session = $HTTP_SESSION_VARS['session']
or if the session vars are the same it would insert a new row?  I hope I am
asking the question correctly.  Any help, examples would be great!
TIA
Jas



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




[PHP-DB] Re: Multiple select ?

2002-08-01 Thread Adam Royle

Try using parentheses inside your sql:

Select * from table_name where (col1=1 OR col2=1) and col3=0
Select * from table_name where col1=1 OR (col2=1 and col3=0)

They make a big difference, also helps to indentify what you're selecting when you 
come back to the sql later.

Adam



[PHP-DB] Problem

2002-08-01 Thread Dennis Jacobsen

I have a 2 problems, I need to track referrer urls with a: 

 

PROBLEM #1
With HTML Extension
http://www.anydomain.com/main.htmll?
http://www.anydomain.com/main.htmll?Aid=44554 Aid=44554 

 

1. From an html page I used a similar url
http://www.anydomain.com/main.html?
http://www.anydomain.com/main.html?Aid=44554 Aid=44554 

All the information comes back with the exception of the variables

ie: Aid=44554 I have tried every global, get, env, server, post request
and nothing.

 

 

Nothing separates the variables from the url

What I am getting for problem 1 is:

id  affiliate_id siterequest_time  
1   0'www.anydomain.com' '2002-08-01 08:02:37'


What I need for problem 1 is:

id  affiliate_id siterequest_time  
1   44554  'www.anydomain.com'   '2002-08-01 08:02:37'

this is the dump for the tracker table from the page with the HTML
extension


INSERT INTO tracker VALUES (1, 0, 'www.anydomain.com', '2002-08-01
08:02:37', '74fcfc275d5c481c4ce77c9225333f78',
'http://www.anydomain.com/main.html?Aid=44554', '/affiliate/_track.php',
'', 'GET', '/affiliate/_track.php', '65.100.198.85',
'slkcdslgw7PoolA85.slkc.uswest.net', 'MS Internet Explorer', '6.0',
'Windows', '2000', '*/*', 'en-us', 'Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; Q312461; .NET CLR 1.0.3705)', 8);


PROBLEM #2
With PHP Extension
http://www.anydomain.com/main.php?
http://www.anydomain.com/main.php?Aid=88778 Aid=88778

 

2. If I use this from a php page ie:
http://www.anydomain.com/main.php?
http://www.anydomain.com/main.php?Aid=88778 Aid=88778 not only does
the variables not show up but the referrer and host and other info does
not pass.



This is the same page and same internet connection, but using PHP as an
extension instead of HTML, you'll notice that much of the information is
unknown.

this is the dump for the tracker table from the page with the PHP
extension


INSERT INTO tracker VALUES (2, 0, 'www.anydomain.com', '2002-08-01
08:04:12', '5b7f77e273ccf01d1a1d0f87713d5ecb', '',
'/affiliate/_track.php', '', 'GET', '/affiliate/_track.php',
'209.197.255.10', 'Unresolved Address', 'Unknown', 'Unknown', 'Unknown',
'Unknown', '', '', 'PHP/4.2.2', 0);


Is there any other suggestions for both problems.

Here is the section of code I am currently using:

 

 

function record($DEBUG=0,$useragent=''){

global $_SERVER, $HTTP_SESSION_VARS;

 
preg_match('/.*\?Aid=([0-9]+)/',$REQUEST_URI,$matches);

$Aid=$matches[1]; 

if($DEBUG){

echo Recording...br\n;

flush();

}

 

$REMOTE_ADDR='';

$HTTP_ACCEPT='';

$HTTP_ACCEPT_LANGUAGE='';

$REQUEST_METHOD='';

$SCRIPT_NAME='';

$QUERY_STRING='';

$REQUEST_URI='';

$HTTP_REFERER='';

$RDATE_TIME = date(Y-m-d H:i:s);

   

// below is to prevent servers like IIS from throwing errors
when a

// server var doesn't exist (like REQUEST_URI)

if(isset($_SERVER['REMOTE_ADDR']))

$REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];

if(isset($_SERVER['HTTP_ACCEPT']))

$HTTP_ACCEPT = $_SERVER['HTTP_ACCEPT'];

if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))

$HTTP_ACCEPT_LANGUAGE = $_SERVER['HTTP_ACCEPT_LANGUAGE'];

if(isset($_SERVER['REQUEST_METHOD']))

$REQUEST_METHOD = $_SERVER['REQUEST_METHOD'];

if(isset($_SERVER['SCRIPT_NAME']))

$SCRIPT_NAME = $_SERVER['SCRIPT_NAME'];

if(isset($_SERVER['QUERY_STRING']))

$QUERY_STRING = $_SERVER['QUERY_STRING'];

if(isset($_SERVER['REQUEST_URI']))

$REQUEST_URI = $_SERVER['REQUEST_URI'];

if(isset($_SERVER['HTTP_REFERER']))

$HTTP_REFERER = $_SERVER['HTTP_REFERER'];

 

$REMOTE_HOST = gethostbyaddr($REMOTE_ADDR);

if($REMOTE_HOST == $REMOTE_ADDR)

$REMOTE_HOST = Unresolved Address;

 

if(isset($_GET['Aid']))

$Aid=$_GET['Aid'];

else if(isset($_POST['Aid']))

$Aid=$_POST['Aid'];

else

$Aid=-100;  // For debug

 

if(empty($useragent))

$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];

else

$HTTP_USER_AGENT = $useragent;// for debugging
browser/op sys regex

 

$browser=$this-getBrowser($HTTP_USER_AGENT);   // get the
browser info

//echo pre\n.$HTTP_USER_AGENT; print_r($browser); echo \n;

$system=$this-systemInfo($HTTP_USER_AGENT);// get the
system info

//echo pre;print_r($system); echo /pre;

$query=insert into .$this-STAT_TABLE.(site, affiliate_id,
request_time, session_id, referer, request_uri, .

query_string, request_method, script_name, remote_addr,
remote_host, 

Re: [PHP-DB] Help Needed

2002-08-01 Thread leo g. divinagracia iii

you need a second REQUIRED parameter:

mysql_result

(PHP 3, PHP 4 )

mysql_result -- Get result data

Description

mixed mysql_result ( resource result, int
row [, mixed field])

as copied from php's doc site...

http://www.php.net/manual/en/function.mysql-result.php

Manoj Japher wrote:

 hi,
   I have started working with PHP-MySQL recently. I have been
 getting a
 warning message which i am not able to debug. Could some one  pls
 help
 me out?

 The message is
 Warning: mysql_num_rows(): supplied argument is not a valid
 MySQL
 result resource in /usr/local/apache2/htdocs/verify.php on line
 37

 The code is

 @$db=mysql_pconnect(localhost:/var/lib/mysql/mysql.sock,,);


if(!$db)
{
 echo  The Server is Busy. Please Try Later ;
 exit;
}

   mysql_select_db(userinfo);

   $query = select * from userinfo;

   $mysql_results = mysql_query($query,$db);

 line 37:$num_result = mysql_num_rows($mysql_results);

   if($num_result == 0)
{
  echo PInvalid Username or Password entered/P;
  exit;
}

 Regards,

 Manoj

 'I have miles to go before I sleep, and promises to keep'

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

--
Leo G. Divinagracia III
[EMAIL PROTECTED]



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




[PHP-DB] Addslashes in SQL Statement

2002-08-01 Thread Rich Hutchins

I have been wrestling with this off and on for the past couple days and
would really appreciate some help.

I have a Guest Book page that collects name, address, e-mail, etc. in a
form. I won't post the form code because it's just HTML and it works fine.
Besically, the page does one of two things:

1) Adds a new guest to the db.

OR

2) Updates the information for a guest record (passed in from another page).

I ran into problems with entering apostrophes for names like O'Reilly.
Naturally, I used addslashes(). However, adding addslashes() to the UPDATE
SQL statement that gets executed in condition 2 above works flawlessly both
to and from the db while addslashes() in the INSERT SQL statement that gets
executed in condition 2 above continues to bomb out.

Incidentally, if I attempt to add a new guest to the db without any special
characters, the process works just fine. So I know the error is related to
those special characters.

Here is the relevant SQL code:

This statement works flawlessly.

$sql = UPDATE contactInfo SET
firstnames='.addslashes($_POST[firstnames]).',
lastname='.addslashes($_POST[lastname]).',
street1='.addslashes($_POST[street1]).',
street2='.addslashes($_POST[street2]).',
city='.addslashes($_POST[city]).',
state='.addslashes($_POST[state]).',
zip='.addslashes($_POST[zip]).',
emailaddress='.addslashes($_POST[eMailAddress]).',
screenname='.addslashes($_POST[screenName]).' WHERE
personID='.$_POST[thisPersonID].';

This statement bombs.

$sql = INSERT INTO contactinfo (personID, firstnames, lastname, street1,
street2, city, state, zip, emailaddress, screenname) VALUES (NULL,
'.addslashes($_POST[firstnames]).',
'.addslashes($_POST[lastname]).', '.addslashes($_POST[street1]).',
'.addslashes($_POST[street2]).', '.addslashes($_POST[city]).',
'.addslashes($_POST[state]).', '.addslashes($_POST[zip]).',
'.addslashes($_POST[eMailAddress]).',
'.addslashes($_POST[screenName]).');

If I type in the last name O'Grady and the first name Gail, the error I
receive when the statement bombs is fairly standard and reads:

You have an error in your SQL syntax near 'Grady', '', '', '', '', '', '',
'')' at line 1.

And, finally, here's how I'm posting the form data:
form name=eMailEdit method=post action=?=$PHP_SELF?

Anybody have any ideas?

Thanks,
Rich



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




[PHP-DB] [php-objects] RE: [PHP] Re: [PHP-DEV] [CROSS POST] PHP Meetup Texas PHP Users

2002-08-01 Thread Martin Clifford

I'm definately interested, even though I'll most likely be in MN at the time.  I've 
never even MET another PHP developer, so I don't know what to expect, but I'd sure 
love to be updated :o)

Martin

 [EMAIL PROTECTED] 08/01/02 03:21PM 
Well, the predictions have come true. In San Antonio only four folks signed
up for the meetup, and the event was cancelled with no way to get in touch
with the other local developers to make a go of it. Out of the 147 cities
listed only 15 had enough people for meetup.com to do their thing. A noble
idea, but ...

I want to encourage developers to farm PHP developer groups in their own
communities. Some may find that their community already has a users group (a
list is available at http://www.phpusergroups.org) although some of these
groups are not really groups at all, just people looking to form groups.

If you live in the San Antonio area I would be glad to be the
chief-wrangler-whats-in-charge for just such a group. Please contact me
directly. I am also working on a Texas PHP Developer Conference at the
beautiful T Bar M Resort  Conference Center in New Braunfels, Texas
sometime between January and April of 2003. I have begun contacting
potential speakers and hope to have people who wish to present papers at the
conference as well as do some other fun activities such as a high or low
ropes course, golf, tennis, etc. All suggestions and admonitions are
welcome. Everyone in Texas is invited to contact me so that I can dispurse
further information. Also, my contact at T Bar M says, The more, the
cheaper ...  as discounts for larger groups are available. Heck, even if
you don't live in Texas but would be interested in attending drop me a line
and I'll keep you up to date.

Thanks!

Jay

It's as bad as you think, and they are out to get you.

***
* *
* Texas PHP Developers Meeting*
* Spring 2003 *
* T Bar M Resort  Conference Center  *
* New Braunfels, Texas*
* Interested? Contact;*
* [EMAIL PROTECTED] *
* *
***



Look here for Free PHP Classes of objects:
http://phpclasses.UpperDesign.com/ 
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED] 

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




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




[PHP-DB] RE: [PHP] Re: [PHP-DEV] [CROSS POST] PHP Meetup Texas PHP Users

2002-08-01 Thread Jay Blanchard

Well, the predictions have come true. In San Antonio only four folks signed
up for the meetup, and the event was cancelled with no way to get in touch
with the other local developers to make a go of it. Out of the 147 cities
listed only 15 had enough people for meetup.com to do their thing. A noble
idea, but ...

I want to encourage developers to farm PHP developer groups in their own
communities. Some may find that their community already has a users group (a
list is available at http://www.phpusergroups.org) although some of these
groups are not really groups at all, just people looking to form groups.

If you live in the San Antonio area I would be glad to be the
chief-wrangler-whats-in-charge for just such a group. Please contact me
directly. I am also working on a Texas PHP Developer Conference at the
beautiful T Bar M Resort  Conference Center in New Braunfels, Texas
sometime between January and April of 2003. I have begun contacting
potential speakers and hope to have people who wish to present papers at the
conference as well as do some other fun activities such as a high or low
ropes course, golf, tennis, etc. All suggestions and admonitions are
welcome. Everyone in Texas is invited to contact me so that I can dispurse
further information. Also, my contact at T Bar M says, The more, the
cheaper ...  as discounts for larger groups are available. Heck, even if
you don't live in Texas but would be interested in attending drop me a line
and I'll keep you up to date.

Thanks!

Jay

It’s as bad as you think, and they are out to get you.

***
* *
* Texas PHP Developers Meeting*
* Spring 2003 *
* T Bar M Resort  Conference Center  *
* New Braunfels, Texas*
* Interested? Contact;*
* [EMAIL PROTECTED] *
* *
***



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