[PHP-DB] Need space!!! php w/ oracle support

2001-03-18 Thread Doug Schasteen


 This semester I am enrolled in a database management class using Oracle. A
couple of the projects we have to do ( next week!! ) is embedded
SQL. I have convinced my instructor to let me use PHP for these projects.
The problem is that our school server does not have PHP installed and won't
do it just for me. I told the instructor that I could use my work's web
server but, as it turns out, our webserver does not have php compiled with
Oracle support and they refuse to do it since we don't use oracle in our
operations. I then decided to set up PWS on my workstation with php. It took
me a while but I finally got php running w/ Oracle connectivity on my own
machine. It connects to the school Oracle server but runs the php from my
computer. Then another problem came up. We moved our offices and with our
new location we no longer have our own IP addresses. We are all behind a
firewall and I can't run PWS.

So now I am on the web asking for help. If anyone out there has a server
running on the web with PHP installed and compiled with the OCI8 library, I
would greatly appreciate it if you would allocate me a small amount of
webspace for me to complete this class. I wouldn't take up much harddrive
space at all, and it would only be for a couple months. The only processing
power and bandwidth it would use would be when I tell my instructor the
project is ready to grade and he connects and looks at it. I already have my
tnsnames.ora file configured to connect to my school's oracle server.

Drop me an email if you would be willing to help. Thanks.

Doug Schasteen
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Can PHP for Oracle randomly access rows in a result set?

2001-03-18 Thread Andrew Halliday

Can PHP for Oracle randomly access rows in a result set?

I have read documentation for both Oracle functions (ora_*) and Oracle 8
functions (OCI_*) but cant seem to find a way to randomly access rows in a
result set like you can with PostgreSQL or MySQL ... whats the story here?!
Are we FORCED to access the result set sequentially with an Oracle database?
Is that a restriction of the DB or PHP?



All help appreciated,

AndrewH



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] DB Abstraction

2001-03-18 Thread Manuel Lemos

Hello Jordan,

On 11-Mar-01 09:47:16, you wrote:

>I thought it was about time I started using a db abstraction class. Problem 
>is, there are so many out there that I don't which one to start using?

If you are looking for a database abstraction package, I suppose you are
looking that assures a smooth transition of your applications to work with
different databases than those you use today.

Maybe you want to try Metabase.  It is a PHP database abstraction package
that not only provides a means to write portable applications that access
databases, but also is able to install database schema from a database
independent schema description format that you can edit by hand in a custom
XML format.

Metabase is freely available and has been downloaded by over 4.400 users
from here:

http://phpclasses.UpperDesign.com/browse.html/package/20

Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Re: [PHP] how do i get a variable type? - not that simple

2001-03-18 Thread CC Zona

You could use ereg/preg to determine whether it:

a) consists of nothing but digits from beginning to end, example: ^[0-9]+$
b) consists of nothing but digits separated by a single decimal, example: 
^[0-9]+[.][0-9]+$
c) doesn't match the first two conditions, and therefore assume it is a 
string.



