[PHP-DB] Linux+php+remote MS SQL

2002-12-12 Thread Ruth Zhai
Hi Everyone,
I have spent a few hours searching on the internet, but still can not get the 
information I need.  So I turn to you for help.

I will be doing a web site which has a lot of data from a remote mssql server.  The 
scripts will be in php and run on Linux.  As requirements, the mssql will stay at the 
client's internal network, and linux server will be right here with me.  For your 
information, we are considering using broad band connection for the web server 
although this has not been finalized.  The web site will initially have 3000 clients, 
and the db will be updated on daily basis.  For me, this is challenge because this is 
the first time for me to use remote db server, first time to use mssql server and 
first time to use combination of open source and MS products.  Forgive me if I don't 
ask proper questions.  The followings are my questions:

1. Will this combination cause a lot of problems?  Will it be stable enough?
2. Because the db server is not connected to the internet, I am not sure what options 
I have in terms of connection to the db.  Would some one point me a direction or 
tutorial about this?
3. Will remote access slow down the application a lot?
3. PHP has functions for mssql.  Does any one know how those compare with ODBC?

I would appreciate if you could share your experience with me or give me your opinion 
on the above issues.

Thank you very much in advance.

Ruth



[PHP-DB] HELP!! Warning: mysql_pconnect:

2002-12-12 Thread Don Briggs
While viewing web pages, we sometimes get the following error: "Warning:
mysql_pconnect: Link to server lost, unable to reconnect in
/home/dratner/includes/common.inc on line 26 ". The offending line is this
code:
 if (!$db = mysql_pconnect("db1", "diadba",
"c0s3mST"));

This line is in our common include file. It is supposed to create a
connection to the database and return an error if the connection fails. It
usually works, but sometimes we get the above error. Refreshing the page
makes the error go away, but that is not a very good solution, and we need
to figure it out before we lauch our site.

Configuration:

We are running 4.3.0RC2 and MySQL 3.23.53A on Linux 8.0. Our PHP server is
connected directly to the MySQL server via a cross-connect cable. So these
two machines have a private 100Mb connection used exclusivly for database
communication. We are currently developing an auction.

Since we are currently in development there are only two or three people
accessing the site. We are worried that the problem will get worse when the
we launch our application and we have a real work load on the server.
I would greatly appreciate any help that anyone could offer. I just can't
figure out why we sometimes have trouble connecting, especially with the
load on two large servers being so tiny.

Don! Briggs

[EMAIL PROTECTED]



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




[PHP-DB] query results page ignores style sheet reference

2002-12-12 Thread chip . wiegand
I have a site I have to convert to frames (*ugh*) (so I'm using php frames,
better
than html frames anyway) and came up with a little problem.
On one page is a list of states, click on the state name and get a list of
dealers in
that state. This works. What doesn't work is the list of dealers page
ignores the
style sheet somewhat, so the original page looks great, the results page
doesn't.
What's happening is the original page has certain font sizes dictated by
the style
sheet, but the results page uses the browsers defaults for the fonts. Other
style
sheet attributes are obeyed by the results page. This is quite strange.
Anyone
seen this behavior before?

--
Chip Wiegand
Computer Services
Simrad, Inc
www.simradusa.com
[EMAIL PROTECTED]

"There is no reason anyone would want a computer in their home."
 --Ken Olson, president, chairman and founder of Digital Equipment
Corporation, 1977
 (They why do I have 8? Somebody help me!)



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




[PHP-DB] Re: Newbie - Is this possible with mysql? can i fake it in php?

2002-12-12 Thread Max Clark
Help-

When I run the following code instead of getting the correct result,
"Resourse id #5" is displayed. If I run the printed query from the mysql
console the output is correct.

What am I doing wrong?

Thanks in advance,
Max

$sql = "select a.domain, a.transport from transport as a, acl as b
where a.id=b.transportId and b.adminId='$userid'";

