Re: [PHP-DB] Stuck on basic concept, how to .. here's how

2004-03-20 Thread dogu
John,

Thanks, you just saved me a whole bunch of time!  That's too bad.  I'm 
guessing that the process of re-establishing a resource isn't too 
intensive so it's not a choke point for any application.  It's 
interesting to see how different languages attack similar problems

Have a great weekend.

Doug

John W. Holmes wrote:
You can't pass resources. You connect on each PHP page. Put _that_ in a 
function to make it easy. :)

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


[PHP-DB] Insert an image in a Mysql table

2004-03-20 Thread charalambos nicolaou
Hi,

	I have created a MySQL table with a blob field and I don’t know how to 
insert an image to it. Help me please because I am going crazy.

Thank you, in advance

_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail

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


[PHP-DB] Re: Re: Re: SQL Server Query Failed

2004-03-20 Thread david
Bob:

I shall experiment with option #3 (replacing php_mssql.dll with
php_odbtp_mssql.dll). This will take a couple of days (I want to test it all
out...sigh...testing...) and then slip it into production. I will report
back on the results.

On the Single Sign On... I am happy to talk about (and would LIKE to) but I
don't know that this is the proper newsgroup for it? I am open for
suggestions? I brought the SSO question up in comp.lang.php awhile ago, and
although there was some discussion, mostly it petered out rather quickly.

PHP for me was a requirement (part of the intranet is some PHP modules which
are used on LAMP platforms); that is why we went PHP/Apache. (.NET was never
in the picture, although in hindsight, I wish we had put up IIS/PHP.)
However, it is a stable platform, and with just two exceptions (one being
the above!) and the SSO issue that has recently surfaced, the platform has
not experienced a single glitch. Personally, I do not favor the SSO
solution, but I understand the business drive for it. Security and
convenience are often strange bedfellows, and don't always get along.
You are correct in the IIS supports SSO.
david


