[PHP-DB] Re: question in ADODB

2003-02-19 Thread Philippe Saladin
> I found the following code on the internet. I'd like to know that what I
> need to do, if I want to use the actually Access file with out the DSN,
how
> to use the Microsoft Jet?
> thx
>
> -- code 
>  include("adodb.inc.php");
>  $db = NewADOConnection('mysql');

Look at the adodb manual : http://php.weblogs.com/adodb_manual
$db = NewADOConnection('access');
(Microsoft Access/Jet. You need to create an ODBC DSN)
or
$db = NewADOConnection('ado_access');
(Microsoft Access/Jet using ADO. Allows DSN-less connections. For best
performance, use an OLEDB provider.)

Regards,
Philippe



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




[PHP-DB] PHP4 on Windows & using MSSQL

2003-02-19 Thread Kevin Gordon
I have written PHP which runs 100% on Linux & Postgresql. I have been
successful installing PHP4 on windows as an ISAPI MODULE. My PHP code
runs ok on Windows NT4 ok except:
(a) Session functions produce errors

(b) I am unable to connect to MSSQL (using ODBC). The System ODBC Driver
tests ok.

Any Suggestions please?

Kevin Gordon



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




RE: [PHP-DB] Auto Generation of HTML Forms + SQL Code to update My/Postgre SQL Database

2003-02-19 Thread Luke Woollard
thanks dude.

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 20 February 2003 5:04 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Auto Generation of HTML Forms + SQL Code to update
My/Postgre SQL Database


On Thursday 20 February 2003 23:49, Luke Woollard wrote:
> Does anyone know of a program that can autp-generate HTML interfaces and
> PHP Code to add to/update/delete from different tables in a
> mysql/postgresql database?
>
> Something similar to some of the RAD tools on the market for Microsoft
> products etc...
>
> I'm trying to quicken my development cycle.

freshmeat.net and search for "mysql forms"

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Nobody can be as agreeable as an uninvited guest.
*/


-- 
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] Auto Generation of HTML Forms + SQL Code to update My/Postgre SQL Database

2003-02-19 Thread Jason Wong
On Thursday 20 February 2003 23:49, Luke Woollard wrote:
> Does anyone know of a program that can autp-generate HTML interfaces and
> PHP Code to add to/update/delete from different tables in a
> mysql/postgresql database?
>
> Something similar to some of the RAD tools on the market for Microsoft
> products etc...
>
> I'm trying to quicken my development cycle.

freshmeat.net and search for "mysql forms"

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Nobody can be as agreeable as an uninvited guest.
*/


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




[PHP-DB] Auto Generation of HTML Forms + SQL Code to update My/Postgre SQL Database

2003-02-19 Thread Luke Woollard
Does anyone know of a program that can autp-generate HTML interfaces and PHP
Code to add to/update/delete from different tables in a mysql/postgresql
database?

Something similar to some of the RAD tools on the market for Microsoft
products etc...

I'm trying to quicken my development cycle.
:)

Luke Woollard


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




Re: [PHP-DB] Re: Final Date Question :-)

2003-02-19 Thread Fredrik de Vibe
[EMAIL PROTECTED] (Chris Payne) writes:
> Basically what I mean is I have an orderform for rooms.  THey can select the
> date they arrive and the date they leave, but if they leave on a different
> month when the price is higher, the last day or however many will be a
> higher price, what I need is to not only calculate the flat price, but also
> take into account if their stay goes over a period of time when rooms are
> more than they are at other times of the year.
> So, they could book monday - friday, monday thru wednesday could be $50, but
> it needs to check and see if any of the dates - in this example - fall on a
> date that the prices are higher, so in this example thursday and friday
> would be $80 a night whereas monday thru wednesday would be $50.  It's hard
> to explain :-)

OK. I guess you have to check all the dates, then. You could do it by
starting with the first day, get the timestamp for that day
(mktime(0,0,0,m,d,y)), and then you can add 86400 (secs per day) to
this and check each day consecutively using e.g. the getdate()
function. (http://www.php.net/manual/en/function.getdate.php)

Something like (not tested):

// ...
$current_timestamp = mktime(0,0,0,$start_m,$start_d,$start_y);
// ...
for($i=0;$i<$num_days_of_stay;$i++){
  $this_date = getdate($current_timestamp);
  // $this_date now contains all the info you need
  // Now, check for month, day of week etc. and update as needed
  // ...
  $current_timestamp += 86400;
}


-- 
--Fredrik
Faith, n:
That quality which enables us to believe what we know to be
untrue.

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




Re: [PHP-DB] Re: Final Date Question :-)

