[PHP-DB] Re: ?? php and mysql database question ??

2003-06-07 Thread JeRRy
snip
hi,

u can install vmware (not freeware) on your windows
machine and then 
install linux as a virtual machine. it behaves just
like a real 
machine. 
works fine for me!
/snip

Yup I am aware of this but would be much better under
Windows itself, saves mucking around than if it is
possible.  Which it is.  :)  

I downloaded yesturday a Windows version of mysql that
runs via DOS.  Works a wonderful.  Does exactly what I
want being offline.  Now I have can do all my PHP and
mysql work offline as I have all the tools now for it.
 including the PHP server side to display php offline
correctly.

Thanks people for all your help in pointing me in the
right direction.  Mostly appreicated and I hope I can
help some of you in return sometime soon.

Now off to do my offline work. :)

Kind Regards,
Jerry

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] PHP mail fetching email address(es) from database question!

2003-04-01 Thread JeRRy
Hi,

Fristly, thanks Jen for your information earlier.  I
have managed to fetch email addresses from a database
to be sent out via email fine.  But I have a few
problems which are listed below.

1) I can't get from to work at all.  :(  When the
emails are generated it goes out as nobody @ domain. 
I have tried putting $HEADERS .= email but it fails
badly.  Any idea why?  (the emails go out fine with
the message to all people in the database)

2) I have not managed to find out how to put their
first name at the top of the message.  e.g. to bob,
... I have thought of a few ways, have not tried it
yet.  But would be in the mysql function before it
closes and could be legnthy.. I'd prefer to have it
like a single line and further down have the message. 
At the pressent time I type a message in a form from
the browser with the subject.  Even if I had from on
that form also to input is fine but I can't get it to
work. :(  

The code is below.  Quite easily achieved in the end. 
All help is mostly appreicated.

Thanks in advance.

Jerry



?php

if(empty($SEND)){$SEND=;}

switch($SEND){
case Send:
if(!empty($MESSAGE)){
$HEADERS  .= MIME-Version:
1.0;
$HEADERS .= Content-type:
text/html; charset=iso-8859-1;

/* This script is based on
pulling email addresses from a MySQL user database The
code below
should be changed to the appropriate information */


$linkID =
mysql_connect(localhost, usr, password);
mysql_select_db(db, $linkID);

$obRS = mysql_query(SELECT
email FROM tipping, $linkID);

while($row =
mysql_fetch_row($obRS)){
foreach ($row as
$field){
mail($field,
$SUBJECT, $MESSAGE, $HEADERS);
print Message
sent to: b$field/bbr;


}
}

mysql_close($linkID);
print hrbMESSAGE
DETAILS/bhr;
print bFrom: /b
$FROMbr;
print bSubject:/b
$SUBJECTbr;
print
bMessage:/bp$MESSAGE;
}
break;
case Preview:
print TABLE BORDER=1 CELLSPACING=0
WIDTH=100% TRTD VALIGN=TOP$MESSAGE/TD;
print TD VALIGN=TOPFORM
ACTION=mail.php  METHOD=POST NAME=FORM1 ;
print BSUBJECT: /BInput
TYPE=TEXT NAME=SUBJECT VALUE='$SUBJECT' BR;
print TEXTAREA NAME=MESSAGE
STYLE='width:500;height:300' WRAP=off 
$MESSAGE/TEXTAREABR;
print INPUT TYPE=SUBMIT
VALUE=Preview NAME=SEND  INPUT TYPE=BUTTON
ONCLICK='document.FORM1.MESSAGE.value=$
print /FORM/TD/TR/TABLE;
break;
default:
print FORM ACTION=mail.php 
METHOD=POST NAME=FORM1 ;
print BSUBJECT: /BInput
TYPE=TEXT NAME=SUBJECT VALUE='' BR;
print Please type in html code
below.BR;
print TEXTAREA NAME=MESSAGE
STYLE='width:500;height:300' WRAP=off 
/TEXTAREABR;
print INPUT TYPE=SUBMIT
VALUE=Preview NAME=SEND  INPUT TYPE=BUTTON
ONCLICK='document.FORM1.MESSAGE.value=$
print /FORM;
}

?


http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] PHP mail() question?

2003-03-31 Thread JeRRy
Hi,

I am trying to get PHP mail() to do the following:

1) Grab email addresses from a database and put in the
BCC of the email. (hidding their email address)

2) Grab first names from a database and put in the
body of the email.

Below is a script I am using, does not do any queries
to any database because I am not sure how to do it in
the function.  I have tried but have failed so thought
I'd ask here.  Can anyone help?  Here is the code I am
using...  

?php

$myname = Me Myself; 
$myemail = [EMAIL PROTECTED]; 

$contactname = Mister Contact; 
$contactemail = [EMAIL PROTECTED]; 

