[PHP-DB] Re: Problem

2003-03-08 Thread Edwin Boersma
Does not sound like a PHP problem to me, more like IIS. Try and find 
some system messages that relate to the link between the servers.

Edwin

Kiswa wrote:
Ok here is the problem.

At home i run an Apache server with php4
and the server its supposed to be run on is NT5 and iis with php4
The site is run on an access db through ODBC. It works fine at home where i
have a system link to the db.
On the iis server the admin created the same link but the damed thing
doesent work.
any suggestions would be great.

I dont know if there is any difference.





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


[PHP-DB] Re: Need help with php and apache

2003-03-08 Thread Edwin Boersma
Post this message to php.install.

Stephen K Knight wrote:
I am currently running on a Windows Box the OS is ME
I have installed apache 2.0.44 and I have downloaded the newest PHP download
for windows.
I have read the configuration manual repeatedly for getting the php into the
apache httpd.conf doc file. but I still cannot get php to be recognized.
Can anyone help me with this?



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


[PHP-DB] Re: mysql - first element missing

2003-03-08 Thread Edwin Boersma
Therefor, add a mysql_data_seek($this-result,0) to reset the pointer.

Furthermore, instead of the for-next loop, I would use while ($row = 
mysql_fetch_row($this-result).

Edwin

Foong wrote:
i guess the problem is the last line of your Query function:
$this-ligne = @mysql_fetch_row($this-result);
this line fetch the first row of the result.

therefore, when you call afficheResultatRequete(...)
you start from the second row of the result.
Foong

F.Collineau [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
I try to display the result of a mysql request but first element misses !
here is my code:
$sql-Query(select marque, reference from base );
$sql-afficheResultatRequete($sql-result,$sql-nbreChamps);
 function Query ($query) {
$this-result = @mysql_query($query, $this-id) or MySQL_ErrorMsg
(Impossible
de lancer la requete: $query);
$this-rows = @mysql_num_rows($this-result);
$this-nbreChamps = @mysql_num_fields($this-result);
$this-ligne = @mysql_fetch_row($this-result);
}
function afficheResultatRequete($result,$nbChamps)
{
for($i=0 ; $row=mysql_fetch_row($result);++$i)
{
print(tr);
$this-color_tab($i);
for($j=0;$j$nbChamps;$j++)
{
print td; print((string)$row[$j]); /td\n;
}
print /tr;
}
}

Whet is the problem ?

Thanks

Franck
--
Faites un voeu et puis Voila ! www.voila.fr





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


[PHP-DB] PHP + Interbase / Firebird extensions

2003-03-08 Thread Andy Neillans
This might sound like a daft question, so I apologise :)

I have been asked to link to an existing Firebird / Interbase server and
pull some records via PHP page on our intranet and internet servers.

The problem is, correct me if I am wrong, that I need to recompile PHP to
install the Interbase extesions  ---  this is not going to be fun, as both
machines are under fairly constant load..

Is it possible to simply load the Interbase extensions as a module? If so,
where can I get the source / instructions for compiling / installing this
module?

Platforms: Mandrake Linux 9.0, Redhat Linux 7.2

Many thanks!

Andy Neillans



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



Re: [PHP-DB] How to page results?

2003-03-08 Thread David Eisenhart
There is also a decent looking article (haven't yet studied it in any detail
though) on pagination at
http://www.phpfreaks.com/tutorials/43/0.php

David Eisenhart


Richard Hutchins [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Mike,

 If you check www.phpclasses.org, and search for paging there's a paging
 class built by pierre-yves lemaire that might do just what you're looking
 for. It's pretty highly rated by the users of the site.

 I also know this question has been asked in the past so a stroll through
the
 archives may yield additional leads on other sites such as freshmeat and
 phpbuilder.

 Good luck,
 Rich

  -Original Message-
  From: mike karthauser [mailto:[EMAIL PROTECTED]
  Sent: Thursday, March 06, 2003 1:32 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] How to page results?
 
 
  We've been working on a news section for our site which
  allows us to find
  news stories - dump them in a mysql db, list the summaries
  in a page and
  then link to a full version of the story.
 
  The bit i'm having trouble with is how to list the results so
  we can set up
  multi pages of content and link them via a simple
 
  Previous | 1 2 3 4 5 | Next
 
  type of scenario.
 
  I got a query thus
 
  $result2=mysql_num_rows($result);
 
  to count our results. Does anyone have any pointers on what
  to do next?
 
  Cheers
  mikek
 
  --
  Mike Karthauser
  Managing Director - Brightstorm Ltd
 
  Email[EMAIL PROTECTED]
  Web  http://www.brightstorm.co.uk
  Tel  0117 9426653 (office)
 07939 252144 (mobile)
 
  SnailmailUnit 8, 14 King Square,
 Bristol BS2 8JJ
 
 
  --
  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] subtracting times

2003-03-08 Thread David Rice


I know I asked this before buy no-one gave me an answer i was looking for, I 
want to subtract two times and the ammount of hours worked to 2decimal 
places (3.41 hours)

cheers,
dave
_
Use MSN Messenger to send music and pics to your friends 
http://messenger.msn.co.uk

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


[PHP-DB] Re: subtracting times

2003-03-08 Thread Edwin Boersma
I see 2 replies

Edwin

David Rice wrote:


I know I asked this before buy no-one gave me an answer i was looking 
for, I want to subtract two times and the ammount of hours worked to 
2decimal places (3.41 hours)

cheers,
dave
_
Use MSN Messenger to send music and pics to your friends 
http://messenger.msn.co.uk



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


Re: [PHP-DB] PHP + Interbase / Firebird extensions

2003-03-08 Thread Koleszr Tibor
Dear Andy,

Sorry if i cant answer for your question, I'm a Debian user and I don't know
the apache and php packages of Readhat and Mandrake. In Debian simply
you have to apt-get the php4-interbase module for php and you have to
restart apache.
You should check your system about:
 - is apache configured and compiled for modules?
 - is php compiled for modules?
 - if so, compile or download interbase module for you version of php and
restart apache.

This should work.

Tibor

- Original Message -
From: Andy Neillans [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 08, 2003 10:42 AM
Subject: [PHP-DB] PHP + Interbase / Firebird extensions


 This might sound like a daft question, so I apologise :)

 I have been asked to link to an existing Firebird / Interbase server and
 pull some records via PHP page on our intranet and internet servers.

 The problem is, correct me if I am wrong, that I need to recompile PHP to
 install the Interbase extesions  ---  this is not going to be fun, as both
 machines are under fairly constant load..

 Is it possible to simply load the Interbase extensions as a module? If so,
 where can I get the source / instructions for compiling / installing this
 module?

 Platforms: Mandrake Linux 9.0, Redhat Linux 7.2

 Many thanks!

 Andy Neillans



 --
 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] explode string variable