2003-02-19 Thread Chris Payne
Hi there :-)

Basically what I mean is I have an orderform for rooms.  THey can select the
date they arrive and the date they leave, but if they leave on a different
month when the price is higher, the last day or however many will be a
higher price, what I need is to not only calculate the flat price, but also
take into account if their stay goes over a period of time when rooms are
more than they are at other times of the year.
So, they could book monday - friday, monday thru wednesday could be $50, but
it needs to check and see if any of the dates - in this example - fall on a
date that the prices are higher, so in this example thursday and friday
would be $80 a night whereas monday thru wednesday would be $50.  It's hard
to explain :-)

Chris

> [EMAIL PROTECTED] (Chris Payne) writes:
> > pardon les francais :-)
>
> Les Français - the (pl) french (people) ? ;-)
>
> > I don't know how else to explain it so sorry if I confused you.
>
> I don't know if anybody else might get this, but I have absolutely no
> idea what you mean. If I'm to say anything, I think you have to post
> some code.
>
>
> --
> --Fredrik
> Faith, n:
> That quality which enables us to believe what we know to be
> untrue.
>
> --
> 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] Re: Final Date Question :-)

2003-02-19 Thread Fredrik de Vibe
[EMAIL PROTECTED] (Chris Payne) writes:
> pardon les francais :-)

Les Français - the (pl) french (people) ? ;-)

> I don't know how else to explain it so sorry if I confused you.

I don't know if anybody else might get this, but I have absolutely no
idea what you mean. If I'm to say anything, I think you have to post
some code.


-- 
--Fredrik
Faith, n:
That quality which enables us to believe what we know to be
untrue.

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




[PHP-DB] Final Date Question :-)

2003-02-19 Thread Chris Payne
Hi there everyone,

OK here is a final date question.  It's complex (Atleast to me :-( but i'm totally 
stumped.  Here's what I need to do.  Say September is Summer and October is winter, 
now getting the dates for each month is easy.

Now, say in September each day is worth $50 but in October each day of the month is 
worth $70.

Now finally, say you choose 2 days in September and 2 in October (And this is what 
stumps the living crap out of me - pardon les francais :-) the system has to know "He 
chose 2 in september so that's $100 in total, but hold on, wait a minute, he chose 2 
in october and these are worth $140 for 2 days) - so how can I get it to do that?  I 
know how to get it to do the september, but finding that it ran into October and that 
Octobers 2 days are worth more than septembers just totally goes over my head :-(

I don't know how else to explain it so sorry if I confused you.

Chris


[PHP-DB] Re: Storing images in MySQL table

2003-02-19 Thread no-spam----me
Do NOT store images in a DB, the overhead kills performance.  If it's a tiny app
with very little traffic, the fine.  Otherwise, store images in the filesystem.


[EMAIL PROTECTED] wrote:
> Hi everybody,
>   i want to store some articles and images to them in MySQL 
> db. could you just give advice if it is better to store the image in BLOB 
> or if to save on server and in db just have it's URL.


>   Hi Milan


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




[PHP-DB] Re: sorting a multimensional array

2003-02-19 Thread no-spam----me
http://www.php.net/array_multisort is your answer.

Mark Snijders <[EMAIL PROTECTED]> wrote:
> hello,

> i've got the next array:

> Array
> (
> [testsubnet] => Array
> (
> [2690910720] => 255.255.255.0
> )

> [GLN-subnetsirangevoorgedelegeerddomein] => Array
> (
> [2886735616] => 255.255.255.0
> )

> [testsubnet2] => Array
> (
> [1209360384] => 255.255.224.0
> )

> [lpd (tpg-nl1)] => Array
> (
> [175964160] => 255.255.0.0
> )
> }

> I need to sort it by name or by the big nummer between []

> to sort it by name i do this:

> ksort($ARRAYNAME);

> and it works fine, but how do I sort by the big number between []  ...

> I really don't get it...

> thanks for the help..

> Mark,



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




Re: [PHP-DB] Re: Date Question

2003-02-19 Thread Chris Payne
Hi there,

Thanks for your help, it is VERY appreciated :-)