Robert Twitty [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi David

 Based on the amount of users accessing the site, there is a possibitity
 that php_mssql.dll not being thread safe could be the problem.  The only
 way to verify this is to use PHP as a CGI, run Apache as a multi-process
 server, or replace php_mssql.dll with php_odbtp_mssql.dll.

 As much as I like PHP and dislike Microsoft, I personally would not have
 used Apache/PHP on a Win32 platform to connect to SQL Server.  The proper
 choice should be IIS/ASP.NET.  I believe that IIS supports the single
 sign-on feature for intranet purposes.  You may have to decide which of
 the solutions I have mentioned is the most feasible.

 -- bob

 On Fri, 19 Mar 2004, david wrote:

  Thank you, Bob, for your continuing comments.
 
  The intranet site is used by approximately 100 people, and sees a good
  amount of traffic every day. I don't really have an exact number of
daily
  queries that are executed, but it has to be a pretty sizable number,
since
  the site handles much of the business issues.
 
  The query in question fails randomly (as far as I can tell: I have been
  watching for patterns for some time now.) If it always failed, that
would
  really help. Sigh. Random. Naturally. Worse, the query is 100% dynamic,
and
  built by the users (but of course they do not know they are building a
  query. They are just selecting things to report on, which is the way it
  should be, in my opinion). So, I don't have a query I can show as always
  fails, or sometimes fails.
 
  The only common thread in all of this is the tables in question. There
are
  only a couple of tables, and they are used in the datawarehouse for
  reporting. Oddly, though (and I cannot prove this as much as I would
like
  to) I think that some of the failures happen when no one else is using
that
  table. All the other intranet tables perform as expected (and there are
a
  LOT of those).
 
  I will look at the Apache 2/multi-process question. It is a great
thought.
 
  I have another problem (this one is more of a how in the world do I do
that,
  and relates to digging out the user signed onto the workstation for a
single
  sign on solution: we won't go into the is that a good idea question,
  because it is moot, and I came out on the losing end); apparently I
can't do
  this with Apache 2 and Windows, and so, long story short, perhaps I
should
  consider other web server options.
 
  Thanks, Bob!
  david
 
  Robert Twitty [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
   Hi David
  
   Do these few queries ALWAYS fail, or just occasinally fail? Is this
   intranet site used by many people?  If the same query always fails,
you
   can determine if it may be a thread-safe issue by running that query
   outside of Apache as follows:
  
   c:\php\php thequery.php
  
   If the above fails, then it is probably not due to the fact that the
mssql
   extension is not thread safe.  If it does work then it could be the
   problem.  I am not familiar with Apache 2.0, but I do believe it is a
   multi-threaded server, which is not good for extensions that are not
   thread-safe. If Apache 2.0 cannot be configured to run as a
multi-process
   server, you should consider using Apache 1.3.
  
   -- bob
  
   On Fri, 19 Mar 2004, david wrote:
  
Ahthread safe.
   
THAT is an interesting thought. Especially because I somehow suspect
  that my
problem is related to the database and/or table being locked just
when I
  am
trying to read it.
   
However, I have to profess some ignorance about FastCGI. I looked at
the
  web
site for it, but I am not sure if by installing it I am now
magically
thread-safe? Or, once installed, do I need to make some code
changes?
   
My environment is an established 

Re: [PHP-DB] Re: Re: Re: SQL Server Query Failed

2004-03-20 Thread Robert Twitty
OK, let me know if you needed any assistance. BTW, are you using
mssql_init() to call stored procedures?

-- bob

On Sat, 20 Mar 2004, david wrote:

 Bob:

 I shall experiment with option #3 (replacing php_mssql.dll with
 php_odbtp_mssql.dll). This will take a couple of days (I want to test it all
 out...sigh...testing...) and then slip it into production. I will report
 back on the results.

 On the Single Sign On... I am happy to talk about (and would LIKE to) but I
 don't know that this is the proper newsgroup for it? I am open for
 suggestions? I brought the SSO question up in comp.lang.php awhile ago, and
 although there was some discussion, mostly it petered out rather quickly.

 PHP for me was a requirement (part of the intranet is some PHP modules which
 are used on LAMP platforms); that is why we went PHP/Apache. (.NET was never
 in the picture, although in hindsight, I wish we had put up IIS/PHP.)
 However, it is a stable platform, and with just two exceptions (one being
 the above!) and the SSO issue that has recently surfaced, the platform has
 not experienced a single glitch. Personally, I do not favor the SSO
 solution, but I understand the business drive for it. Security and
 convenience are often strange bedfellows, and don't always get along.
 You are correct in the IIS supports SSO.
 david


 Robert Twitty [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hi David
 
  Based on the amount of users accessing the site, there is a possibitity
  that php_mssql.dll not being thread safe could be the problem.  The only
  way to verify this is to use PHP as a CGI, run Apache as a multi-process
  server, or replace php_mssql.dll with php_odbtp_mssql.dll.
 
  As much as I like PHP and dislike Microsoft, I personally would not have
  used Apache/PHP on a Win32 platform to connect to SQL Server.  The proper
  choice should be IIS/ASP.NET.  I believe that IIS supports the single
  sign-on feature for intranet purposes.  You may have to decide which of
  the solutions I have mentioned is the most feasible.
 
  -- bob
 
  On Fri, 19 Mar 2004, david wrote:
 
   Thank you, Bob, for your continuing comments.
  
   The intranet site is used by approximately 100 people, and sees a good
   amount of traffic every day. I don't really have an exact number of
 daily
   queries that are executed, but it has to be a pretty sizable number,
 since
   the site handles much of the business issues.
  
   The query in question fails randomly (as far as I can tell: I have been
   watching for patterns for some time now.) If it always failed, that
 would
   really help. Sigh. Random. Naturally. Worse, the query is 100% dynamic,
 and
   built by the users (but of course they do not know they are building a
   query. They are just selecting things to report on, which is the way it
   should be, in my opinion). So, I don't have a query I can show as always
   fails, or sometimes fails.
  
   The only common thread in all of this is the tables in question. There
 are
   only a couple of tables, and they are used in the datawarehouse for
   reporting. Oddly, though (and I cannot prove this as much as I would
 like
   to) I think that some of the failures happen when no one else is using
 that
   table. All the other intranet tables perform as expected (and there are
 a
   LOT of those).
  
   I will look at the Apache 2/multi-process question. It is a great
 thought.
  
   I have another problem (this one is more of a how in the world do I do
 that,
   and relates to digging out the user signed onto the workstation for a
 single
   sign on solution: we won't go into the is that a good idea question,
   because it is moot, and I came out on the losing end); apparently I
 can't do
   this with Apache 2 and Windows, and so, long story short, perhaps I
 should
   consider other web server options.
  
   Thanks, Bob!
   david
  
   Robert Twitty [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
Hi David
   
Do these few queries ALWAYS fail, or just occasinally fail? Is this
intranet site used by many people?  If the same query always fails,
 you
can determine if it may be a thread-safe issue by running that query
outside of Apache as follows:
   
c:\php\php thequery.php
   
If the above fails, then it is probably not due to the fact that the
 mssql
extension is not thread safe.  If it does work then it could be the
problem.  I am not familiar with Apache 2.0, but I do believe it is a
multi-threaded server, which is not good for extensions that are not
thread-safe. If Apache 2.0 cannot be configured to run as a
 multi-process
server, you should consider using Apache 1.3.
   
-- bob
   
On Fri, 19 Mar 2004, david wrote:
   
 Ahthread safe.

 THAT is an interesting thought. Especially because I somehow suspect
   that my
 problem is related to the database and/or table being locked just
 when I
   am
 trying to read it.

 

Re: [PHP-DB] Insert an image in a Mysql table

2004-03-20 Thread Filip de Waard
On Mar 20, 2004, at 3:11 PM, charalambos nicolaou wrote:

Hi,

	I have created a MySQL table with a blob field and I dont know how 
to insert an image to it. Help me please because I am going crazy.
Use your filesystem instead, databases might be capable of storing 
binary data but they are not perfect. Use your filesystem and store the 
filename in your database.

If you would've used google, you would've found this: 
http://www.phpbuilder.com/columns/florian19991014.php3

Regards,

Filip de Waard

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


[PHP-DB] Problem, please help!

2004-03-20 Thread JeRRy
Hi,

I have not used this site in a while and have a
problem.  I can't get anything to save to the
database. :(  Not sure what is wrong, need a fix fast
as the site needs to be active in a few days by the
latest so hopefully I can get help in that time.  The
code is a bit messy I know but here goes:


tip.php


?php

include('cookie.php');
?


?php
mysql_connect (localhost);
mysql_select_db (tipping);

$qr = mysql_query(SELECT *
FROM `fixture1` LIMIT 0 , 30 ) or exit(Home  Away 
season completed!);

 $row = mysql_fetch_array($qr);
  echo   .$row['roundname']. brbr;
  echo Form Action='tip1.php' METHOD='POST'
enctype='multipart/form-data';
  echo input name='game1' type='radio'
value='.$row['team1'].' .$row['team1']. v 
.$row['team2']. ;
  echo input name='game1' type='radio'
value='.$row['team2'].'br;
  echo input name='game2' type='radio'
value='.$row['team3'].' .$row['team3']. v 
.$row['team4']. ;
  echo input name='game2' type='radio'
value='.$row['team4'].'br;
  echo input name='game3' type='radio'
value='.$row['team5'].' .$row['team5']. v 
.$row['team6']. ;
  echo input name='game3' type='radio'
value='.$row['team6'].'br;
  echo input name='game4' type='radio'
value='.$row['team7'].' .$row['team7']. v 
.$row['team8']. ;
  echo input name='game4' type='radio'
value='.$row['team8'].'br;
  echo input name='game5' type='radio'
value='.$row['team9'].' .$row['team9']. v 
.$row['team10']. ;
  echo input name='game5' type='radio'
value='.$row['team10'].'br;
  echo input name='game6' type='radio'
value='.$row['team11'].' .$row['team11']. v 
.$row['team12']. ;
  echo input name='game6' type='radio'
value='.$row['team12'].'br;
  echo input name='game7' type='radio'
value='.$row['team13'].' .$row['team13']. v 
.$row['team14']. ;
  echo input name='game7' type='radio'
value='.$row['team14'].'br;
  echo input name='game8' type='radio'
value='.$row['team15'].' .$row['team15']. v 
.$row['team16']. ;
  echo input name='game8' type='radio'
value='.$row['team16'].'br;

  echo input name='submit' type='submit'
value='submit'/formbrbr;

  ?

The above page loads the right values from the
database and a form is in the page that saves to the
next page and meant to update the database.  Out come
below:


tip1.php


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

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


// NOTE that form fields automatically
become variables

$sql = UPDATE round1 SET game1='$game1' ,
game2='$game2' , game3='$game3' , game4='$game4'
, game5='$game5' , game6='$game6' , game7='$game7' ,
game8='$game8' , misc='y'
WHERE username= \$sidarray[0]\;


mysql_query($sql);
echo(Your tips have been
saved!brbrb$game1br$game2br$game3br$game4br$game5br$game6br$game7br$game8br);
}
else {echo(An error occoured, please click back
button and try again.);}
?


Okay it output on the php page fine but won't save to
db, anyone know why?

Thanks!

J

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

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



Re: [PHP-DB] Re: Re: Re: SQL Server Query Failed

2004-03-20 Thread JeRRy
Might be an idea to delete the response deeper then
the recently replied.  As all this is archieved there
is no use re-posting it.  Sure keep the latest reply
but keeping anything more makes these emails quite
legnthy.  Just a suggestion for you all.

Cheers!

J

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

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



Re: [PHP-DB] Problem, please help!

2004-03-20 Thread Filip de Waard
On Mar 21, 2004, at 3:44 AM, JeRRy wrote:
Hi,

I have not used this site in a while and have a
problem.  I can't get anything to save to the
database. :(  Not sure what is wrong, need a fix fast
as the site needs to be active in a few days by the
latest so hopefully I can get help in that time.  The
code is a bit messy I know but here goes:
snip

$sql = UPDATE round1 SET game1='$game1' ,
game2='$game2' , game3='$game3' , game4='$game4'
, game5='$game5' , game6='$game6' , game7='$game7' ,
game8='$game8' , misc='y'
WHERE username= \$sidarray[0]\;


This only updates an existing record, where the username is equal to 
$sidarray[0]. Don't expect it to insert new data.

Okay it output on the php page fine but won't save to
db, anyone know why?
Secondly, please put a little effort in writing quality code and markup 
before you post it here. br is really ugly...

Regards,

Filip de Waard

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


Re: [PHP-DB] Problem, please help!

2004-03-20 Thread JeRRy
  snip
 
  $sql = UPDATE round1 SET game1='$game1' ,
  game2='$game2' , game3='$game3' , game4='$game4'
  , game5='$game5' , game6='$game6' , game7='$game7'
 ,
  game8='$game8' , misc='y'
  WHERE username= \$sidarray[0]\;
 
 
 This only updates an existing record, where the
 username is equal to 
 $sidarray[0]. Don't expect it to insert new data.

Yes tried both, insert and update.  Both fails. 
Including a 'or die' statement in the mysql connection
but does not return it can't connect.  So it must be
connecting just not posting. :(  Any other problems
that could cause this?

 
  Okay it output on the php page fine but won't save
 to
  db, anyone know why?
 
 Secondly, please put a little effort in writing
 quality code and markup 
 before you post it here. br is really ugly...

I stated in my first post the code was messy ... Think
messy and ugly match in some way.  It's just a quick
job that worked fine last year but does not wanna work
now. :(  I must of changed something before I ended my
work last year on it to make it not work.  I'll keep
trying some stuff.  Think it might have something to
do with my cookie.php file as I require sidarray[0]
which is fed from that.

J

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

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



Re: [PHP-DB] Problem, please help!

2004-03-20 Thread php
it looks like the use of double and single quotes could be at fault

try writing it like
$sql = UPDATE round1
SET game1=' . $game1 . ',
game2=' . $game2 . ',
game3=' . $game3 . ',
game4=' . $game4 . ',
game5=' . $game2 . ',
game6=' . $game6 . ',
game7=' . $game7 . ',
game8=' . $game8 . ',
misc='y'
WHERE username = ' . $sidarray[0] . ';

matt

Quoting JeRRy [EMAIL PROTECTED]:

   snip
  
   $sql = UPDATE round1 SET game1='$game1' ,
   game2='$game2' , game3='$game3' , game4='$game4'
   , game5='$game5' , game6='$game6' , game7='$game7'
  ,
   game8='$game8' , misc='y'
   WHERE username= \$sidarray[0]\;
  
  
  This only updates an existing record, where the
  username is equal to 
  $sidarray[0]. Don't expect it to insert new data.
 
 Yes tried both, insert and update.  Both fails. 
 Including a 'or die' statement in the mysql connection
 but does not return it can't connect.  So it must be
 connecting just not posting. :(  Any other problems
 that could cause this?
 
  
   Okay it output on the php page fine but won't save
  to
   db, anyone know why?
  
  Secondly, please put a little effort in writing
  quality code and markup 
  before you post it here. br is really ugly...
 
 I stated in my first post the code was messy ... Think
 messy and ugly match in some way.  It's just a quick
 job that worked fine last year but does not wanna work
 now. :(  I must of changed something before I ended my
 work last year on it to make it not work.  I'll keep
 trying some stuff.  Think it might have something to
 do with my cookie.php file as I require sidarray[0]
 which is fed from that.
 
 J
 
 Find local movie times and trailers on Yahoo! Movies.
 http://au.movies.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