$message = hello from .$contactname.; 
$subject = A email; 

$headers .= MIME-Version: 1.0\r\n; 
$headers .= Content-type: text/html;
charset=iso-8859-1\r\n; 
$headers .= From: .$myname. .$myemail.\r\n; 
$headers .= To: .$contactname.
.$contactemail.\r\n; 
$headers .= Reply-To: .$myname.
$myreplyemail\r\n; 
$headers .= X-Priority: 1\r\n; 
$headers .= X-MSMail-Priority: High\r\n; 
$headers .= X-Mailer: Just My Server; 

mail($contactemail, $subject, $message, $headers); 

?

Maybe I need a different function? If so could someone
show me a example of how it can be achieved please? 

Thanks!

Jerry

P.S. I am using mysql database.

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] How to restrict maximum persistent connections for Oracle?

2003-03-30 Thread Jerry Tseng
Hi everybody,

In php.ini, I can set the maximum persistent connections for MySql or ODBC.
But I use Oracle 9i in my project. Who can tell me how to restrict maximum
persistent
connection for Oracle?

Thanks.

--Jerry



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



[PHP-DB] php mail() question?

2003-03-27 Thread JeRRy
Hi,

I am using a 'basic' PHP mail() function that works
fine when inputting data and information for it to
send.  But now I want to do the following:

1) Fetch email addresses from a mysql database and put
them as Bcc: so emails are always hidden.  Or some
other method? (would be ideal to have the recievers
email as the to: when they read it but only theirs.)

2) Grab their first name from the mysql database and
put that as the first line in the body.  (e.g. Dear
bob,)

Could someone give me a example on how this would
work?  Does not need to be complex just needs to show
me the functions and where what goes.  I have tried a
few techniques but have failed so thought I'd post
here.

Thanks in advance!

Jerry


http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] multiple queries in PHP to mysql database.

2003-03-27 Thread JeRRy

Hi,

I just noticed a problem with my question which would
cause major problems in my db.  So let me re-ask it
again.

How can I update 2 tables at once if a match occours
from information inputed into a PHP form.

Now this is what each table has.

table1:
id
username
game1
game2
game3
game4
game5
game6
game7
game8
score

table2:
id
username
password
sid
score

I have this:

$sql = UPDATE table1 SET score=score+1 WHERE
$select='$winner';
   
mysql_query($sql);
echo(Points credited?  I hope!brbr);
}
else {echo(An error occoured, please click back
button and try again.);}

Now that works fine and updates correctly.

But now I want a second table to be updated.  So if
username blah got +1 I need table2 to update it's
score for blah to +1.  The query above updates if it
finda a match in table1 and does not require the use
of a username to update.  But for table2 I am guessing
it WILL need to know the username or id to update the
appropiate field and not update everyones score to +1.
 So how is this achieved? Or am I doing this a hard
way?

Jerry



http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] re: multiple queries in PHP ????

2003-03-26 Thread JeRRy
Hi,

This is what I have so far.

?
if ($REQUEST_METHOD == POST) {
$usr = usr; 
$pwd = pwd; 
$db = db; 
$host = localhost; 

$cid = mysql_connect($host,$usr,$pwd);
mysql_select_db($db);


// NOTE that form fields automatically
become variables


$sql = UPDATE round1 SET score=score+1 WHERE
$select='$winner';
   
mysql_query($sql);
echo(Points credited?  I hope!brbr);
}
else {echo(An error occoured, please click back
button and try again.);}
?

Now is this right?

?
if ($REQUEST_METHOD == POST) {
$usr = usr; 
$pwd = pwd; 
$db = db; 
$host = localhost; 

$cid = mysql_connect($host,$usr,$pwd);
mysql_select_db($db);


// NOTE that form fields automatically
become variables


$sql = UPDATE round1 SET score=score+1 WHERE
$select='$winner';

 if (match) {
$sql = UPDATE round1 SET score=score+1 WHERE
$select='$winner':
$sql = UPDATE profile SET   update_table2;
 }

   
mysql_query($sql);
echo(Points credited?  I hope!brbr);
}
else {echo(An error occoured, please click back
button and try again.);}
?


http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] re: multiple queries in PHP ????

2003-03-26 Thread JeRRy

Hi,

I just noticed a problem with my question which would
cause major problems in my db.  So let me re-ask it
again.

How can I update 2 tables at once if a match occours
from information inputed into a PHP form.

Now this is what each table has.

table1:
id
username
game1
game2
game3
game4
game5
game6
game7
game8
score

table2:
id
username
password
sid
score

I have this:

$sql = UPDATE table1 SET score=score+1 WHERE
$select='$winner';
   
mysql_query($sql);
echo(Points credited?  I hope!brbr);
}
else {echo(An error occoured, please click back
button and try again.);}

