php-windows Digest 20 Jan 2005 07:33:41 -0000 Issue 2543

Topics (messages 25391 through 25407):

php 5.03 as isapi
        25391 by: Leonhard K�llinger

SpreadSheet_Excel_Writer PEAR package
        25392 by: Louis Young
        25394 by: Torsten Roehr
        25395 by: tg-php.gryffyndevelopment.com

php 5.03 as isapi on W3K
        25393 by: Leonhard K�llinger

Import functions from a DLL file
        25396 by: Rui Silva
        25403 by: Jason Barnett

Re: MySQL connect problems
        25397 by: Joseph L. Mueller
        25398 by: Joseph L. Mueller
        25405 by: BoB6784

Really Super Dumb MSSQL (NOTE: Microsoft SQL) Question
        25399 by: Ron.Herhuth.tatumpartners.com
        25402 by: Mike

Re: DBA functions
        25400 by: Patrick Roane
        25401 by: Patrick Roane

how do I enable php to support DBA handlers?
        25404 by: Patrick Roane

Re: Output Image from Db to Browser
        25406 by: Auction Admin

Move to first record mssql
        25407 by: Louis Young

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Hi,
i have php5.03 on W3k with iis. As CGI its running, but i always get the
error message about CGI Header. So i tried to change to isapi but mysql
extension could not be loaded. Before i had installed php 5.02 running as
isapi and it works fine until i updated.

can anyone help?
thx

--- End Message ---
--- Begin Message ---
Hi there

Why does my background color not show if I set a cells pattern to 0?

Cheers
Louis

--- End Message ---
--- Begin Message ---
"Louis Young" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there
>
> Why does my background color not show if I set a cells pattern to 0?
>
> Cheers
> Louis

Hi Louis,

take a look here:
http://marc.theaimsgroup.com/?l=pear-general&m=108127548918900&w=2

Have you tried setFgColor()?

Regards, Torsten

--- End Message ---
--- Begin Message ---
First, I have to admit that I don't have any experience with PEAR's Excel 
Writer, but I have quite a bit of Excel experience (including Excel+VBA so I 
got some experience with the internal workings via code).

foreground color should be for the text and/or pattern color.  bgcolor should 
be for the cell color.  In the example used in that link, a pattern is set and 
the foreground color is set to 22.  Most likely this 'works' because the 
pattern is being colored, not the cell background.

I'm not sure what color index 22 is or pattern 2, but this seems like a bad 
solution (or at least not the 'right' solution) to what's being asked.

The quest was if you have pattern set to 0 (no pattern I would think), why a 
background color doesn't work properly.

Right now I don't have a good answer for anyone, but wanted to break down what 
was already mentioned and say that you might want to keep looking for a better 
solution.  No offense Torsten.  But I'm thinking that if Louis puts any data 
into that cell, it's going to show up in the 'fgcolor' color which may not be 
acceptable to what he's trying to do.

But hey... I could be wrong too. It's happened before. hah.

Louis!  You might check on the PEAR mailing list as well.. check their archives 
and such.  Someone may have had a similar problem and they most likely 
discussed it there before they did here. http://pear.php.net

Good luck!  Let us know if you find a solution.  I have an interest in 
PHP<->Excel stuff, but havn't had any  need for it recently.  So I'm eager to 
learn of any issues with PEAR's Excel Writer or other PHP/Excel solutions.

Thanks!

-TG


= = = Original message = = =

"Louis Young" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there
>
> Why does my background color not show if I set a cells pattern to 0?
>
> Cheers
> Louis

Hi Louis,

take a look here:
http://marc.theaimsgroup.com/?l=pear-general&m=108127548918900&w=2

Have you tried setFgColor()?

Regards, Torsten


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

--- End Message ---
--- Begin Message ---
Hi,
i have php5.03 on W3k with iis. As CGI its running, but i always get the
error message about CGI Header. So i tried to change to isapi but mysql
extension could not be loaded. Before i had installed php 5.02 running as
isapi and it works fine until i updated.

can anyone help?
thx

--- End Message ---
--- Begin Message ---
Hello!

 

I have a DLL witch I want to use in PHP.

This DLL file is Eztwain3.dll

It is possible running it on PHP?

I think I must create a special DLL (like php_Eztwain3.dll) to call
Eztwain3.dll and also php5ts.dll

Then I just need to add the next line on the php.ini:

extension= php_Eztwain3.dll