Regards

Chris


> [EMAIL PROTECTED] (Chris Payne) writes:
> > I have the following 2 dates (FOr example):
> > 19-02-2003 
> > 21-02-2003
> > How can I easily find out how many nights there are between the 2
> > dates? For example, the above would be 2 nights as the 21st would be
> > the checkout date.
> 
> I guess this will work:
> 
> $start = "19-02-2003";
> $end = "21-02-2003";
> 
> // Split the strings into day, month, year
> list($sd, $sm, $sy) = split("-", $start);
> list($ed, $em, $ey) = split("-", $end);
> 
> // Create unix time stamps for the start and end date
> $start_sec = mktime(0, 0, 0, $sm, $sd, $sy);
> $end_sec = mktime(0, 0, 0, $em, $ed, $ey);
> 
> // Calculate number of days
> $num_days = ($end_sec - $start_sec) / 86400; // 86400 secs / day
> 
> 
> -- 
> --Fredrik
> Faith, n:
> That quality which enables us to believe what we know to be
> untrue.
> 
> -- 
> 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] Re: Date Question

2003-02-19 Thread Fredrik de Vibe
[EMAIL PROTECTED] (Chris Payne) writes:
> I have the following 2 dates (FOr example):
> 19-02-2003 
> 21-02-2003
> How can I easily find out how many nights there are between the 2
> dates? For example, the above would be 2 nights as the 21st would be
> the checkout date.

I guess this will work:

$start = "19-02-2003";
$end = "21-02-2003";

// Split the strings into day, month, year
list($sd, $sm, $sy) = split("-", $start);
list($ed, $em, $ey) = split("-", $end);

// Create unix time stamps for the start and end date
$start_sec = mktime(0, 0, 0, $sm, $sd, $sy);
$end_sec = mktime(0, 0, 0, $em, $ed, $ey);

// Calculate number of days
$num_days = ($end_sec - $start_sec) / 86400; // 86400 secs / day


-- 
--Fredrik
Faith, n:
That quality which enables us to believe what we know to be
untrue.

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




[PHP-DB] Date Question

2003-02-19 Thread Chris Payne
Hi there everyone,

I have the following 2 dates (FOr example):

19-02-2003 
21-02-2003

How can I easily find out how many nights there are between the 2 dates?  For example, 
the above would be 2 nights as the 21st would be the checkout date.

I have the use the format about as that is how the info is given to me for me to parse 
via PHP.

Thanks

Chris


[PHP-DB] Re: Pear with PHP

2003-02-19 Thread aspire
Neil wrote:

Hi,

How do you install pear db to work with PHP. having a problem with certain applications needing pear. How and where do I get the program and installation instructions.

Thank you all
Neil

If ur Os is UNIX like then PEAR is intsalled by default With version PHP 
ver > 4.3.X



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



[PHP-DB] question in ADODB

2003-02-19 Thread pei_world
I found the following code on the internet. I'd like to know that what I
need to do, if I want to use the actually Access file with out the DSN, how
to use the Microsoft Jet?
thx

-- code 
 include("adodb.inc.php");
 $db = NewADOConnection('mysql');
 $db->Connect("localhost", "root", "password", "mydb");
 $result = $db->Execute("SELECT * FROM employees");
 if ($result === false) die("failed");
 while (!$result->EOF) {
for ($i=0, $max=$result->FieldCount(); $i < $max; $i++)
   print $result->fields[$i].' ';
$result->MoveNext();
print "\n";
 }
--

--
Sincerely your;

pei_world ( .::IT::. )



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




[PHP-DB] query

2003-02-19 Thread pei_world
$conn = new COM("ADODB.Connection");
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$database");

$query = "SELECT * FROM user";