Now that works fine and updates correctly.

But now I want a second table to be updated.  So if
username blah got +1 I need table2 to update it's
score for blah to +1.  The query above updates if it
finda a match in table1 and does not require the use
of a username to update.  But for table2 I am guessing
it WILL need to know the username or id to update the
appropiate field and not update everyones score to +1.
 So how is this achieved? Or am I doing this a hard
way?

Jerry



http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] re: multiple queries in PHP ????

2003-03-26 Thread JeRRy
ignore this, I no longer require assistance on the
message below.


 ATTACHMENT part 6 message/rfc822 
 Date: Wed, 26 Mar 2003 19:41:32 +1100 (EST)
 From: JeRRy [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: re: multiple queries in PHP 
 
 Hi,
 
 This is what I have so far.
 
 ?
 if ($REQUEST_METHOD == POST) {
 $usr = usr; 
 $pwd = pwd; 
 $db = db; 
 $host = localhost; 
 
 $cid = mysql_connect($host,$usr,$pwd);
 mysql_select_db($db);
 
 
 // NOTE that form fields automatically
 become variables
 
 
 $sql = UPDATE round1 SET score=score+1 WHERE
 $select='$winner';

 mysql_query($sql);
 echo(Points credited?  I
 hope!brbr);
 }
 else {echo(An error occoured, please click back
 button and try again.);}
 ?
 
 Now is this right?
 
 ?
 if ($REQUEST_METHOD == POST) {
 $usr = usr; 
 $pwd = pwd; 
 $db = db; 
 $host = localhost; 
 
 $cid = mysql_connect($host,$usr,$pwd);
 mysql_select_db($db);
 
 
 // NOTE that form fields automatically
 become variables
 
 
 $sql = UPDATE round1 SET score=score+1 WHERE
 $select='$winner';
 
  if (match) {
 $sql = UPDATE round1 SET score=score+1 WHERE
 $select='$winner':
 $sql = UPDATE profile SET   update_table2;
  }
 

 mysql_query($sql);
 echo(Points credited?  I
 hope!brbr);
 }
 else {echo(An error occoured, please click back
 button and try again.);}
 ?
 
 
 http://mobile.yahoo.com.au - Yahoo! Mobile
 - Check  compose your email via SMS on your Telstra
 or Vodafone mobile.
  

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] re: multiple queries in PHP ????

2003-03-26 Thread JeRRy
ignore this, I no longer require assistance on the
message below.


 ATTACHMENT part 6 message/rfc822 
 Date: Wed, 26 Mar 2003 19:41:32 +1100 (EST)
 From: JeRRy [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: re: multiple queries in PHP 
 
 Hi,
 
 This is what I have so far.
 
 ?
 if ($REQUEST_METHOD == POST) {
 $usr = usr; 
 $pwd = pwd; 
 $db = db; 
 $host = localhost; 
 
 $cid = mysql_connect($host,$usr,$pwd);
 mysql_select_db($db);
 
 
 // NOTE that form fields automatically
 become variables
 
 
 $sql = UPDATE round1 SET score=score+1 WHERE
 $select='$winner';

 mysql_query($sql);
 echo(Points credited?  I
 hope!brbr);
 }
 else {echo(An error occoured, please click back
 button and try again.);}
 ?
 
 Now is this right?
 
 ?
 if ($REQUEST_METHOD == POST) {
 $usr = usr; 
 $pwd = pwd; 
 $db = db; 
 $host = localhost; 
 
 $cid = mysql_connect($host,$usr,$pwd);
 mysql_select_db($db);
 
 
 // NOTE that form fields automatically
 become variables
 
 
 $sql = UPDATE round1 SET score=score+1 WHERE
 $select='$winner';
 
  if (match) {
 $sql = UPDATE round1 SET score=score+1 WHERE
 $select='$winner':
 $sql = UPDATE profile SET   update_table2;
  }
 

 mysql_query($sql);
 echo(Points credited?  I
 hope!brbr);
 }
 else {echo(An error occoured, please click back
 button and try again.);}
 ?
 
 
 http://mobile.yahoo.com.au - Yahoo! Mobile
 - Check  compose your email via SMS on your Telstra
 or Vodafone mobile.
  

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] re: multiple queries in PHP ????

2003-03-26 Thread JeRRy
ignore this, I no longer require assistance on the
message below.