And put the php_Eztwain3.dll in the php\ext\ dir

Is that correct?

And, how can I create this DLL?

 

Thanks a lot!

Rui Silva

 


--- End Message ---
--- Begin Message --- Rui Silva wrote:
Hello!



I have a DLL witch I want to use in PHP.

This DLL file is Eztwain3.dll

It is possible running it on PHP?

I think I must create a special DLL (like php_Eztwain3.dll) to call
Eztwain3.dll and also php5ts.dll

Do you have the source for this DLL? I think you will find the process easier if you have this kind of access. Much, Much easier still if the DLL was originally written in C. If that's the case then everything you need is in the php source tarball :)



Then I just need to add the next line on the php.ini:

extension= php_Eztwain3.dll

And put the php_Eztwain3.dll in the php\ext\ dir

Is that correct?

Yep.


And, how can I create this DLL?

There is a great book I can recommend to help you out with this process, it's called "Advanced PHP Programming" and it is written by George Schlossnagle (one of the PHP developers). The last two sections of his book cover extending PHP... and of course the first 20 or so chapters are pretty useful as well :)


In his example he described writing an extension in C and showed how you could hook that into PHP as a module. I think that you will be able to use his example as a skeleton to at least understand how modules are interpreted by PHP. It's not exactly what you're looking for, but for cheap advice (the book is less than $50) this is probably as good as it's going to get :)


-- Teach a person to fish...

Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2

--- End Message ---
--- Begin Message --- Armando wrote:
If you upgraded to 4.1.x from 4.0.x then it's likely you need updated libraries (DLL files).

Armando

Joseph L. Mueller wrote:

Just upgraded to MSQL 4.1.8 and PHP 4.3.10 and am running apache 2.0.43 on Win XP. When trying to connnect to Mysql I get the following error:
"Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Documents and Settings\Owner\My Documents\My Website\listing8.1.php on line 3"


Listing8.1.php contains the following:
<?php
error_reporting (E_ALL);
$conn = mysql_connect("localhost", "joeuser", "somepass");
echo "$conn";
?>
Any help would be appreciated.
I resolved my problem by going to PHP 5.0.3.

--
Joseph L. Mueller

--- End Message ---
--- Begin Message --- Armando wrote:
If you upgraded to 4.1.x from 4.0.x then it's likely you need updated libraries (DLL files).

Armando

Joseph L. Mueller wrote:

Just upgraded to MSQL 4.1.8 and PHP 4.3.10 and am running apache 2.0.43 on Win XP. When trying to connnect to Mysql I get the following error:
"Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Documents and Settings\Owner\My Documents\My Website\listing8.1.php on line 3"


Listing8.1.php contains the following:
<?php
error_reporting (E_ALL);
$conn = mysql_connect("localhost", "joeuser", "somepass");
echo "$conn";
?>
Any help would be appreciated.
I resolved my problem by going to PHP 5.0.3.

--
Joseph L. Mueller

--- End Message ---
--- Begin Message ---
hi,

Mysql 4.1.8 now support another authentication protocol and you need to upgrade to php 5 and activate mysqli extension (not mysql) and use mysqli_connect and change all mysql_* function to mysqli_*
another way to fix the problem is to allow previous protocol but I forgot the way how to do this


hope it will be usedul

BoB



Joseph L. Mueller a �crit :
Just upgraded to MSQL 4.1.8 and PHP 4.3.10 and am running apache 2.0.43 on Win XP. When trying to connnect to Mysql I get the following error:
"Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Documents and Settings\Owner\My Documents\My Website\listing8.1.php on line 3"


Listing8.1.php contains the following:
<?php
error_reporting (E_ALL);
$conn = mysql_connect("localhost", "joeuser", "somepass");
echo "$conn";
?>
Any help would be appreciated.

--- End Message ---
--- Begin Message ---
I feel stupid asking this but I did a quick search and couldn't find an
answer.

When I write a simple query to query MSSQL...is there a simple way to know
if the query executed without error?  I'm looking to do a simple if then
statment to inform the user if the database information was added
successfully to the database.

if I do an:

echo $result = mssql_query($query);

I get a resource ID... is it safe to assume that if a resourceID is
returned that I can print a success message?

Ron






--- End Message ---
--- Begin Message ---
>From the php.net page for the mssql_query function:

Returns: A positive MS SQL result identifier on success, TRUE if no rows
were returned, or FALSE on error.  