$result = mysql_query($sql,$db);

while ($row = mysql_fetch_array($result)) {
$domain = $row["domain"];
$query = "select sum(a.recipient_size) from recipientstats
as a where a.recipient_email like '%$domain'";
$size = mysql_query($query,$db) or die("query: " .
mysql_error());
print "$query - $size";
printf ("%s%sview stats%s",
$row["domain"],
$row["transport"], $row["domain"], $size);
}

mysql_free_result($result);


"Max Clark" <[EMAIL PROTECTED]> wrote in message
atb0h0$c49$[EMAIL PROTECTED]">news:atb0h0$c49$[EMAIL PROTECTED]...
> I've been reading various posts in the mysql mailing list that basically
say
> that this functionality (unions, subselects) does not exit within mysql
yet
> (I am just learning php/databases).
>
> Is there a way I can run this query in mysql? If not can I fake it out
with
> php? What would the best way to do that be?
>
> Thanks in advance,
> Max
>
> "Max Clark" <[EMAIL PROTECTED]> wrote in message news:...
> > So I am trying to accomplish something like this:
> >
> > select a.domain, a.transport, sum(c.recipient_count)
sum(c.recipient_size)
> > from transport as a, acl as b, recipientstats as c where
> a.id=b.transportId
> > and b.adminId='1' and c.recipient_email like '%a.domain';
> >
> > But I know I am missing something because of the error.
> >
> > Can anyone point me in the right direction?
> >
> > Thanks in advance,
> > Max
> >
> > "Max Clark" <[EMAIL PROTECTED]> wrote in message
> > news:ataq2r$ev1$[EMAIL PROTECTED]...
> > > Hi-
> > >
> > > I am trying to write a sql query that will output (domain, transport,
> > > sum(count), sum(size)) from multiple tables for many records.
> > >
> > > When the domain field is dynamic based on the adminId passed to the
> query,
> > > how do I execute the second query at the same time?
> > >
> > > Thanks in advance,
> > > Max
> > >
> > > select a.domain, a.transport from transport as a, acl as b where
> > > a.id=b.transportId and b.adminId='1';
> > > select sum(count), sum(size) from stats where email like '%a.domain';
> > >
> > >
> > >
> > >
> > >
> > >
> > > -
> > > Before posting, please check:
> > >http://www.mysql.com/manual.php   (the manual)
> > >http://lists.mysql.com/   (the list archive)
> > >
> > > To request this thread, e-mail <[EMAIL PROTECTED]>
> > > To unsubscribe, e-mail
> > <[EMAIL PROTECTED]>
> > > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> > >
> > >
> >
> >
>
>
>
>
>
> --
> 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] Newbie - Is this possible with mysql? can i fake it in php?

2002-12-12 Thread Max Clark
I've been reading various posts in the mysql mailing list that basically say
that this functionality (unions, subselects) does not exit within mysql yet
(I am just learning php/databases).

Is there a way I can run this query in mysql? If not can I fake it out with
php? What would the best way to do that be?

Thanks in advance,
Max

"Max Clark" <[EMAIL PROTECTED]> wrote in message news:...
> So I am trying to accomplish something like this:
>
> select a.domain, a.transport, sum(c.recipient_count) sum(c.recipient_size)
> from transport as a, acl as b, recipientstats as c where
a.id=b.transportId
> and b.adminId='1' and c.recipient_email like '%a.domain';
>
> But I know I am missing something because of the error.
>
> Can anyone point me in the right direction?
>
> Thanks in advance,
> Max
>
> "Max Clark" <[EMAIL PROTECTED]> wrote in message
> news:ataq2r$ev1$[EMAIL PROTECTED]...
> > Hi-
> >
> > I am trying to write a sql query that will output (domain, transport,
> > sum(count), sum(size)) from multiple tables for many records.
> >
> > When the domain field is dynamic based on the adminId passed to the
query,
> > how do I execute the second query at the same time?
> >
> > Thanks in advance,
> > Max
> >
> > select a.domain, a.transport from transport as a, acl as b where
> > a.id=b.transportId and b.adminId='1';
> > select sum(count), sum(size) from stats where email like '%a.domain';
> >
> >
> >
> >
> >
> >
> > -
> > Before posting, please check:
> >http://www.mysql.com/manual.php   (the manual)
> >http://lists.mysql.com/   (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
> >
>
>





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