l
 ATTACHMENT part 6 message/rfc822 
 Date: Wed, 26 Mar 2003 19:41:32 +1100 (EST)
 From: JeRRy [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: re: multiple queries in PHP 
 
 Hi,
 
 This is what I have so far.
 
 ?
 if ($REQUEST_METHOD == POST) {
 $usr = usr; 
 $pwd = pwd; 
 $db = db; 
 $host = localhost; 
 
 $cid = mysql_connect($host,$usr,$pwd);
 mysql_select_db($db);
 
 
 // NOTE that form fields automatically
 become variables
 
 
 $sql = UPDATE round1 SET score=score+1 WHERE
 $select='$winner';

 mysql_query($sql);
 echo(Points credited?  I
 hope!brbr);
 }
 else {echo(An error occoured, please click back
 button and try again.);}
 ?
 
 Now is this right?
 
 ?
 if ($REQUEST_METHOD == POST) {
 $usr = usr; 
 $pwd = pwd; 
 $db = db; 
 $host = localhost; 
 
 $cid = mysql_connect($host,$usr,$pwd);
 mysql_select_db($db);
 
 
 // NOTE that form fields automatically
 become variables
 
 
 $sql = UPDATE round1 SET score=score+1 WHERE
 $select='$winner';
 
  if (match) {
 $sql = UPDATE round1 SET score=score+1 WHERE
 $select='$winner':
 $sql = UPDATE profile SET   update_table2;
  }
 

 mysql_query($sql);
 echo(Points credited?  I
 hope!brbr);
 }
 else {echo(An error occoured, please click back
 button and try again.);}
 ?
 
 
 http://mobile.yahoo.com.au - Yahoo! Mobile
 - Check  compose your email via SMS on your Telstra
 or Vodafone mobile.
  

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] multiple queries in PHP ????

2003-03-24 Thread JeRRy
Hi,

I have a query to update a database via PHP after a
form is inputed.  The form results do a match to the
database and if a match occours updates a field with
+1 and if no matches it does nothing.  

Now I want it so if +1 is done I want another table to
update as +1 also.  How would I achieve this in PHP? 
I'd prefer to keep it all on one page to make it alot
easier to manage.  SO if +1 in table1 than update
table2 with +1 also.  If no matches than do nothing to
both.

Could someone please help me with this, is it a 'if'
statement or something?  Help is appreciated and
thanks in advance.

I alsready have the script to update table1 and does
this fine but am not sure how to do mulitple queries
in the one PHP page.

Jerry

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] some php and database questions!

2003-03-11 Thread JeRRy
Hi,

I am currently running a tipping competition where
people tip the team they think will win the given game
or pick the draw.  Each correct entry gets +1 point,
each incorrect entry gets 0 points.  There is 8 games
a round and people submit their entries via a PHP page
that updates a mysql database.  Now for the admin side
of things, to make it easier for admins to update
records accordingly without needing to manually add
them up one by one.

I want a system I can go into where I select the
winners of each round.  If a tipster has any matches
it will credit their accounts +1 for each correct
entry and 0 for each incorrect entry.  There is 8
games a round (on a weekend)  .. So how would I get
the entries to update to the correct amount when I
select the winners.

I'd need the admin page to be something like this.

Game1 : team 1
team 2
draw

Game2 : team 3
team 4
draw

and so on, Probably a drop down menu to select the
winner or draw.  So what query would I need or PHP
code to update the database with +1 for correct
matches and 0 for incorrect?  Or would I be better to
have 1 page per game?  I need a safe and reliable way
of doing it.

Also I am going to have a tipster tally.  They will be
in order of total score.  So order will change from
week to week, how can I auto-sort a list using PHP to
display on a page without it messing up the score with
someone else.  So I need the top score to go to the
top but take the name also and not just the score, any
ideas?

For instance:

Week 1

bob 7
judy 6 
Amanda 5


Week 2

Judy 10
Amanda 9
bob 8

From week 1 to 2 bob needs to drop down the bottom,
Judy needs to move up one and Amanda is to also move
up one.  I need it to be automatic instead of me
having to do it manually.  Any ideas?  (I think this
was discussed about a month ago, if so I appologise
for the repeat but the help is very appreciated.)

Lastly the games in the week are different from
others.  There is normally a Friday night games, a few
Saturday games and Saturday Night and a few Sunday
games.  I really don't want to lock people out if they
don't submit a tip before the first game.  But I do
want to lock out any tips made for a game that has
already started.  

For instance:

It's 8:05 PM and there was a game to start at 7PM I
want to lock out the tips for the first game but allow
tips for the remaining games.  How can I lock people
out?  Sure I could remove the option on the page but
that does not stop people from loading the page just
before the start of the game and sitting on it till
the game has finished and than submitting their tips. 
I need another way, dynamic pages?  Or something else?
 If the easiest option is to lock people right out
after the first game has started I will, but I'd
prefer to not do that.

Feel free to use any database structure you like, any
table names are ok.  As long as you define what you
mean so I can understand what you mean and I can try
for myself.

Thanks so much in advance, credit will be given.

Jerry

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] PHP to mysql to email