$result = $conn->Execute($query) or die("fail to connection to the
database!");
 if ($result->RecordCount()!=-1){
  //do something
}

--
Sincerely your;

pei_world ( .::IT::. )
"Pei_world" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> when I try to connection to the access file using Microsoft Jet Engine. it
> come up with following error!
> can anyone help me?
>
>   $result = $conn->Execute($query)  I check the table is exists,and the query should be correct.
>
> --
> Warning: Invoke() failed: Exception occurred. Source: Microsoft JET
Database
> Engine Description: Syntax error in FROM clause.
> -
> thx
> --
> Sincerely your;
>
> pei_world ( .::IT::. )
>
>



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




Re: [PHP-DB] mysql_fetch_array and extract() with LEFT SELECT

2003-02-19 Thread Mark
Try "SELECT id,LEFT(fluff,80) as fluffy FROM sometable"

Then extract() will have a value for fluffy


--- Baumgartner Jeffrey <[EMAIL PROTECTED]> wrote:
> I'm having a problem when I use mysql_fetch_array and extract()
> following a
> left select query. As an example...
> 
> $query = "SELECT id,LEFT(fluff,80) FROM sometable";
> $result = mysql_query($query) or die('message');
> 
> while ($row = mysql_fetch_array($result){
> extract($row);
> echo "" . $id . ": " . $fluff . "";
> }
> 
> would echo the $id, but there would be nothing for $fluff. However,
> if I
> select only 'fluff' from the MySQL table, I get the full text for
> $fluff. I
> am reluctant to SELECT the entire fluff text from the table and
> shorten it
> in PHP  as that seems inefficient to me - (but correct me if I am
> wrong).
> 
> I expect the solution must be dead easy, but I can't find it or
> figure it
> out.
> 
> Many thanks,
> 
> Jeffrey
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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




Re: [PHP-DB] "LIMIT" problem MSSQL

2003-02-19 Thread Noam Giladi
a solution offered i received from "raydan

Untested:
Untested:
declare @num int
set @num = 20

EXEC ('select top 10 from myTable
   where ID not in (select top ' + @num + ' from myTable order by ID)
order by ID')

But beware the dangers of dynamic SQL.



"Mark Snijders" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]
...
> $start = 10;
>
> $numbers_to_show = 25;
>
> $sql = "SELECT * FROM bla Limit $start, $numbers_to_show";
>
> or just go to mysql.com and use the manual :)
>
> -Original Message-
> From: Noam Giladi [mailto:[EMAIL PROTECTED]]
> Sent: woensdag 19 februari 2003 16:00
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] "LIMIT" problem MSSQL
>
>
> I'm trying to split results into different pages and number the pages
> accordingly.  I've been able to build a fairly intelligent page numbering
> system which knows which rows it should pull (at least by numbering each
row
> numerically) but I don't know how to construct a SQL query to pull 10
> results starting at a certain number.
>
> please  did anyone wrote a proc that do it?.
>
>
>
>
> --
> 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] "LIMIT" problem MSSQL

2003-02-19 Thread Adam Voigt




Well if you do, (sort by id) this will work.



On Wed, 2003-02-19 at 11:14, Noam Giladi wrote:

i'm not using a fixed sort



tnx  noam

  "Adam Voigt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

  Assuming your sorting by id, just do: 



  SELECT TOP 50 * FROM TABLE WHERE id > $lastid 



  And just have lastid posting to the page every time 

  they hit next, and in lastid, put the last id of the results 

  on that page. 



  On Wed, 2003-02-19 at 09:59, Noam Giladi wrote: 

I'm trying to split results into different pages and number the pages 

accordingly. I've been able to build a fairly intelligent page numbering 

system which knows which rows it should pull (at least by numbering each row 

numerically) but I don't know how to construct a SQL query to pull 10 

results starting at a certain number. 



please did anyone wrote a proc that do it?. 









-- 

PHP Database Mailing List (http://www.php.net/) 

To unsubscribe, visit: http://www.php.net/unsub.php 



-- 

Adam Voigt ([EMAIL PROTECTED])

The Cryptocomm Group

My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc

   






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP-DB] Re: SapDB

2003-02-19 Thread Robert Sundström
In article <002001c29d40$007a5480$0533010a@hercules>, [EMAIL PROTECTED] (Alejandro 
Michelin Salomon \) wrote:
>In this moment i need odbc for access sapdb Databases.
>In php the development, is plan to have a sapdb extension ?