FW: [PHP-DB] A help on relational databases using php

2002-12-12 Thread Ryan Jameson (USA)
Phanivas Vemuri said:
---
I have two tables.
1.ProgramClips ( id, progSummary, category, videoFile)PRIMkey = id.
and each id may have 2 or three categories.

2.Category( number,category).
categories are :
Beef , diary, horticulture etc;

I am using PhpMyAdmin as the interface for the mySql Database.
The PhpMyAdmin creates a text filed to show the values of the category.

Where as I want to replace the text field to put a  drop dwon list which can 
select multiple categories.
There is no relation between the two tables.
PLease mail me .. if u dont understand the question. I wiill explain it more 
clearly as it is verry importnat for me to solve it.
Phani.




>From: "Ryan Jameson (USA)" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: RE: [PHP-DB] A help on relational databases using php
>Date: Thu, 12 Dec 2002 13:29:25 -0700
>
>Ok, you've come to the right place, so what exactly is the question?
>
><>< Ryan
>
>-Original Message-
>From: Phanivas Vemuri [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, December 12, 2002 1:26 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP-DB] A help on relational databases using php
>
>
>hi all,
>i need some help regarding soem one who had worked on relational databases
>suing php as the interface.
>Phani.
>
>_
>MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
>http://join.msn.com/?page=features/virus
>
>
>--
>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


_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus


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




RE: [PHP-DB] A help on relational databases using php

2002-12-12 Thread Ryan Jameson (USA)
Ok, you've come to the right place, so what exactly is the question?

<>< Ryan

-Original Message-
From: Phanivas Vemuri [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 12, 2002 1:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] A help on relational databases using php


hi all,
i need some help regarding soem one who had worked on relational databases 
suing php as the interface.
Phani.

_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus


-- 
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] A help on relational databases using php

2002-12-12 Thread Phanivas Vemuri
hi all,
i need some help regarding soem one who had worked on relational databases 
suing php as the interface.
Phani.

_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus


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



[PHP-DB] Help on MySql Relational Tables

2002-12-12 Thread Phanivas Vemuri
hi all,
I have two tables.
1.ProgramClips ( id, progSummary, category, videoFile)PRIMkey = id.
and each id may have 2 or three categories.

2.Category( number,category).
categories are :
Beef , diary, horticulture etc;

I am using PhpMyAdmin as the interface for the mySql Database.
The PhpMyAdmin creates a text filed to show the values of the category.

Where as I want to replace the text field to put a  drop dwon list which can 
select multiple categories.
There is no relation between the two tables.
Can any one help me how to do that.



_
The new MSN 8: advanced junk mail protection and 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



Re: [PHP-DB] newbie - last_insert_id() with mysql

2002-12-12 Thread 1LT John W. Holmes
> mysql_insert_id() is a PHP function, not a MYSQL function.  You are also
> missing a close quote on your insert string.  So you have to do it like
> this:

Correct, but LAST_INSERT_ID() is a MySQL function which is what he's
using...

> $sql2 = "insert into acl (adminId,transportId,securityId) values
('$userid',".last_insert_id().",'1')";

So, no, you're trying to use a MySQL function here in PHP code. The original
syntax was correct.

> $lastid = mysql_insert_id();
> $sql2 = "insert into acl (adminId,transportId,securityId) values
('$userid',".$lastid.",'1')";
>
> which is the same as:
>
> $lastid = mysql_insert_id();
> $sql2 = "insert into acl (adminId,transportId,securityId) values
('$userid',$lastid,'1')";