2003-03-08 Thread André Sannerholt
Hi everyone!

Does anybody know how to stop an explosion of a string: Let me explain:

$variable_aray=explode('-', $variable);

I want the variable to be devided in only two other ones! If for example:

$variable=Willy-Brandt-Platz-5

I want to have an array that looks like this:

$variable_array[0] should be Willy
$variable_array[1] should be Brandt-Platz


Regards

André




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



Re: [PHP-DB] Re: subtracting times (solution)

2003-03-08 Thread David Rice
It took me about 30 mins but after 2 attempts i came up with a function that 
subtracts 2 times to give an answer in hours, to two decimal places.

thanks for your help the two people who responded when i posted the 
question, your suggestions were a bit out on a tangent from what i wanted. 
But they got me kinda thinkin about it.

the purpose of this is to calculate staffs payroll, by gettin their shift 
total of hours, this script assumes that a person will be starting work on 
one day, and finishing before 4am the next day.

here's the code if your interested

=

?
function subtract_times($time1, $time2){
$time1array = split(:,$time1);
$time2array = split(:,$time2);
$hours1 = ( ( $time1array[0] ) * 60 );
$minutes1 = $time1array[1];
$hours2 = ( ( $time2array[0] ) * 60 );
$minutes2 = $time2array[1];
$subtotal1 = ($hours1 + $minutes1);
$subtotal2 = ($hours2 + $minutes2);
		if ( (0 = $subtotal2)  ( $subtotal2 = 300) ){

$subtotal1 = ( 1440 - ( $subtotal1 ) );
$total = ( round ( ( ($subtotal1 + $subtotal2) / 60 ) , 2 ) );
}
else{
			$subtotal = ( ( ( $hours2 - $hours1 ) ) + ( $minutes2 - $minutes1 ) );

$total = ( round ( ( ($subtotal) / 60 ) , 2 ) ) ;
}
return $total;

}

_
MSN Messenger - fast, easy and FREE! http://messenger.msn.co.uk
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] PHP + Interbase / Firebird extensions

2003-03-08 Thread Andrew Neillans
Tibor,

Thanks for your response!

I thought it would be fairly simple to find the RPM for Mandrake / Redhat
and install it, but I can't seem to find one anywhere for php4-interbase.