Why would you need that?  Most databases expose a standardized interface 
(ODBC) and it is up to PHP to provide a decent implementation to that 
specification, something PHP unfortunately is lacking. 

For some reason I suspect that it is equally hard to provide a decent ODBC 
implementation than invent another one based in a proprietary SapDB 
interface... :-)


-
Robert Sundström, Mimer SQL Development
Upright Database Technology AB, http://www.mimer.com
Validate your SQL statements/procedures at http://developer.mimer.com/parser

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




Re: [PHP-DB] "LIMIT" problem MSSQL

2003-02-19 Thread Noam Giladi
i'm not using a fixed sort

tnx  noam
  "Adam Voigt" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Assuming your sorting by id, just do: 

  SELECT TOP 50 * FROM TABLE WHERE id > $lastid 

  And just have lastid posting to the page every time 
  they hit next, and in lastid, put the last id of the results 
  on that page. 

  On Wed, 2003-02-19 at 09:59, Noam Giladi wrote: 
I'm trying to split results into different pages and number the pages 
accordingly. I've been able to build a fairly intelligent page numbering 
system which knows which rows it should pull (at least by numbering each row 
numerically) but I don't know how to construct a SQL query to pull 10 
results starting at a certain number. 

please did anyone wrote a proc that do it?. 




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

-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
   




Re: [PHP-DB] "LIMIT" problem MSSQL

2003-02-19 Thread Adam Voigt




Assuming your sorting by id, just do:



SELECT TOP 50 * FROM TABLE WHERE id > $lastid



And just have lastid posting to the page every time

they hit next, and in lastid, put the last id of the results

on that page.



On Wed, 2003-02-19 at 09:59, Noam Giladi wrote:

I'm trying to split results into different pages and number the pages

accordingly.  I've been able to build a fairly intelligent page numbering

system which knows which rows it should pull (at least by numbering each row

numerically) but I don't know how to construct a SQL query to pull 10

results starting at a certain number.



please  did anyone wrote a proc that do it?.









-- 

PHP Database Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB] "LIMIT" problem MSSQL

2003-02-19 Thread Noam Giladi
i assume this problem was solved in the past
i didn't found a ready solution.
i try to use  FATCH .

and i have another link with ths same problem..
http://forums.devshed.com/showthread.php?threadid=33114


tnx  noam


"John Krewson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The title suggests MSSQL, which if I am correct doesn't support Limit
> like MySQL.
>
> I'm working on the same thing right now so I don't have a quick and
> dirty working example, although it doesn't look to be too difficult to
> use server side cursors in MSSQL.
>
> Here is a related a link to a similar question at phpbuilder:
> http://www.phpbuilder.com/mail/php-db/2001062/0055.php
>
> Snijders, Mark wrote:
> > $start = 10;
> >
> > $numbers_to_show = 25;
> >
> > $sql = "SELECT * FROM bla Limit $start, $numbers_to_show";
> >
> > or just go to mysql.com and use the manual :)
> >
> > -Original Message-
> > From: Noam Giladi [mailto:[EMAIL PROTECTED]]
> > Sent: woensdag 19 februari 2003 16:00
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] "LIMIT" problem MSSQL
> >
> >
> > I'm trying to split results into different pages and number the pages
> > accordingly.  I've been able to build a fairly intelligent page
numbering
> > system which knows which rows it should pull (at least by numbering each
row
> > numerically) but I don't know how to construct a SQL query to pull 10
> > results starting at a certain number.
> >
> > please  did anyone wrote a proc that do it?.
> >
> >
> >
> >
>
> --
> John Krewson
> Programmer - SWORPS
>



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




Re: [PHP-DB] Storing images in MySQL table

2003-02-19 Thread Len Sorensen
On Wed, Feb 19, 2003 at 11:07:28AM +0200, Corne' Cornelius wrote:
> The only disadvantage i've had of storing images in DB instead of 
> Filesystem, is that when you use a PHP script to output the image to a 
> client browser, MSIE doesn't always accept a suggested filename so it 
> might try and save it as "your-script.php?img=2".