2003-03-09 Thread JeRRy
Hi,

I have a PHP page that writes to a mysql database. 
Now I have got that bit to work well.  Now I want to
send out an email once a person submits the details. 
So on the database I grab fields like name, gender,
email etc...  Now I want to grab the email and send
out an email something like below once they submit
their details.

Dear name,

Thankyou for signing up, please visit...

Thanks!

Now name is fetched from the name they give on the
form.  So how would I send an email out automatically
once they submit it?

Also, but not really required yet but ideas
appreciated, if the email BOUNCES is their a way to
remove the entry that the email bounced email matches?
 I'd say this would be more complicated but any
suggestions are welcome on this.  I could always
manually remove them for the time being.

Jerry

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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



[PHP-DB] Column Sort Question

2003-03-05 Thread Jerry
Hi All,

This is a newbie question. I am using PHP Version 4.2.3 with
register_globals=off. I am trying to creating a simple address book with
mysql as the backend. I have a  form that passes what the user wants to
query from the address book and it returns everything in a table with column
heading just fine. I use $myvar1=$_POST['myvar1']; to pass the info from the
form to the php file.

I am using the following in the header fields of the table:
th nowrap a href=?php echo $PHP_SELF?order_by=FIRSTNAME; ?First
Name/a /th

This doesn't work (I get a bunch of errors) and I think it's because the
variable from $_POST are not staying persistent. I tried playing around with
session with no luck.

What is the best way to resort on a column?

Thanks,

Jerry



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



[PHP-DB] Re: php-db Digest 5 Feb 2003 17:13:51 -0000 Issue 1661

2003-02-05 Thread JeRRy
Hi,

I would like to know how to get error messages to
appear if something goes wrong.  Like if the mysql
finds the database account but fails to update the
table, finds the table but a unique entry is inputted
so can't add.  I'd like to be able, if possible, to
customize the error message.  Could someone please
show me how to achieve this?

At pressent it only produces an error if the database
is not found.  Nothing else!

Jerry

http://movies.yahoo.com.au - Yahoo! Movies
- What's on at your local cinema?

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




[PHP-DB] INSERT IMG in Database

2002-03-14 Thread Jerry

Hi,

I have a windows 2000 Database Server with IBM DB2 V7.2 FP5
I have a linux web server with Apache/PHP

I installed IBM DB2 IMAGE Extender and enable my database for it.

Now I'm uploading a file to the server and I want to copy this file in the
database.

I'm using the following script:

  $userfile=str_replace(,\\,$userfile);
  $TableName=imgdb;
  $FieldName1=imgname;$FieldValue1='.session_id().';
  $FieldName2=imgval;$FieldValue2='.$userfile.';
  $insOS=Insert Into $TableName ($FieldName1,$FieldName2)
values($FieldValue1,MMDBSYS.DB2IMAGE('MyDatabase',$FieldValue2,'ASIS',1,'Thi
s my image'));;
 $resultOSins=odbc_exec($conn,$insOS);

$userfile is the file uploaded by the user using an INPUT type=FILE

I received the following error:

Warning: SQL error: [IBM][CLI Driver][DB2/NT] SQL0443N Routine
MMDBSYS.DB2IMAGE (specific name DB2IMAGEIMPORTF1) has returned an error
SQLSTATE with diagnostic text Can't resolve import file. . SQLSTATE=38686
, SQL state 38686 in SQLExecDirect in /svr/myfile.php

But if I have $userfile=C:\myimage.jpg;
it will work (of course if the file is present on the C drive...)

My question is How can I insert an image in the database without using its
file name ?
Can I directly send the image object to the database ?

Thanks

Jerry



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




Re: [PHP-DB] Hosting - what's needed to handle 650K queries?

2002-03-09 Thread Jerry Bell

Based on my experience, I see about 90% of hits during the week (as you
said).  80% of the daily hits occur during a 10 hour period during the day.
At 600k pages/month, that's about 13 pages per second average, during the
day.  Since hits aren't evenly distrubuted, you can plan on about 2 to 3
times the 'average', which is 24 or 36 pages per second.  Adjust the
percentages and timeframes to your situation for best results :)

You really need to take your application and run a benchmark test to see if
you can get that many pages per second you get on that hardware and decide
how acceptible it is for visitors to wait or be rejected.  Depending on how
intesive your scripts and how many/what kind of db queries, there can be a
considerable variation in what a given bit of hardware can support.

Hope that helps!

Jerry
http://www.syslog.org

- Original Message -
From: olinux [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 09, 2002 8:47 PM
Subject: [PHP-DB] Hosting - what's needed to handle 650K queries?


 I am working with a news site that currently uses
 static pages.

 I'm looking into the option of building a db driven
 system and new host option as we are up to about 10K
 articles. What do I need in a server to handle this
 amount of traffic. Site is currently getting about
 600,000 page views and growing quite rapidly. The
 server I am looking at is athlon 1gig 512MB Win2K
 (portions of the site are ASP scripted). Will this
 server handle the traffic of approx 650,000 queries
 monthly. (Traffic is heaviest M-F)

 I would like to develop the content management system
 in PHP. MySQL has more than enough functionality to
 insert and pull data for what we're doing. We also
 have a MSSQL database. Which would be a better
 solution. I am guessing that MySQL would be as 99% of
 queries would be simple select statements and MySQL
 handles this well.

 Thanks much,
 olinux

 PS: Hosting providers - feel free to send me
 (dedicated) hosting offers off-list


 __
 Do You Yahoo!?
 Try FREE Yahoo! Mail - the world's greatest free email!
 http://mail.yahoo.com/

 --
 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] Hosting - what's needed to handle 650K queries?

2002-03-09 Thread Jerry Bell

Based on my experience, I see about 90% of hits during the week (as you
said).  80% of the daily hits occur during a 10 hour period during the day.
At 600k pages/month, that's about 13 pages per second average, during the
day.  Since hits aren't evenly distrubuted, you can plan on about 2 to 3
times the 'average', which is 24 or 36 pages per second.  Adjust the
percentages and timeframes to your situation for best results :)