Apache and PHP are compiled for module support, as I have a couple of
modules already installed and running.

Any idea where I can download the interbase module??

Andy

 Dear Andy,
 
 Sorry if i cant answer for your question, I'm a Debian user and I don't
 know
 the apache and php packages of Readhat and Mandrake. In Debian simply
 you have to apt-get the php4-interbase module for php and you have to
 restart apache.
 You should check your system about:
  - is apache configured and compiled for modules?
  - is php compiled for modules?
  - if so, compile or download interbase module for you version of php and
 restart apache.
 
 This should work.
 
 Tibor


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



[PHP-DB] Re: explode string variable

2003-03-08 Thread Fredrik de Vibe
[EMAIL PROTECTED] (André Sannerholt) writes:
 Does anybody know how to stop an explosion of a string: Let me explain:
 
 $variable_aray=explode('-', $variable);
 
 I want the variable to be devided in only two other ones! If for example:
 
 $variable=Willy-Brandt-Platz-5
 
 I want to have an array that looks like this:
 
 $variable_array[0] should be Willy
 $variable_array[1] should be Brandt-Platz

I guess you could use the proper regexp functions, like e.g.

  preg_match(/^(\w+)-(.*?)-\d/, $variable, $matches)

then $matches[1] and $matches[2] should (haven't tested) contain what
you want...

-- 
--Fredrik
My opinions may have changed, but not the fact that I am right.

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



[PHP-DB] Re: explode string variable

2003-03-08 Thread Joel Colombo
or just :

$word = James-Martin-Smith
$word_break = Array();
$first_dash = strpos($word, '-');
if ($first_dash !== false) {
$word_break[0] = substr($word,0,$first_dash+1);
$word_break[1] = substr($word,$first_dash+1,strlen($word));
}







André Sannerholt [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi everyone!

 Does anybody know how to stop an explosion of a string: Let me
explain:

 $variable_aray=explode('-', $variable);

 I want the variable to be devided in only two other ones! If for example:

 $variable=Willy-Brandt-Platz-5

 I want to have an array that looks like this:

 $variable_array[0] should be Willy
 $variable_array[1] should be Brandt-Platz


 Regards

 André






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



Re: [PHP-DB] explode string variable

2003-03-08 Thread Paul Burney
on 3/8/03 10:40 AM, André Sannerholt at [EMAIL PROTECTED] appended the
following bits to my mbox:

 Does anybody know how to stop an explosion of a string: Let me explain:

 I want the variable to be devided in only two other ones! If for example:
 $variable=Willy-Brandt-Platz-5
 
 I want to have an array that looks like this:
 $variable_array[0] should be Willy
 $variable_array[1] should be Brandt-Platz

Wrong list since doesn't involve databases.  Should be on PHP-General.  That
said, use strtok:

http://www.php.net/manual/en/function.strtok.php

Sincerely,

Paul Burney
http://paulburney.com/

?php
while ($self != asleep) {
$sheep_count++;
}
?



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



[PHP-DB] file save part 2

2003-03-08 Thread Ryan Holowaychuk
I have tried a few things and I can get the file to have each line on
its own line.
Once again this is a roster input that I adding to our website:  No,
name grade .

The roster will contain 15 players

So right now the implode puts everything on one line in the text file!!!

So I am no sure if anybody can shed some light on this one

Thanks
Ryan

?
//create a new file
 $fp = fopen(/place/on/server/ . $HTTP_POST_VARS['team'] ,
w);

 $file_data = implode(\t\, $_POST);
//this would return values spit by tabs
//write to the open file handle
 fwrite($fp, $file_data . \r\n);
//close the file
 fclose($fp); 

?



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



Re: [PHP-DB] file save part 2

2003-03-08 Thread Paul Burney
on 3/8/03 6:13 PM, Ryan Holowaychuk at [EMAIL PROTECTED] appended the
following bits to my mbox:

 I have tried a few things and I can get the file to have each line on
 its own line.

FYI, this is probably on the wrong list since it isn't database related.
You should post to PHP-GENERAL to get more responses.

What do you mean by 'line'?  Do you mean each piece of data, i.e., (no,
name, grade)?  If so, you need to implode using the the newline.

If you are accepting multiple entries to the file, change the mode from w to
a to append new data.

$file_data = implode(\r\n, $_POST);

If that doesn't help, send an example of what you want the data to look
like.

Sincerely,

Paul Burney

-- 

I'm inhaling Caesar's last gasp...
http://paul.burney.ws/thoughts/caesars_breath.html


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