Perhaps using the syntax 'your-script.php/imagename?otherparams' would
solve that.  It does for the few cell phones I have worked on serving
images to.  At least apache allows that syntax.

> Other then that, keeping images in DB is a lot easier since you don't 
> have to keep your DB in sync with Filesystems ie. Deleted records in DB, 
> but images still exist.

Certainly nice.  Now if only postgres had a nice way to dump/backup
BLOBs. :)

Len Sorensen

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




Re: [PHP-DB] "LIMIT" problem MSSQL

2003-02-19 Thread John Krewson
The title suggests MSSQL, which if I am correct doesn't support Limit 
like MySQL.

I'm working on the same thing right now so I don't have a quick and 
dirty working example, although it doesn't look to be too difficult to 
use server side cursors in MSSQL.

Here is a related a link to a similar question at phpbuilder:
http://www.phpbuilder.com/mail/php-db/2001062/0055.php

Snijders, Mark wrote:
$start = 10;

$numbers_to_show = 25;

$sql = "SELECT * FROM bla Limit $start, $numbers_to_show";

or just go to mysql.com and use the manual :)

-Original Message-
From: Noam Giladi [mailto:[EMAIL PROTECTED]]
Sent: woensdag 19 februari 2003 16:00
To: [EMAIL PROTECTED]
Subject: [PHP-DB] "LIMIT" problem MSSQL


I'm trying to split results into different pages and number the pages
accordingly.  I've been able to build a fairly intelligent page numbering
system which knows which rows it should pull (at least by numbering each row
numerically) but I don't know how to construct a SQL query to pull 10
results starting at a certain number.

please  did anyone wrote a proc that do it?.






--
John Krewson
Programmer - SWORPS


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




RE: [PHP-DB] "LIMIT" problem MSSQL

2003-02-19 Thread Snijders, Mark
$start = 10;

$numbers_to_show = 25;

$sql = "SELECT * FROM bla Limit $start, $numbers_to_show";

or just go to mysql.com and use the manual :)

-Original Message-
From: Noam Giladi [mailto:[EMAIL PROTECTED]]
Sent: woensdag 19 februari 2003 16:00
To: [EMAIL PROTECTED]
Subject: [PHP-DB] "LIMIT" problem MSSQL


I'm trying to split results into different pages and number the pages
accordingly.  I've been able to build a fairly intelligent page numbering
system which knows which rows it should pull (at least by numbering each row
numerically) but I don't know how to construct a SQL query to pull 10
results starting at a certain number.

please  did anyone wrote a proc that do it?.




-- 
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] "LIMIT" problem MSSQL

2003-02-19 Thread Noam Giladi
I'm trying to split results into different pages and number the pages
accordingly.  I've been able to build a fairly intelligent page numbering
system which knows which rows it should pull (at least by numbering each row
numerically) but I don't know how to construct a SQL query to pull 10
results starting at a certain number.

please  did anyone wrote a proc that do it?.




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




RE: [PHP-DB] multiple checkbox selection for search form

2003-02-19 Thread John W. Holmes
> I need some assistance here...
> I am toying with a search form that will allow the user to select 3
> options from a set of checkboxes to search by (eg.)
> 
> [[ Select any 3 type ]]
> 
> [ ] option1   [ ] option2   [ ] option3
> [ ] option4   [ ] option5   [ ] option6
> [ ] option7   [ ] option8   [ ] option9
> 
> what I would like to do is to allow then to select only 3 options
> then search the database for the 3 options selected.

Name all of your checkboxes the same, with an [] on it. 

 Option1
 Option2
etc...

Then, you'll have a $_POST['option'] array (or $_GET) when your form is
submitted. 

if(isset($_POST['option']) && count($_POST['option']) <= 3)
{ //perform your search }
else
{ echo "You must select between 1 and 3 options."; }

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP-DB] Pear with PHP

2003-02-19 Thread Clarkson, Nick


Sorry, should have been more specific with my last reply;

Base PEAR package -> http://pear.php.net/package-info.php?pacid=14
Additional packages -> http://pear.php.net/packages.php

Sorry about that.

Nick


-Original Message-
From: Neil [mailto:[EMAIL PROTECTED]]
Sent: 19 February 2003 11:09
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Pear with PHP


Hi,

