Re: [PHP-DB] changing datatypes in the query

2003-08-26 Thread Matt Babineau
I think I answered my own question, I used CAST() to set the type in the
ORDER BY statement.

cast(s11.data as unsigned)

Thx to me!
Matt

On Tue, 2003-08-26 at 11:21, Matt Babineau wrote:
> Hi all-
> 
> Tough question (I think). I am pulling some numbers out of a data base,
> currently they are stored in a blob. When I try to "order by user_hits
> desc" it does a text ordering, not a numerical ordering. Is there a way
> to get it to do a numeric ordering?
> 
> Thanks,
> Matt

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



[PHP-DB] changing datatypes in the query

2003-08-26 Thread Matt Babineau
Hi all-

Tough question (I think). I am pulling some numbers out of a data base,
currently they are stored in a blob. When I try to "order by user_hits
desc" it does a text ordering, not a numerical ordering. Is there a way
to get it to do a numeric ordering?

Thanks,
Matt

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



[PHP-DB] timestamp formatting on display?

2003-08-26 Thread Aaron Wolski
Hi All,
 
Having a brain laps and not sure where in the manual to look and sadly I
need a QUICK solution.
 
I have a date formatted in a table like: 20030826132457
 
Now.. I went to MySQL timestamp from UNIX timestamps because I like the
readability of them when just looking at the Tables. How would I format
the date something like: August 26, 2003??
 
I could easily do this with a UNIX timestamp.. not sure if the same is
possible with this type of timestamp. Also.. I can't use the MYSQL
functions to format the data into a UNIX TimeStamp. not int his query.
 
Any ideas?
 
Thanks!
 
Aaron
 


RE: [PHP-DB] How to insert date into date field

2003-08-26 Thread Jack van Zanen
load my apache access log into a table (this is formatted "wrong")

I now use a workaround by adding the date that I enter the records into the
table as well. I lose the timestamp but that's ok for now.
I then wrote an update statement to convert the old data to the correct date
and just make sure that just before midnight every day I load the data.

I'll look at my PHP insert script one day to see if I can easily change this
to pre format the date field .

Jack

-Original Message-
From: Jennifer Goodie [mailto:[EMAIL PROTECTED]
Sent: dinsdag 26 augustus 2003 1:13
To: Jack van Zanen; Php-Db
Subject: RE: [PHP-DB] How to insert date into date field


> I have a date that is formatted in the following way
> day(00-31)/Mon(Jan-Dec)/year(2003):hour(00-23):minute(00-59):sec(00-59)
>
> I want to load this into mysql table (date column)
>
> In oracle I can just use the to_date function but all I find about MYSQL
> seems to want the date in a specific format beforehand.

If you are using PHP to insert it you can just format it before sticking it
in.  It gets a little more complicated if you are loading it in via LOAD
DATA INFILE or something like that.  What exactly are you attempting to do?

--
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] Logic Help...

2003-08-26 Thread CPT John W. Holmes
From: "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]>


> This isn't specifically a DB related question, but...  The following
> code snippet is not functioning for me.  I keep receiving a parse error on
> the "if" line.  Basically I want to stop execution of this page if either
of
> the conditions in the "if" statement exist.  Thanks in advance.
>
>
> #  while($cntr != 0) {
> #if (($shell[$cntr] eq "") || ($grp[$cntr] eq "Primary Gr")) {

Umm... you don't use 'eq' in PHP, you use == (that's two equal signs).

---John Holmes...

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



[PHP-DB] Logic Help...

2003-08-26 Thread NIPP, SCOTT V (SBCSI)
This isn't specifically a DB related question, but...  The following
code snippet is not functioning for me.  I keep receiving a parse error on
the "if" line.  Basically I want to stop execution of this page if either of
the conditions in the "if" statement exist.  Thanks in advance.


#  while($cntr != 0) {
#if (($shell[$cntr] eq "") || ($grp[$cntr] eq "Primary Gr")) {
# echo "Sorry, but your request was not filled out completely.  Please
resubmit this request ensuring that you have selected a Primary Group and
Default Shell.";
#  echo "Please
follow this http://ldsa.sbcld.sbc.com/sa_bulletin/sa_board.htm\";>link to
return to the beginning of the request process.";
# exit;
#   }
#  }


Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com

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



Re: [PHP-DB] problems compiling with-informix