Both of those are correct, too, if you want to use the PHP function.

> > $sql1 = "insert into transport (domain,transport) values
> > ('$domain','$transport')";
> > $sql2 = "insert into acl (adminId,transportId,securityId) values
> > ('$userid',last_insert_id(),'1'";
> >
> > mysql_query($sql1);
> > mysql_query($sql2);

You're missing a closing paranthesis on the end of the second SQL statement.
That is probably what's causing your error. In the future, use mysql_error()
to find out why it's failing...

mysql_query($query) or die("Error in $query: " . mysql_error());

---John Holmes...


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




Re: [PHP-DB] limiting field extraction to 40 characters

2002-12-12 Thread Peter Beckman
$1 is a bad variable.  You can't have variables that start with a number.

Try $a or $foo or $bar.

On Thu, 12 Dec 2002, mike karthauser wrote:

> If i try the below in my query i get no results.
>
> Ideally i would like to do this (not valid sql)
>
>  printf("\n");
> while ($myrow = mysql_fetch_array($result)) {
>
> $l=$myrow['coursecode'];
> ?> selected="selected"':"";?>> }
> printf("\n");
> ?>
>
>
> on 11/12/02 5:26 pm, Peter Beckman at [EMAIL PROTECTED] wrote:
>
> > LEFT(str,len)
> > Returns the leftmost len characters from the string str:
> >
> > mysql> SELECT LEFT('foobarbar', 5);
> > -> 'fooba'
> >
> > This function is multi-byte safe.
> >
> >
> > select left(coursecode,40) from courses
>
>
>
> > On Wed, 11 Dec 2002, mike karthauser wrote:
> >
> >> I am using
> >>
> >>  >> printf("\n");
> >> while ($myrow = mysql_fetch_array($result)) {
> >>
> >> $l=$myrow['coursecode'];
> >> ?> >> selected="selected"':"";?>> >> }
> >> printf("\n");
> >> ?>
> >>
> >> to generate a html . Unfortunately a few of my course titles
> >> are really long and this effects the rendering of the 
> >> making it ultra wide.
> >>
> >> Is there a way i can print only the first 40 characters of the title - even
> >> though the full title lives in the db still (it is used throughout the
> >> site)?
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

---
Peter Beckman  Internet Guy
[EMAIL PROTECTED] http://www.purplecow.com/
---

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




Re: [PHP-DB] newbie - last_insert_id() with mysql

2002-12-12 Thread Peter Beckman
mysql_insert_id() is a PHP function, not a MYSQL function.  You are also
missing a close quote on your insert string.  So you have to do it like
this:

$sql2 = "insert into acl (adminId,transportId,securityId) values 
('$userid',".last_insert_id().",'1')";

Notice the "string".function()."string" -- this basically puts the return
value of the function (in this case, the last ID inserted) into the string.
If it was a MySQL function, you'd have done it correctly; however
mysql_insert_id() is a PHP function and thus you must have PHP run the
function ouside of the string instead of passing the function as part of
the string.

The above is the same as doing this:

$lastid = mysql_insert_id();
$sql2 = "insert into acl (adminId,transportId,securityId) values 
('$userid',".$lastid.",'1')";

which is the same as:

$lastid = mysql_insert_id();
$sql2 = "insert into acl (adminId,transportId,securityId) values 
('$userid',$lastid,'1')";

But use the first example I gave you.

Peter

On Thu, 12 Dec 2002, Max Clark wrote:

> Hi-
>
> I am trying to insert information into mysql based with the sql queries
> below. When I run this insert from the mysql console everything works
> correct, however, when I run this through php the second sql query doesn't
> execute (I'm assuming there is a problem with the last_insert_id()).
>
> I have tried changing the "last_insert_id()" to a "mysql_insert_id()"
> function with no success?
>
> How do I get this to work?
> Thanks in advance,
> Max
>
> $sql1 = "insert into transport (domain,transport) values
> ('$domain','$transport')";
> $sql2 = "insert into acl (adminId,transportId,securityId) values
> ('$userid',last_insert_id(),'1'";
>
> mysql_query($sql1);
> mysql_query($sql2);
>
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

---
Peter Beckman  Internet Guy
[EMAIL PROTECTED] http://www.purplecow.com/
---

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




[PHP-DB] newbie - last_insert_id() with mysql

2002-12-12 Thread Max Clark
Hi-

I am trying to insert information into mysql based with the sql queries
below. When I run this insert from the mysql console everything works
correct, however, when I run this through php the second sql query doesn't
execute (I'm assuming there is a problem with the last_insert_id()).

I have tried changing the "last_insert_id()" to a "mysql_insert_id()"
function with no success?

How do I get this to work?
Thanks in advance,
Max

$sql1 = "insert into transport (domain,transport) values
('$domain','$transport')";
$sql2 = "insert into acl (adminId,transportId,securityId) values
('$userid',last_insert_id(),'1'";

mysql_query($sql1);
mysql_query($sql2);





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




RE: [PHP-DB] copying data

2002-12-12 Thread SELPH,JASON (HP-Richardson,ex1)
yes, if your server is windows based.

Create a odbc system dsn to the access file on your server, then connect to
that dsn.  You can then pull data from it, connect to mysql and insert the
data.

If I remember correctly, you had wanted your users to upload the mdb file
for you to extract the data.  This may be tricky as I am not sure if you can
bait and switch the file from under the odbc connections nose.

Cheers
Jason


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 12, 2002 10:33 AM
To: PHP-DB
Subject: [PHP-DB] copying data


I asked a question sort of alone these lines the other day so please forgive
me if it sounds familiar...

If I have a microsoft access file .mdb on my server, can I use  a php page
to move the data from the file to a mysql db?

Thanks,
Eddie


-- 
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] copying data

2002-12-12 Thread Edward Peloke
I asked a question sort of alone these lines the other day so please forgive
me if it sounds familiar...

If I have a microsoft access file .mdb on my server, can I use  a php page
to move the data from the file to a mysql db?

Thanks,
Eddie


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




Re: [PHP-DB] Formatting txt from a database

2002-12-12 Thread Matt Vos
$select="select fields from table...";
$sres=mysql_query($select);
echo mysql_error();
while ($srow=mysql_fetch_row($sres))
{
$string=$srow[0];
$no_html=strip_tags($string);
if (strlen($no_html) > 30) $no_html=substr($no_html,0,30)."...";
echo("$no_html");
}

Matt
- Original Message -
From: Lisi <[EMAIL PROTECTED]>
To: PHP-DB <[EMAIL PROTECTED]>
Sent: Thursday, December 12, 2002 3:55 AM
Subject: [PHP-DB] Formatting txt from a database


> I am retrieving text stored in a database, and I want to strip out any
HTML
> tags and then only display the first 30 characters with "..." to show the
> user that there is more text to view.
>
> My problem is with stripping out HTML tags, the code is stripping out the
> text enclosed within the HTML tags as well.
>
> Here is the code I am using:
>
> $pat = "<{1}.+>{1}";
>
> if (ereg("text", $type)){  //if the field type is text look for HTML
> tags to remove
>$content_array[$c] = ereg_replace($pat, '', $content_array[$c]);
>$content_array[$c] = substr($content_array[$c], 1, 30);
>$content_array[$c] = $content_array[$c]."...";
> }
>
> echo $content_array[$c];
>
>
> What should the correct $pat be?
>
> Thanks,
>
> -Lisi
>
>
> --
> 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] Re: flytte bsd harddisk til anden pc

2002-12-12 Thread Snijders, Mark
oh :)

i never check those extensions... to busy for... and also tired from the
overload of boost (do programmers drink to much?? :--))

___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]]
Sent: donderdag 12 december 2002 14:39
To: Snijders, Mark; 'Radovan Radic'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: flytte bsd harddisk til anden pc


I'm pretty sure the .dk on the end of his e-mail address means Denmark. Glad
you guys were confused too. I was afraid that last shot of Tequila at the
bar last night really screwed me up.

> -Original Message-
> From: Snijders, Mark [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 12, 2002 8:31 AM
> To: 'Radovan Radic'; [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] Re: flytte bsd harddisk til anden pc
> 
> 
> it's swedish or something..
> 
> i don't get it and i'm dutch
> 
> if the person understands knulla then he's swedish :)
> 
> ___ 
> 
> Mark Snijders, Developer 
> Atos Origin 
> Groenewoudeseweg 1, Room VN-515 
> 5621 BA  Eindhoven, The Netherlands 
> *   : [EMAIL PROTECTED] 
> *:+31 (0)40 - 2785992 (tel) 
> * : +31 (0)40 - 2788729 (fax) 
> 
> The information in this mail is intended only for use of the 
> individual or
> entity to which it is addressed and may contain information that is
> privileged, confidential and exempt from disclosure under 
> applicable law.
> Access to this mail by anyone else than the addressee is 
> unauthorized. If
> you are not the intended recipient, any disclosure, copying, 
> distribution or
> any action taken omitted to be taken in reliance of it, is 
> prohibited and
> may be unlawful.
> 
> 
> 
> -Original Message-
> From: Radovan Radic [mailto:[EMAIL PROTECTED]]
> Sent: donderdag 12 december 2002 14:30
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Re: flytte bsd harddisk til anden pc
> 
> 
> Dutch, swedish...?
> 
> "Martin Allan Jensen" <[EMAIL PROTECTED]> wrote in message
> 002501c2a1e2$092e8640$020a@asus">news:002501c2a1e2$092e8640$020a@asus...
> Hej Allesammen, har et strt problem, jeg skal IDAG skifte 
> server, men kan
> jeg bare tage mine harddiske med FreeBSD på og smide over i 
> den nye maskine
> og så vil det køre eller 
> 
> 
> 
> -- 
> 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Re: flytte bsd harddisk til anden pc

2002-12-12 Thread Hutchins, Richard
I'm pretty sure the .dk on the end of his e-mail address means Denmark. Glad
you guys were confused too. I was afraid that last shot of Tequila at the
bar last night really screwed me up.

> -Original Message-
> From: Snijders, Mark [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 12, 2002 8:31 AM
> To: 'Radovan Radic'; [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] Re: flytte bsd harddisk til anden pc
> 
> 
> it's swedish or something..
> 
> i don't get it and i'm dutch
> 
> if the person understands knulla then he's swedish :)
> 
> ___ 
> 
> Mark Snijders, Developer 
> Atos Origin 
> Groenewoudeseweg 1, Room VN-515 
> 5621 BA  Eindhoven, The Netherlands 
> *   : [EMAIL PROTECTED] 
> *:+31 (0)40 - 2785992 (tel) 
> * : +31 (0)40 - 2788729 (fax) 
> 
> The information in this mail is intended only for use of the 
> individual or
> entity to which it is addressed and may contain information that is
> privileged, confidential and exempt from disclosure under 
> applicable law.
> Access to this mail by anyone else than the addressee is 
> unauthorized. If
> you are not the intended recipient, any disclosure, copying, 
> distribution or
> any action taken omitted to be taken in reliance of it, is 
> prohibited and
> may be unlawful.
> 
> 
> 
> -Original Message-
> From: Radovan Radic [mailto:[EMAIL PROTECTED]]
> Sent: donderdag 12 december 2002 14:30
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Re: flytte bsd harddisk til anden pc
> 
> 
> Dutch, swedish...?
> 
> "Martin Allan Jensen" <[EMAIL PROTECTED]> wrote in message
> 002501c2a1e2$092e8640$020a@asus">news:002501c2a1e2$092e8640$020a@asus...
> Hej Allesammen, har et strt problem, jeg skal IDAG skifte 
> server, men kan
> jeg bare tage mine harddiske med FreeBSD på og smide over i 
> den nye maskine
> og så vil det køre eller 
> 
> 
> 
> -- 
> 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] flytte bsd harddisk til anden pc

2002-12-12 Thread Ignatius Reilly
なるほど.
私も,そう言う問題に会った.

Ignatius

- Original Message -
From: "Martin Allan Jensen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 12, 2002 2:26 PM
Subject: [PHP-DB] flytte bsd harddisk til anden pc


Hej Allesammen, har et strt problem, jeg skal IDAG skifte server, men kan
jeg bare tage mine harddiske med FreeBSD på og smide over i den nye maskine
og så vil det køre eller 


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




RE: [PHP-DB] Re: flytte bsd harddisk til anden pc

2002-12-12 Thread Snijders, Mark
it's swedish or something..

i don't get it and i'm dutch

if the person understands knulla then he's swedish :)

___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: Radovan Radic [mailto:[EMAIL PROTECTED]]
Sent: donderdag 12 december 2002 14:30
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: flytte bsd harddisk til anden pc


Dutch, swedish...?

"Martin Allan Jensen" <[EMAIL PROTECTED]> wrote in message
002501c2a1e2$092e8640$020a@asus">news:002501c2a1e2$092e8640$020a@asus...
Hej Allesammen, har et strt problem, jeg skal IDAG skifte server, men kan
jeg bare tage mine harddiske med FreeBSD på og smide over i den nye maskine
og så vil det køre eller 



-- 
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] IBM odbc for linux

2002-12-12 Thread chris dolese
Please help. I have a basic scipt:

$connection_id=odbc_connect("$DSN","$user","$pass");
$sql="select * from whatever";
$stmt=odbc_prepare($connection_id,$sql);
$result=odbc_execute($connection_id,$stmt);

this script used to work on RH-7.3 with php-4.1.2
the script will not work anymore when i installed RH-8 using php-4.2.2
the connection IS successful, but when i try anything after that i get this
error:

Warning: SQL error: [unixODBC][IBM][iSeries Access ODBC Driver]Error in host
server data stream., SQL state S1000 in SQLPrepare

i can connect,prepare and execute statements from c++ so it must be php
specific?
please help!!



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




[PHP-DB] Re: flytte bsd harddisk til anden pc

2002-12-12 Thread Radovan Radic
Dutch, swedish...?

"Martin Allan Jensen" <[EMAIL PROTECTED]> wrote in message
002501c2a1e2$092e8640$020a@asus">news:002501c2a1e2$092e8640$020a@asus...
Hej Allesammen, har et strt problem, jeg skal IDAG skifte server, men kan
jeg bare tage mine harddiske med FreeBSD på og smide over i den nye maskine
og så vil det køre eller 



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




[PHP-DB] flytte bsd harddisk til anden pc

2002-12-12 Thread Martin Allan Jensen
Hej Allesammen, har et strt problem, jeg skal IDAG skifte server, men kan jeg bare 
tage mine harddiske med FreeBSD på og smide over i den nye maskine og så vil det køre 
eller 


Re: [PHP-DB] Formatting txt from a database

2002-12-12 Thread DL Neil
Lisi,
To save reinventing the wheel would strip_tags() be any use to you? (see
manual)
=dn


> I am retrieving text stored in a database, and I want to strip out any
HTML
> tags and then only display the first 30 characters with "..." to show the
> user that there is more text to view.
>
> My problem is with stripping out HTML tags, the code is stripping out the
> text enclosed within the HTML tags as well.
>
> Here is the code I am using:
>
> $pat = "<{1}.+>{1}";
>
> if (ereg("text", $type)){  //if the field type is text look for HTML
> tags to remove
>$content_array[$c] = ereg_replace($pat, '', $content_array[$c]);
>$content_array[$c] = substr($content_array[$c], 1, 30);
>$content_array[$c] = $content_array[$c]."...";
> }
>
> echo $content_array[$c];
>
>
> What should the correct $pat be?
>
> Thanks,
>
> -Lisi
>
>
> --
> 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] limiting field extraction to 40 characters