You really need to take your application and run a benchmark test to see if
you can get that many pages per second you get on that hardware and decide
how acceptible it is for visitors to wait or be rejected.  Depending on how
intesive your scripts and how many/what kind of db queries, there can be a
considerable variation in what a given bit of hardware can support.

Hope that helps!

Jerry
http://www.syslog.org

- Original Message -
From: olinux [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 09, 2002 8:47 PM
Subject: [PHP-DB] Hosting - what's needed to handle 650K queries?


 I am working with a news site that currently uses
 static pages.

 I'm looking into the option of building a db driven
 system and new host option as we are up to about 10K
 articles. What do I need in a server to handle this
 amount of traffic. Site is currently getting about
 600,000 page views and growing quite rapidly. The
 server I am looking at is athlon 1gig 512MB Win2K
 (portions of the site are ASP scripted). Will this
 server handle the traffic of approx 650,000 queries
 monthly. (Traffic is heaviest M-F)

 I would like to develop the content management system
 in PHP. MySQL has more than enough functionality to
 insert and pull data for what we're doing. We also
 have a MSSQL database. Which would be a better
 solution. I am guessing that MySQL would be as 99% of
 queries would be simple select statements and MySQL
 handles this well.

 Thanks much,
 olinux

 PS: Hosting providers - feel free to send me
 (dedicated) hosting offers off-list


 __
 Do You Yahoo!?
 Try FREE Yahoo! Mail - the world's greatest free email!
 http://mail.yahoo.com/

 --
 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 - DB2 / odbc_connect() failed

2002-03-07 Thread Jerry

Hello All,

I have IBM DB2 v7.2 FP5 on a Windows 2000 Server
A Linux Web server running with Apache/PHP4 And IBM DB2 V7.2 Client Install
on it.

When I try to use odbc_connect($dbname, $user,$password);
I received the message:

Warning: SQL error: , SQL state ¿Ë ?=z@éÿ¿ÛË ?=z@?=z in SQLConnect in
/svr/jerry/web/myphppage.php

But on the Linux server from the command line I don't have any problem to
connect to the database...

Do you have any idea what is the problem and how to solve it ?

Thanks.

Jerry



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




Re: [PHP-DB] Database Connection

2002-02-05 Thread Jerry

Thanks Andrew for your answer.

In the environment variables I have already:

DB2INSTANCE=db2inst1
LD_LIBRARY_PATH=:/home/db2inst1/sqllib/lib

Is it correct ? Or does it need to point to the DB2 Client directory
/usr/IBMdb2/V7.1/lib


Thanks.

Jerry


Andrew Hill [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jerry,

 Installing DB2 Client will allow you to use the ODBC functions in PHP, but
 be aware that you are not actually using any ODBC Drivers in this
instance.
 PHP allows hiding of certain database specific functions under a Unified
 ODBC that uses the ODBC functions without using true ODBC database
communication.

 That being said, you don't need to link --with-iODBC unless you are using
 ODBC Drivers, so it's not an issue here.

 If Apache doesn't start, I'd check it's logs, but you might be
encountering
 a situation where the DB2 libraries were in the path at compile time and
are
 not at Apache start time.  Try setting LD_LIBRARY_PATH environment
variable
 to include the location of your DB2 Client.

 Andrew Hill

































.



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




[PHP-DB] Help needed on point system

2002-02-01 Thread Jerry Leonard

Hi all,

I am relatively new to php and mysql and would appreciate any help you can
provide. Here is the task:

I need to have a point system added to my site. What I would like is when a
user logs in they will get 1000 points. But they only get it once per day.

I am running:
Xitami on WinME, PHP 4.06 and Mysql 3.23.43 win binary.

If anyone is willing to help I will provide a database dump and any part or
the script you will need. I would give the info now except I don't know what
parts
will be needed.

Thanks for any help
Regards
Jerry



-- 
PHP Database 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-DB] Connect to DB2-win2k through PHP4-Linux

2002-01-30 Thread Jerry

Hi,

I have a windows 2000 Database Server with IBM DB2 V7.2 on it.
I have a Web Server with Linux-Apache-PHP 4 on it (but not XWindow or any
graphical interface...).

On the web server, I want to run a PHP page to connect to the IBM DB2
Database on the win2k server.

1. Do I need to install DB2 Client / DB2 Administration Client / DB2
Development Client on the Linux server ? I currently only installed DB2
Client.

2. After compiling PHP with option --with-ibm-db2=/usr/IBMdb2/V7.1 (I know
it's V7.2, but my colleague who did the install believed it was 7.1), can
use the PHP command odbc_connect ? When I tried I received the error: Fatal
error: Call to undefined function: odbc_connect()...

3. I didn't have any directory sqllib (like on windows platform) after IBM
DB2 Client installation, is it normal ?

3. Do I need to install another software like iODBC ?


Thanks.

Jerry



-- 
PHP Database 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-DB] mySQL administration on Linux through NT

2002-01-16 Thread Jerry

Hi,

I have mySQL on LINUX
Does anybody knows a windows software to manage mySQL through win2k
(TCP/IP - Intranet) ?

With mySQL on win2k, you can manage it using a windows interface. I'm
looking for the same kind of interface to manage mySQL on a Linux platform
from win2k.

Thanks.


Jerry




-- 
PHP Database 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-DB] Re: WebMail