2003-08-26 Thread Luigi Vellucci
Paul Gardiner wrote:
I run Informix (SE7.25.UC4 - UC5 had a major bug) on RH8.0. It wouldn't run
on RH9.0 because of the glibc 2.3.x conflict. I beleive Informix only
supports glibc 2.2.x. at the moment.
If it's possible, use RH8.0 as I know it works.

- Paul -

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 18, 2003 3:54 PM
Subject: [PHP-DB] problems compiling with-informix


hi, my name is matts.
when trying to compile php (as cgi or module) i get the following:
./configure --with-informix=/opt/informix

*

make

*

ext/mysql/libmysql/my_tempnam.o(.text+0x40): In function `my_tempnam':
/usr/src/php-4.3.2/ext/mysql/libmysql/my_tempnam.c:115: the use of
`tempnam' is

dangerous, better use `mkstemp'
/opt/informix/lib/esql/libifgls.so: undefined reference to `__ctype_b'
/opt/informix/lib/esql/libifgls.so: undefined reference to
`__ctype_toupper'

/opt/informix/lib/esql/libifgls.so: undefined reference to
`__ctype_tolower'

collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Error 1
i know that my_tempnam warnings are not important, but i cant figure out
what is

wrong with my libifgls.so

I'm working in a Red Hat 9.
I compiled php without informix support succefully several times.
I have installed the Informix Client SDK 2.81
(I believe)  I have all the environment variables ok (INFORMIXDIR,
INFORMIXSERVER... ETC)
I would apreciate any help 
thanks in advance.


-
This mail sent through IMP: http://mail.info.unlp.edu.ar/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php







Hi I'm trying to compile php 4.1.2 with informix support from the SRPMS 
in RedHat 7.3 but I didn't get it. I downloaded the latest version of 
SDK Client 2.81.

I having the following problem when I try to compile the source:

-I/usr/src/redhat/BUILD/php-4.1.2/TSRM 
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/TSRM -O2 -march=i386 
-mcpu=i686 -fPIC  -L/usr/kerberos/lib -o php -export-dynamicstub.lo 
libphp4.la
/usr/bin/ld: cannot find -lifsql
collect2: ld returned 1 exit status
make[1]: *** [php] Error 1
make[1]: Saliendo directorio `/usr/src/redhat/BUILD/php-4.1.2/build-cgi'
make: *** [all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.32322 (%build)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.32322 (%build)


Can somebody help me?

Thanks in advance.

Luigi Vellucci.

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


[PHP-DB] Re: Oracle and PHP

2003-08-26 Thread Philippe Saladin

"Roger Spears" <[EMAIL PROTECTED]> a écrit dans le message news:
[EMAIL PROTECTED]
> Hello,
>
> I was wondering if there are any PHP people out there that are really
> into using Oracle databases?  I've always used mysql but now I find
> myself in a situation that requires the use of an Oracle database.

Sure, most of our developments are under Oracle/php

> I've printed out the information posted by Thies C. Arntzen titled
> "Making Efficient use of Oracle8i thru Apache and PHP 4" but I was
> wondering if I may see some other code examples.  Very basic examples

In my case, I don't use directly the oci functions, but I use ADODB, which
is a wrapper, an abstraction layer. Thus, I code the same things, under
Oracle or MySQL. See http://php.weblogs.com/adodb_manual
Other abstraction layers exist : adodb, pear-db, metabase, etc.

> dealing with connections, queries and the such.  Also, is there an
> application for Oracle databases that is similar to PHPMyAdmin for mysql
> databases?

yes, you would try http:///phporacleadmin.org/

>
> Thanks,
> Roger

Regards,
Philippe

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



Re: [PHP-DB] Comparing tables

2003-08-26 Thread David Smith

> I would like to compare 2 tables in a database to determine which records
> are different!!!  Any clues out there.  Thanks in advance!

You didn't say which DBMS you are using. If you're using a DBMS which
supports INTERSECT (not MySQL), and assuming the two tables have the same
column names and types, you can do this:

  (SELECT * FROM table1) INTERSECT (SELECT * FROM table2)

For MySQL INTERSECT support, monitor this doc:

  http://www.mysql.com/doc/en/TODO_sometime.html

--Dave

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



Re: [PHP-DB] Comparing 2 tables in the same database

2003-08-26 Thread John W. Holmes
Ron Allen wrote:
I would like to compare 2 tables in the same database so that I can find out
which records are different!
LEFT JOIN it with itself...

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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