How do you install pear db to work with PHP. having a problem with certain
applications needing pear. How and where do I get the program and
installation instructions.

Thank you all
Neil


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




RE: [PHP-DB] Pear with PHP

2003-02-19 Thread Clarkson, Nick


Start here -> http://pear.php.net/packages.php. I'm only just looking at it
myself, but the docs are on there too.

Good luck

Nick

-Original Message-
From: Neil [mailto:[EMAIL PROTECTED]]
Sent: 19 February 2003 11:09
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Pear with PHP


Hi,

How do you install pear db to work with PHP. having a problem with certain
applications needing pear. How and where do I get the program and
installation instructions.

Thank you all
Neil


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




[PHP-DB] Pear with PHP

2003-02-19 Thread Neil
Hi,

How do you install pear db to work with PHP. having a problem with certain 
applications needing pear. How and where do I get the program and installation 
instructions.

Thank you all
Neil


[PHP-DB] mysql_fetch_array and extract() with LEFT SELECT

2003-02-19 Thread Baumgartner Jeffrey
I'm having a problem when I use mysql_fetch_array and extract() following a
left select query. As an example...

$query = "SELECT id,LEFT(fluff,80) FROM sometable";
$result = mysql_query($query) or die('message');

while ($row = mysql_fetch_array($result){
extract($row);
echo "" . $id . ": " . $fluff . "";
}

would echo the $id, but there would be nothing for $fluff. However, if I
select only 'fluff' from the MySQL table, I get the full text for $fluff. I
am reluctant to SELECT the entire fluff text from the table and shorten it
in PHP  as that seems inefficient to me - (but correct me if I am wrong).

I expect the solution must be dead easy, but I can't find it or figure it
out.

Many thanks,

Jeffrey

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




Re: [PHP-DB] php & date manupulation functions

2003-02-19 Thread leo g. divinagracia iii
Rajesh Fowkar wrote:


Hello,

There seems to be very few date manupulation functions in php.

In my php form I am displaying select combos for day, month and year.

Now while updating the form I want to retrieve the date and take out day,
month and year from that date and display the correct selection in the
combo. I could not find any function like say

day($dbdate);
month($dbdate);
year($dbdate);

Am I missing something ? Is there anyway to accomplish the above ? or I
will have to store these three values separatly in the database rather than
as a date.

 


yes, you are missing it.  

you need to do the opposite.  first read this:

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

and everything will become clear...

btw, if the current date is jan 1, 2000, then

$day =  date ("d");
$month =  date ("m");
$year = "date ("y");

echo $day;  //  would return "01"
echo $month;  //  would return "01"
echo 4year;  //would return "00"

--
Leo G. Divinagracia III
[EMAIL PROTECTED]



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



Re: [PHP-DB] How to produce the report using PHP?

2003-02-19 Thread leo g. divinagracia iii
Rokasa wrote:


Hi there,

I want to produce the report using the PHP but I don't know the PHP command.
Or is it any third party software that can be called by PHP to produce the
report?  Is it anybody out there can help me.

 


gotta do it the old fashion way, by writing it yourself...

or you can ODBC it, and use ms access and it's report writer.

--
Leo G. Divinagracia III
[EMAIL PROTECTED]



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




Re: [PHP-DB] problem in PHP with ADODB connection, Microsoft JET

2003-02-19 Thread Ruprecht Helms
Hi  Jason Wong,

>> --
>> Warning: Invoke() failed: Exception occurred. Source: Microsoft JET
>> Database Engine Description: Syntax error in FROM clause.
>> -
> 
> The error is quite explicit:  "Syntax error in FROM clause"

please post the actual sql-query for correction. 

Regards,
Ruprecht

--
Ruprecht Helms IT-Service und Softwareentwicklung

Tel/Fax.:  +49[0]7621 16 99 16
Homepage:  http://www.rheyn.de
email:  [EMAIL PROTECTED]
--

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




Re: [PHP-DB] Storing images in MySQL table

2003-02-19 Thread Corne' Cornelius
Milan,

The only disadvantage i've had of storing images in DB instead of 
Filesystem, is that when you use a PHP script to output the image to a 
client browser, MSIE doesn't always accept a suggested filename so it 
might try and save it as "your-script.php?img=2".

Other then that, keeping images in DB is a lot easier since you don't 
have to keep your DB in sync with Filesystems ie. Deleted records in DB, 
but images still exist.


[EMAIL PROTECTED] wrote:

Hi everybody,
	i want to store some articles and images to them in MySQL 
db. could you just give advice if it is better to store the image in BLOB 
or if to save on server and in db just have it's URL.


			Hi Milan


 





=Disclaimer and Confidentiality===
This message contains information intended for the perusal, and/or use (if so stated), by the stated addressee(s) only. The information is confidential and privileged. If you are not an intended recipient, do not peruse, use, disseminate, distribute, copy or in any manner rely upon  he information contained in this message (directly or indirectly). The sender and/or the entity represented by the sender shall not be held accountable in the event that this prohibition is disregarded. If you receive this message in error, notify the sender immediately by e-mail, fax or telephone representations contained in this message, whether express or implied, are those of the sender only, unless that sender expressly states them to be the views or representations of an entity or person, who shall be named by the sender and who the sender shall state to represent. No liability shall otherwise attach to any other entity or person. ==


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




[PHP-DB] sorting a multimensional array

2003-02-19 Thread Snijders, Mark
hello,

i've got the next array:

Array
(
[testsubnet] => Array
(
[2690910720] => 255.255.255.0
)

[GLN-subnetsirangevoorgedelegeerddomein] => Array
(
[2886735616] => 255.255.255.0
)

[testsubnet2] => Array
(
[1209360384] => 255.255.224.0
)

[lpd (tpg-nl1)] => Array
(
[175964160] => 255.255.0.0
)
}

I need to sort it by name or by the big nummer between []

to sort it by name i do this:

ksort($ARRAYNAME);

and it works fine, but how do I sort by the big number between []  ...

I really don't get it...

thanks for the help..

Mark,



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




[PHP-DB] Storing images in MySQL table

2003-02-19 Thread ReznicekM
Hi everybody,
i want to store some articles and images to them in MySQL 
db. could you just give advice if it is better to store the image in BLOB 
or if to save on server and in db just have it's URL.


Hi Milan


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




Re: [PHP-DB] Submitted information not being displayed

2003-02-19 Thread Jason Wong
On Tuesday 18 February 2003 20:35, Bruce Sommer wrote:
> I'm attempting to takke information submitted from a web page through a
> POST action, insert it into a MySQL database and upon success display the
> information in a table for the submitter to see.  For some reason empty
> fields are inserted into the database and the data doesn't show up in the
> resulting table - just the headers.  The fields of type timestamp come up
> all "0".

Apply some basic debugging techniques ...

> I'm running PHP v.4.1.2 and MySQL v.3.23.52 on my server.
>
> The form action and subscribe.php follows:
>
> 

>
> 
> 
> Processing Subscription Information
> 
> 
>
>  /* This page receives and handles the data generated by "index.html". */
> // Trim the incoming data.
> $Array["FirstName"] = trim ($Array["FirstName"]);
> $Array["LastName"] = trim ($Array["LastName"]);
> $Array["id_num"] = trim ($Array["id_num"]);
> $Array["Email"] = trim ($Array["Email"]);

Use
 print_r($_POST)

to show all the values POSTed from your form.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
You are deeply attached to your friends and acquaintances.
*/


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




Re: [PHP-DB] problem in PHP with ADODB connection, Microsoft JET Database

2003-02-19 Thread Jason Wong
On Wednesday 19 February 2003 10:09, pei_world wrote:
> when I try to connection to the access file using Microsoft Jet Engine. it
> come up with following error!

>   $result = $conn->Execute($query)  I check the table is exists,and the query should be correct.

*should* be correct or IS correct? There's quite a difference.

> --
> Warning: Invoke() failed: Exception occurred. Source: Microsoft JET
> Database Engine Description: Syntax error in FROM clause.
> -

The error is quite explicit:  "Syntax error in FROM clause"

So unless the Jet Engine is lying or is buggy then you have an incorrectly 
formed query.

> can anyone help me?

Nobody can help you unless you post your query.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
When it is not necessary to make a decision, it is necessary not to
make a decision.
*/


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