2002-01-15 Thread Jerry

On which platform ?

For the webmail program, see:

http://www.upenn.edu/computing/group/webmail/2000/
http://www.devshed.com/Server_Side/PHP/PHPMail (email client)

Or try:
http://sdb.suse.de/en/sdb/html/katlist.SUSEIMAP.html
http://hyper-cgi.com/grn/webware.html
http://www.hotscripts.com/Perl/Scripts_and_Programs/Email_Systems/Web-based_
Email/index.html



There are so many out there... ;-)


Jerry



Michael K. Dolan Jr. [EMAIL PROTECTED] wrote:
Hi, I'm looking for a good web based email client (preferably easy to setup
and done in PHP of course). We have a sendmail server that works great. I'm
not sure how the webmail systems work though. Can I use a different Apache
server or do I have to setup the PHP webmail on the actual mail server?

I guess I have 2 questions, what's a good webmail program, and 2nd what's
the basic setup of this all?

Mike Dolan




-- 
PHP Database 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-DB] How do I know when to

2002-01-11 Thread Jerry Leonard

Hi,

I am really new to MySQL and am wondering this:

I understand how to make a database and tables but what I don't understand
is when to make a row an int with auto_increment or just a plain int.
Or why would you use varchar(50) instead of char(50).

Could someone please explain what is happening and why?

Thank you
Jerry



-- 
PHP Database 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-DB] How do I know when to

2002-01-11 Thread Jerry Leonard

Okay this is the way I understand the statement below. The uid will be a
number from 1 to 10, max length of ten digits say starting at 1 then as the
next user registers it will automatically make that user number 2.

Am I correct?

CREATE TABLE users (
  uid int(10) unsigned NOT NULL auto_increment,





-- 
PHP Database 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-DB] Re: MSSQL DB Connect

2002-01-02 Thread Jerry

Thanks Jeremy, I finally found the solution:

?php
$query=SELECT * FROM DB1 JOIN DB2 ON DB1.dataid=DB2.dataid;
$queryupd=UPDATE DB1 SET dateval='20010101' where dateval='2101';
$hostname = serverdb;
$username = user;
$password = pwd;
$dbName = DB;
mssql_connect($hostname,$username,$password) or die(DATABASE FAILED TO
RESPOND.);
mssql_select_db($dbName) or DIE(Table unavailable);
$result2 = MSSQL_QUERY($queryupd); // Execute Update Statment
$result = MSSQL_QUERY($query);  // Execute Select Statment
$number = MSSQL_NUM_ROWS($result);
$i=0;
 if($number == 0) print No data?;
 elseif($number  0){
 print Number of rows: $numberBR;
while($i  $number){
 $dateval= mssql_result($result,$i,dateval);
 echo TRTDFONT color=#112266$dateval/FONT/TD;
 $i++;}
}?