In article <9938lh$e5k$[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("phpman") wrote:

> i can't though, the variable and its value comes out of a string .. like
> this..
> 
> $var_string =
> "var1=this_is_a_value|var2=4.5|var3=another_value|var4=3.1415";
> 
> then i extract the pairs of vars and vals, then I need to determine if val
> is string or integer.
> 
> 
> - Original Message -
> From: "Michael Geier" <[EMAIL PROTECTED]>
> To: "phpman" <[EMAIL PROTECTED]>
> Sent: Sunday, March 18, 2001 2:37 PM
> Subject: RE: [PHP] how do i get a variable type? - not that simple
> 
> 
> > anything wrapped in quotes is a string...
> >
> > try:
> >
> > $a=3;
> > echo(gettype($a));
> >
> > -Original Message-
> > From: phpman [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, March 18, 2001 12:44 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] how do i get a variable type? - not that simple
> >
> >
> > No guys. that doesn't work. Take this code for example...
> >
> > $a="3";
> > echo(gettype($a));
> >
> > this returns  string
> > i need to find it as an integer or real or float for the sql. which by the
> > way is MySQL.
> >
> > thank you for responding, but I already know that gettype and all the
> other
> > is_*  don't work for this.

-- 
CC

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: [PHP] how do i get a variable type? - not that simple

2001-03-18 Thread phpman

i can't though, the variable and its value comes out of a string .. like
this..

$var_string =
"var1=this_is_a_value|var2=4.5|var3=another_value|var4=3.1415";

then i extract the pairs of vars and vals, then I need to determine if val
is string or integer.


- Original Message -
From: "Michael Geier" <[EMAIL PROTECTED]>
To: "phpman" <[EMAIL PROTECTED]>
Sent: Sunday, March 18, 2001 2:37 PM
Subject: RE: [PHP] how do i get a variable type? - not that simple


> anything wrapped in quotes is a string...
>
> try:
>
> $a=3;
> echo(gettype($a));
>
> -Original Message-
> From: phpman [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 18, 2001 12:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] how do i get a variable type? - not that simple
>
>
> No guys. that doesn't work. Take this code for example...
>
> $a="3";
> echo(gettype($a));
>
> this returns  string
> i need to find it as an integer or real or float for the sql. which by the
> way is MySQL.
>
> thank you for responding, but I already know that gettype and all the
other
> is_*  don't work for this.
>
>
>
> ""phpman"" <[EMAIL PROTECTED]> wrote in message
> news:99132e$ol8$[EMAIL PROTECTED]...
> > hello all,
> >
> >  let's say i have this:
> > $a="varone=hello world|vartwo=2.44|varthree=100|";
> >
> > now i do this:
> >
> > $b=explode('|',$a);
> > $z=count($b);
> > for ($x=0;$x<$z;$x++) {
> > $tmp=explode('=',$b[$x]);
> > 
> >
> > and i want to find out if  $tmp[1] is a string or an integer (that's
> really
> > all I need to determine so i can put
> > together an SQL statement that puts single quotes around strings and
none
> > around integers). Obviously
> > i won't know at design time all of the variables and their values. Thank
> > you.
> >
> > -dave
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Lotus Approach

2001-03-18 Thread neilalastair

Im using Win Me, Lotus Approach, Xitami web server and I have downloaded
MyuSql for Windows. I am trying to get my localhost page to display a form
where I type say an authors name, and the php will go and get the relevant
info from the Approach dvIV. How do I do this. I have read some tutorials
but am no further on.

Many thanks,


Neil Alastair.
mail:[EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MYSQL Trouble with the IN operator

2001-03-18 Thread Rick St Jean

MySQL doesn't support nested selects.


At 04:13 PM 3/18/01 -0500, Jen wrote:
>Could someone please give their insight?
>I'm having trouble with this query...
>
>SELECT CONCAT(c.l_name, ", ", c.f_name) name
>FROM contractor c
>WHERE c.contractor_id NOT IN
> (select c.contractor_id
> FROM contractor c, task_assign t
> WHERE c.contractor_id = t.contractor_id
> AND t.task_id=11);
>
>It throws an error with the NOT IN line.  I can replace the NOT IN with NOT
>IN(3) giving it a value, and that works.  I was under the impression that
>you could put a query in the Not in.  Can someone please make a sugestion as
>to how this could be done without the NOT IN operator?
>
>Help is GREATLY appreciated!!
> Jen
>
>
>
>
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

##
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MYSQL Trouble with the IN operator

2001-03-18 Thread CC Zona

In article <9937to$794$[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("Jen") wrote:

> SELECT CONCAT(c.l_name, ", ", c.f_name) name
> FROM contractor c
> WHERE c.contractor_id NOT IN
> (select c.contractor_id
> FROM contractor c, task_assign t
> WHERE c.contractor_id = t.contractor_id
> AND t.task_id=11);
> 
> It throws an error with the NOT IN line.  I can replace the NOT IN with NOT
> IN(3) giving it a value, and that works.  I was under the impression that
> you could put a query in the Not in.

That's a subquery.  MySQL doesn't support subqueries (yet).  See the manual.

-- 
CC

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] MYSQL Trouble with the IN operator

2001-03-18 Thread Jen

Could someone please give their insight?
I'm having trouble with this query...

SELECT CONCAT(c.l_name, ", ", c.f_name) name
FROM contractor c
WHERE c.contractor_id NOT IN
(select c.contractor_id
FROM contractor c, task_assign t
WHERE c.contractor_id = t.contractor_id
AND t.task_id=11);

It throws an error with the NOT IN line.  I can replace the NOT IN with NOT
IN(3) giving it a value, and that works.  I was under the impression that
you could put a query in the Not in.  Can someone please make a sugestion as
to how this could be done without the NOT IN operator?

Help is GREATLY appreciated!!
Jen







-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] if () and () - newbie Q

2001-03-18 Thread CC Zona

In article <000f01c0af50$e5092480$6609ee8d@pmg>,
 [EMAIL PROTECTED] ("Michael Gerholdt") wrote:

> what about something like 'isNull' ? I don't see any documentation in the
> PHP online manual nor is 'null' even mentioned in the index of my Core PHP
> book.

You must not have looked very hard.  Next time, check the function list or 
use the manual's search feature, 'cuz it was right there: 


-- 
CC

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Strings

2001-03-18 Thread CC Zona

In article <003801c0afa2$2d5853e0$890083ca@oemcomputer>,
 [EMAIL PROTECTED] ("Mick Lloyd") wrote:

> Can anyone advise on how to surround a string variable in a query. I select
> a string code from a column using:
> 
> $result = mysql_query("SELECT * FROM $TA WHERE Profileid = '$profileid'");
> $row = mysql_fetch_array($result);
> 
> I then want to extract from a second table an id  that relates to the code
> from the first query. I've tried various combinations of:
> 
> $result = mysql_query("select Primaryid from primarycodes where Code =
> '$row[Primaryexpertise]'")

Associate array indexes should be quoted:

$row[Primaryexpertise] //not like this
$row['Primaryexpertise'] //like this
$row["Primaryexpertise"] //or like this

Also, even though simple variable references are expanded within 
double-quotes (ex. "where Profileid = '$profileid'"), the PHP parser seems 
to be less certain about how to deal with array indexes: is the square 
bracket intedned as plain text, as a special character (such as in a 
regular expression) or is it actually an array index?  I find that dropping 
out of quotes whenever referencing array indexes eliminates a lot of parse 
errors.  For example:

"select Primaryid from primarycodes where Code = '" . 
$row['Primaryexpertise'] . "'"

Another option is to use extract() so that the array element can be treated 
as a simple string variable:

extract($row);
$result = mysql_query("select Primaryid from primarycodes where Code =
'$Primaryexpertise'")

> String manipulation has me baffled most of the time!

Re-read the manual's chapters on strings and arrays.  Also check out the 
Zend site.  There are some interesting articles and tutorials over there 
that address issues not yet adequately covered in the manual.

-- 
CC

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PHP / MYSQL message board ?

2001-03-18 Thread DC

Hi all

I would like to find some documentation about how to create my own Php /
Mysql driven message board.

This is purly for my own educational interests.

Any pointers and help appreciated

Email: [EMAIL PROTECTED] kill the NOSPAM to send emial

Thank you in advance

Dave C



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PHP problem with Postgresql

2001-03-18 Thread Luca Lazzeroni

Hi,
I've migrated a system using PHP4.0.3pl1 and PostgreSQL 7.0.2 over a RedHat
5.1 Linux to a new one using PHP4.0.4pl1 and PostgreSQL 7.0.2 on a RedHat
7.0 box.
I've noticed a strange behaviour on one of my web sites; if I try to execute
more than 2 query over an open connection, all the queries starting from the
third one are empty !
And the same code, untouched, works successfully on the previous
installation !

Is there anyone who can help me to solve this ?

Thank you in advance,

Luca Lazzeroni




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Strings

2001-03-18 Thread Mick Lloyd

Can anyone advise on how to surround a string variable in a query. I select
a string code from a column using:

$result = mysql_query("SELECT * FROM $TA WHERE Profileid = '$profileid'");
$row = mysql_fetch_array($result);

I then want to extract from a second table an id  that relates to the code
from the first query. I've tried various combinations of:

$result = mysql_query("select Primaryid from primarycodes where Code =
'$row[Primaryexpertise]'")

 with =, ==,  ===, ', \",  but always get a syntax error. I can get it to
work with LIKE as follows:

$result = mysql_query("select Primaryid from primarycodes where Code like
'%$row[Primaryexpertise]%'")

but I need greater accuracy because some codes contain similar data. String
manipulation has me baffled most of the time!

Thanks.

Mick Lloyd
[EMAIL PROTECTED]
Tel: +44 (0)1684 560224


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]