You should be able to wrap the function itself in an if statement easily
enough.

-M

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, January 19, 2005 10:20 AM
> To: [email protected]
> Subject: [PHP-WIN] Really Super Dumb MSSQL (NOTE: Microsoft 
> SQL) Question
> 
> 
> I feel stupid asking this but I did a quick search and 
> couldn't find an answer.
> 
> When I write a simple query to query MSSQL...is there a 
> simple way to know if the query executed without error?  I'm 
> looking to do a simple if then statment to inform the user if 
> the database information was added successfully to the database.
> 
> if I do an:
> 
> echo $result = mssql_query($query);
> 
> I get a resource ID... is it safe to assume that if a 
> resourceID is returned that I can print a success message?
> 
> Ron
> 
> 
> 
> 
> 
> 

--- End Message ---
--- Begin Message ---
The steps I've taken so far to solve this are as
follows:

1. I got rid of WAMP in favor of installing php5.0.3
manually.

All i need help with now is how to: (see below-taken
from manual)

 By using the --enable-dba=shared  configuration
option you can build a dynamic loadable module to
enable PHP for basic support of dbm-style databases.
You also have to add support for at least one of the
following handlers by specifying the --with-XXXX
configure switch to your PHP configure line.

Where do I use the --enable-dba=shared configuration
option? Also, where do I specify the --with-XXXX
configure switch?

thanks




--- Patrick Roane <[EMAIL PROTECTED]> wrote:

> I need to use DBM-style abstraction layer functions 
> see: http://www.php.net/manual/en/ref.dba.php
> 
> 
> I am trying to find out if I compiled php (I
> actually
> installed WAMP 5:
> ----------------------------------
> Apache version :       Apache/1.3.33 (Win32)
> PHP version :         5.0.3
> MySQL version :       4.1.8-nt-log - extension : mysqlite
> -----------------------------------
> with support for any of the DBA handlers listed in
> table found here: 
> 
> http://www.php.net/manual/en/ref.dba.php
> 
> Does anyone know how I can find out? I tried to use
> the function:
> ---------------------------------
> var_dump( dba_handlers() );
> ---------------------------------
> which is supposed to give me a quick listing of
> available handlers. But when I run this, I get: 
> -----------------------------------
> Fatal error: Call to undefined function
> dba_handlers()
> in c:\wamp\www\dba_function.php on line 10
> ----------------------------------
> thanks-
> 
> 
> =====
> 
> ----------------
> "forget your lust for the rich man's gold. All that
> you need, is in your soul. You can do this if you
> try. All that I want for you my son, is to be
> satisfied"
> 
>   ~ Lynard Skynard
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


=====

----------------
"forget your lust for the rich man's gold. All that you need, is in your soul. 
You can do this if you try. All that I want for you my son, is to be satisfied"

  ~ Lynard Skynard

--- End Message ---
--- Begin Message ---
the configuration file AKA php.ini! Ok ... moving
forward now. 



--- Patrick Roane <[EMAIL PROTECTED]> wrote:

> The steps I've taken so far to solve this are as
> follows:
> 
> 1. I got rid of WAMP in favor of installing php5.0.3
> manually.
> 
> All i need help with now is how to: (see below-taken
> from manual)
> 
>  By using the --enable-dba=shared  configuration
> option you can build a dynamic loadable module to
> enable PHP for basic support of dbm-style databases.
> You also have to add support for at least one of the
> following handlers by specifying the --with-XXXX
> configure switch to your PHP configure line.
> 
> Where do I use the --enable-dba=shared configuration
> option? Also, where do I specify the --with-XXXX
> configure switch?
> 
> thanks
> 
> 
> 
> 
> --- Patrick Roane <[EMAIL PROTECTED]> wrote:
> 
> > I need to use DBM-style abstraction layer
> functions 
> > see: http://www.php.net/manual/en/ref.dba.php
> > 
> > 
> > I am trying to find out if I compiled php (I
> > actually
> > installed WAMP 5:
> > ----------------------------------
> > Apache version :     Apache/1.3.33 (Win32)
> > PHP version :       5.0.3
> > MySQL version :     4.1.8-nt-log - extension :
> mysqlite
> > -----------------------------------
> > with support for any of the DBA handlers listed in
> > table found here: 
> > 
> > http://www.php.net/manual/en/ref.dba.php
> > 
> > Does anyone know how I can find out? I tried to
> use
> > the function:
> > ---------------------------------
> > var_dump( dba_handlers() );
> > ---------------------------------
> > which is supposed to give me a quick listing of
> > available handlers. But when I run this, I get: 
> > -----------------------------------
> > Fatal error: Call to undefined function
> > dba_handlers()
> > in c:\wamp\www\dba_function.php on line 10
> > ----------------------------------
> > thanks-
> > 
> > 
> > =====
> > 
> > ----------------
> > "forget your lust for the rich man's gold. All
> that
> > you need, is in your soul. You can do this if you
> > try. All that I want for you my son, is to be
> > satisfied"
> > 
> >   ~ Lynard Skynard
> > 
> > -- 
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> > 
> > 
> 
> 
> =====
> 
> ----------------
> "forget your lust for the rich man's gold. All that
> you need, is in your soul. You can do this if you
> try. All that I want for you my son, is to be
> satisfied"
> 
>   ~ Lynard Skynard
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


=====

----------------
"forget your lust for the rich man's gold. All that you need, is in your soul. 
You can do this if you try. All that I want for you my son, is to be satisfied"

  ~ Lynard Skynard

--- End Message ---
--- Begin Message ---
I need some help configuring php on win XP to use DBA
handlers. Does anyone have experience with this?

I looked at the php manual and it says to download and
install one of several types of DBM systems like:

db4 and gdbm.

The manual also says to install by:
 ... using the --enable-dba=shared  configuration
option you can build a dynamic loadable module to
enable PHP for basic support of dbm-style databases.
You also have to add support for at least one of the
following handlers by specifying the --with-XXXX
configure switch to your PHP configure line.

I know this is done somewhere in the php.ini, but
where?

thanks-

=====

----------------
"forget your lust for the rich man's gold. All that you need, is in your soul. 
You can do this if you try. All that I want for you my son, is to be satisfied"

  ~ Lynard Skynard

--- End Message ---
--- Begin Message ---
Ok, you are trying to deliver the image inline. That requires a different 
document type in your header. Look at 
http://wp.netscape.com/assist/net_sites/pushpull.html. Search for 
multipart/mixed on the page. There is a brief description and an example that 
should help you get this done.

Another way would be reference the script that produces the image as the source 
for the image. Pass the text as part of the query string. When your script 
returns the image, include the  header ("Content-type: image/jpeg") followed by 
the image. Do not send any other content. I find this method a little easier to 
manage. 

Let's call your script "makeimage.php", your variable name "text" and the text 
to show "A sample string". Include an image tag in the page you are returning:

<img src="makeimage.php?text=A sample string">

You can test the image appearance by going directly to:

http://www.yourdomain.com/makeimage.php?text=A sample string

I hope this make ssome sense to you.




> ------------Original Message------------
> From: "MikeA" <[EMAIL PROTECTED]>
> To: [email protected]
> Date: Tue, Jan-18-2005 3:55 PM
> Subject: [PHP-WIN] Re: Output Image from Db to Browser
>
> I've tried both ways. I call the function from within the <IMG 
> SRC=....."> and I have tried to echo 
> it outside of that.
> 
> Which is the best way and/or the proper way?  I still cannot get it to 
> work but I have one more 
> thing to try that a gentleman just sent.
> 
> Any ideas are certainly welcome!
> 
> Mike
> 
> "Randy Clamons" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> Mike,
> 
> I'm wondering, are you trying to send the image inline with the rest of 
> the page, or is it response 
> to an img tag?
> 
>  Randy Clamons
> Systems Programming
> Astro-auction.com
> 
> 
> > ------------Original Message------------
> > From: "Wagner, Aaron" <[EMAIL PROTECTED]>
> > To: "MikeA" <[EMAIL PROTECTED]>, [email protected]
> > Date: Tue, Jan-18-2005 12:53 PM
> > Subject: RE: [PHP-WIN] Output Image from Db to Browser
> >
> >
> >
> > > -----Original Message-----
> > > From: news [mailto:[EMAIL PROTECTED] Behalf Of MikeA
> > > Sent: January 17, 2005 17:31
> > > To: [email protected]
> > > Subject: [PHP-WIN] Output Image from Db to Browser
> > >
> > >
> > > I am trying to output a JPG image to the browser without
> > > creating a file. I have tried several
> > > things but nothing seems to work. I sure could use a whole
> > > lot of help right now!  LOL  Going crazy
> > > trying to figure this out.  But I know there are PHP gurus
> > > out there that will have the answer in 2
> > > seconds.  Hopefully I'll be at that level someday too!
> > >
> > > The image comes from a MySQL Blob.  The closest I get is a
> > > string of garbage on the browser display.
> > > I cannot get it to display a pictures.
> > >
> > > Suggestions, comments, help, almost anything is appreciated.
> > > PLEASE help me! Project due in a week.
> > >
> > > Thanks in advance.
> > >
> > > Mike
> > >
> > >
> > >     if( mysql_num_rows($result) == 1 )
> > >   {
> > >     //header('Content-type: image/*');
> > >     $fileContent = mysql_result($result,0);  //,$blobfield);
> > >      echo $fileContent;
> > >
> > >     //$theimage = imagecreatefromstring ($fileContent);
> > >
> > >     //echo imagejpeg ( $theimage);
> > >
> > > -- 
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> > Here is how I'm doing it in a Call Flow setting.
> >
> > ---------------------------------
> > <?php
> > // -- program to dynamically create call flows from DB calls.
> > // -- The jpeg created here has to be within it's own frame\window 
> with
> > it's own header.
> > // -- maybe a iframe.
> >
> > //variables passed into script
> > //$txt = 'sometext'
> > //$shapetype = 'eclipse'
> > //$shapetype = 'polygon'
> > //$shapetype = 'rectangle'
> >
> > if ($txt == ''){
> > $txt =  "A Simple Text string \n A Simple Text string \n A Simple
> > string A Simple Text string A Simple Text string A Simple Text string 
> A
> > Simple Text string A Simple Text string A Simple Text string A Simple 
> Text
> > string ";
> > }else if (substr($txt, 0,6) == '<html>'){
> > print stripslashes($txt);
> > die();
> > }
> >
> > switch($shapetype){
> > case'eclipse':
> > $xshape_buffer = 25;
> > $yshape_buffer = 25;
> > break;
> > case'rectangle':
> > $xshape_buffer = 30;
> > $yshape_buffer = 50;
> > break;
> > case'polygon':
> > $xshape_buffer = 25;
> > $yshape_buffer = 25;
> > break;
> > }
> > // declare variables
> > $fontType = 5;
> > $fontPixelWidth = imagefontwidth($fontType);
> > $fontPixelHeight = imagefontheight($fontType);
> > $line_width = 50;
> > $txt_len = strlen($txt);
> > //------------------------
> >
> > $arr_txtStart = preg_split("/\s\b/", $txt, -1, PREG_SPLIT_NO_EMPTY);
> > $num_lines = count($arr_txt);
> >
> > $s = '';
> > $arr_txt=array();
> > $i=0;
> > foreach($arr_txtStart as $word){
> > $len_s = strlen($s);
> > $len_word = strlen($word) + 1; //add 1 for spaceadded
> > if(preg_match("/\r/i", $word )){
> > // print "1-$i-$word1<br>";
> > $s = $s." ".$word;
> > $arr_txt[$i] = trim($s);
> > $s = '';
> > $i++;
> > }else if (($len_s + $len_word)<$line_width){
> > // print "2-$i-$word<br>";
> > $s = $s." ".$word;
> > }else{
> > // print "3-$i-$word<br>";
> > $arr_txt[$i] = trim($s);
> > $s = $word;
> > $i++;
> > }
> > }
> > $arr_txt[$i] = $s;  //add the remaining text to the array
> > $num_lines = count($arr_txt);
> > // create a shape width set to $line_width plus ?? pixels as a buffer
> > $xsize = ($fontPixelWidth * $line_width) + $xshape_buffer;
> > $ysize = (($fontPixelHeight) * $num_lines) + $yshape_buffer;
> >
> > //print "x- $xsize y- $ysize";
> > //die();
> > if ($xsize < 475){
> > $xsize = 475;
> > }
> > if ($ysize < 170){
> > $ysize = 170;
> > }
> >
> >
> > //array_push($arr_txt, "x_size $xsize | y_size $ysize | str
> > len".strlen($txt) );
> > //------------------------------------
> >
> > $im = imagecreate ($xsize, $ysize) or die ("Cannot Initialize new GD
> > image stream");
> > //$im = imagecreate(450, 150) or die ("Cannot Initialize new GD image
> > stream");
> >
> > //header ("Content-type: image/jpeg");
> > //$background_color = imagecolorallocate ($im, 229,255,150);  
> //yellow
> > //$background_color = imagecolorallocate ($im, 255,255,255); //white
> > $background_color = imagecolorallocate ($im, 0,0,0); //black
> > $poly_color = imagecolorallocate ($im, 0, 150, 100); //green
> > $text_color = imagecolorallocate ($im, 255,255,255); //white
> >
> > //declare point values for the polygon
> > $p[0] = $xsize/2;
> > $p[1] = 0;
> > $p[2] = $xsize;
> > $p[3] = $ysize/2;
> > $p[4] = $xsize/2;
> > $p[5] = $ysize;
> > $p[6] = 0;
> > $p[7] = $ysize/2;
> >
> > if ($shapetype == "polygon"){
> > imagefilledpolygon($im, $p, 4, $poly_color);
> > }else if($shapetype == "rectangle"){
> > imagefilledrectangle ($im, 5, 5, ($xsize-5), ($ysize-5), 
> $poly_color);
> > }else if($shapetype == "eclipse"){
> > $poly_color = imagecolorallocate ($im, 246, 133, 137); //pink
> > imagefilledellipse ($im, ($xsize/2), ($ysize/2), ($xsize), ($ysize),
> > $poly_color);
> > }else{
> > die("No Flow ID Selected");
> > }
> > // --------------------------- string formatting
> > -------------------------------------
> > //find the rough middle of the string
> >
> > if (strlen($txt) <= $line_width){
> > $middle = (($xsize/2) - ($fontPixelWidth * (strlen($txt)/2)));
> > }else {
> > $middle = ($xsize/2) - ($fontPixelWidth * ($line_width/2));
> > }
> >
> > if ($shapetype == "polygon"){
> > //$poly_color = imagecolorallocate ($im, 255, 255, 255);
> > //$text_color = imagecolorallocate ($im, 0,0,0);
> > imagecolortransparent($im, $text_color);
> > imagerectangle ($im, 0, 0, ($xsize), ($ysize), $poly_color);
> > $nl=(($ysize/2)-(($num_lines/2)*$fontPixelHeight));
> > }elseif ($shapetype == "eclipse"){
> > if ($txt_len > 1000){
> > $poly_color = imagecolorallocate ($im, 255, 255, 255);
> > $text_color = imagecolorallocate ($im, 0,0,0);
> > imagecolortransparent($im, $text_color);
> > imagerectangle ($im, 0, 0, ($xsize), ($ysize), $poly_color);
> > }
> > $nl=(($ysize/2)-(($num_lines/2)*$fontPixelHeight));
> > array_push($arr_txt, "");
> > array_push($arr_txt, "");
> > $sp = ($xsize/2) - ($fontPixelWidth * 5);
> > $newsp = ($sp - $middle)/$fontPixelWidth;
> > for ($r=1;$r < $newsp;$r++){
> > $spacer .= ' ';
> > }
> > //print "$sp | $newsp | $middle |$spacer|";
> > array_push($arr_txt, "$spacer End of Flow");
> > }elseif ($shapetype == "rectangle"){
> > $nl=(($ysize/2)-(($num_lines/2)*$fontPixelHeight));
> > }
> >
> > for ($i=0;$i < (count($arr_txt));$i++){
> > imagestring ($im, $fontType, ($middle), ($nl),
> > trim(stripslashes($arr_txt[$i])), $text_color);
> > $nl += 12;
> > }
> > //sequence number in top left corner of flow
> > imagestring ($im, 0, (5), (5), $seqnum, $text_color);
> > //$seqnum
> > //$tmpfilename = 'temp'.(md5(uniqid("", TRUE))).'.jpg';
> > //print $tmpfilename;
> > //die();
> >
> > header ("Content-type: image/jpeg");
> > ImageJPEG($im, "", 70);
> > imagedestroy($im);
> > ?>

--- End Message ---
--- Begin Message ---
Hi there

I'm looping through an mssql dataset, using while($row=mssql_fetch_array($rsElecTrans)), but now I would like to loop through the same dataset again later on, but inn order to do this I need to move to the first record, so I tried:

mssql_data_seek($rsElecTrans, 0);
 while($row=mssql_fetch_array($rsElecTrans)) // this is line 514

But I get the following error:

*Warning*: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in *C:\Program Files\Apache Group\Apache2\htdocs\spar\admin\rpt_electrans.php* on line *514

How does that work?

Cheers
Louis
*

--- End Message ---

Reply via email to