And it works fine !
Now I'm looking for the same function for IBM DB2 database connection...

Jerry

Jeremy Reed [EMAIL PROTECTED] wrote:
 What was the error message you received?  Also, when passing the variables
 to the mssql_connect() function, you need not use quotes since you've
 already initialized them to the strings.  Pass them as follows:
$connection
 = mssql_connect($a,$b,$c).  Also, you aren't passing the actual sql string
 to the mssql_query() function.  You have $sql = blah but you pass
 $sql_temp.

 Jerry wrote:

  Hi

  I have PHP on windows 2000 web server
  I would like to remote to a MS SQL database on another web server.
  I tried something like:

  ?php
  $h = server adr;
  $u = user;
  $p = passw;
  $b = db;
  $connexion = mssql_connect($h, $u, $p);
  mssql_select_db($b);
  $sql_temp= select * from test;
  $result = mssql_query($sql_temp);
  mssql_close($connexion);
  ?

  But it didn't work. Please help me.

  Jerry








-- 
PHP Database 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-DB] Re: Urgent! Store Data In A Text File!

2002-01-02 Thread Jerry

To retrieve data from a text file, I'm using:

$fp= file(textfile.txt,r); foreach($fp as $line) echo - $line -;

Jerry

Arik Ashepa [EMAIL PROTECTED] wrote:
 Can someone please tell me how can I add and retrive data from a text file
I
 know it has something to do with Spliting...???
 But I dont know the code...


 Arik











-- 
PHP Database 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-DB] Connect to IBM DB2

2002-01-02 Thread Jerry

To connect to Microsoft SQL 7 I'm using the following script which works
fine:

?php
$query=SELECT * FROM DB1;
$queryupd=UPDATE DB1 SET dateval='20010101' where dateval='2101';
$hostname = dbserver;
$username = username;
$password = pwd;
$dbName = DB;
mssql_connect($hostname,$username,$password) or die(DATABASE FAILED TO
RESPOND.);
mssql_select_db($dbName) or DIE(Table unavailable);
$result2 = MSSQL_QUERY($queryupd); // Execute Update Statment
$result = MSSQL_QUERY($query);  // Execute Select Statment
$number = MSSQL_NUM_ROWS($result);
$i=0;
 if($number == 0) print No data?;
 elseif($number  0){
 print Number of rows: $numberBR;
while($i  $number){
 $dateval = mssql_result($result,$i,dateval);
echo TRTDFONT color=#112266$dateval/FONT/TD;
 $i++;}
}
?

Now, how to connect to a DB2 database server without ODBC ?

My config is:
Web Server: IIS on windows 2000 Server
Database Server: IBM DB2 V7.1 on windows 2000 Server
PHP4 for windows

Thanks.

Jerry



-- 
PHP Database 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-DB] MSSQL connect

2001-12-21 Thread Jerry

Hi

I have PHP on windows 2000 web server
I would like to remote to a MS SQL database on another web server.
I tried something like:

?pup
$h = server adr;
$u = user;
$p = passw;
$b = db;
$connexion = mssql_connect($h, $u, $p);
mssql_select_db($b);
$sql = select * from test;
$result = mssql_query($sql_temp);
mssql_close($connexion);
?

But it didn't work. Please help me.

Jerry



-- 
PHP Database 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-DB] MSSQL DB Connect

2001-12-21 Thread Jerry

Hi

I have PHP on windows 2000 web server
I would like to remote to a MS SQL database on another web server.
I tried something like:

?php
$h = server adr;
$u = user;
$p = passw;
$b = db;
$connexion = mssql_connect($h, $u, $p);
mssql_select_db($b);
$sql = select * from test;
$result = mssql_query($sql_temp);
mssql_close($connexion);
?

But it didn't work. Please help me.

Jerry



-- 
PHP Database 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]




Re: [PHP-DB] Cookies on a Macintosh

2001-01-19 Thread Jerry

In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] ("Noodles Grizzly") wrote:
 I'm using the setcookie function with the follwing.
 
 setcookie("randint", "$ran3", time()+9000);
 
 It sets the cookie, but refuses to use the variable contained within. 
  I can't find any reference to it in the books I have, nor in the 
 online manual.
 
 Anyone know why this might be happening?

What does "$ran3" contain, and why is it enclosed in quotes? (It 
shouldn't matter, but I'm interested.)

Also, how do you know it sets the cookie if it refuses to use the 
variable? How does it refuse to use the variable in a manner that lets 
you know it set the cookie?

Jerry
-- 
http://www.hoboes.com/jerry/
"Give a man a fish and you feed him for a day. Teach him to fish, and you've
depleted the lake."--It Isn't Murder If They're Yankees
(http://www.hoboes.com/jerry/Murder/)

-- 
PHP Database 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]




<    1   2   3