2002-12-12 Thread mike karthauser
If i try the below in my query i get no results.

Ideally i would like to do this (not valid sql)

\n");
while ($myrow = mysql_fetch_array($result)) {

$l=$myrow['coursecode'];
?>>\n");
?>


on 11/12/02 5:26 pm, Peter Beckman at [EMAIL PROTECTED] wrote:

> LEFT(str,len)
> Returns the leftmost len characters from the string str:
> 
> mysql> SELECT LEFT('foobarbar', 5);
> -> 'fooba'
> 
> This function is multi-byte safe.
> 
> 
> select left(coursecode,40) from courses



> On Wed, 11 Dec 2002, mike karthauser wrote:
> 
>> I am using
>> 
>> > printf("\n");
>> while ($myrow = mysql_fetch_array($result)) {
>> 
>> $l=$myrow['coursecode'];
>> ?>> selected="selected"':"";?>>> }
>> printf("\n");
>> ?>
>> 
>> to generate a html . Unfortunately a few of my course titles
>> are really long and this effects the rendering of the 
>> making it ultra wide.
>> 
>> Is there a way i can print only the first 40 characters of the title - even
>> though the full title lives in the db still (it is used throughout the
>> site)?


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




[PHP-DB] Formatting txt from a database

2002-12-12 Thread Lisi
I am retrieving text stored in a database, and I want to strip out any HTML 
tags and then only display the first 30 characters with "..." to show the 
user that there is more text to view.

My problem is with stripping out HTML tags, the code is stripping out the 
text enclosed within the HTML tags as well.

Here is the code I am using:

	$pat = "<{1}.+>{1}";

	if (ereg("text", $type)){  			//if the field type is text look for HTML 
tags to remove
	   $content_array[$c] = ereg_replace($pat, '', $content_array[$c]);
	   $content_array[$c] = substr($content_array[$c], 1, 30);
	   $content_array[$c] = $content_array[$c]."...";
	}

	echo $content_array[$c];


What should the correct $pat be?

Thanks,

-Lisi


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



Re: [PHP-DB] Remote Oracle database questions...

2002-12-12 Thread Philippe Saladin
> DOH!!!  I am seriously hoping that I do not need to have the Oracle
> client installed on the webserver running the PHP queries.  I have no idea
> about the client licensing, and if it involves money in any way it is
pretty
> much out of the question.  Oh well...  Hopefully I can find out about this
> stuff from one of our DBAs.

You definitively need the oracle client installed onto your webserver. Don't
worry, you should find it for free, AFAIK. Ask your dba, he would be able to
help you. Otherwise, you should download it from www.oracle.com (download /
archived products / oracle8). you can't download just the client, you have
to get the entire oracle (500 Mb!!).

> database to perform my query?  I notice that there is a Oracle function in
> PHP called ora_logon.  This function description mentions something about

about Ora_logon  : this comes from the old "oracle" extension
(php_oracle.dll). You would rather use Ocilogon and friends, from the newer
php_oci.dll. It's much better. oci* functions can be used against a Oracle7
or an Oracle8 database. ora$ functions are limited to Oracle 7, and with
less features.

Finally, try this simple tutorial
http://www.thickbook.com/extra/php_oracle.phtml to connect to Oracle. An
other one at http://www.phpworld.com/articles/2000.03/oracle_000.html.
See also http://phporacleadmin.org/ to manage a remote oracle database.

hope this helps !
Regards,
Philippe



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