[PHP-DB] Re: Wrapper classes

2003-07-22 Thread Pete Morganic
I use Pear DB
http://pear.php.net/manual/en/package.database.php
its probably already installed in the pear/includes directory as it 
comes with the php distribution

pete

Mohammad Saad wrote:
Hello all,
I would like to know what is the best wrapper class for Mysql database interface. I 
need a kind of class which will return me results of query in an array and take care 
of all the cleaning of resources
Thanks all
Mohammad Saad


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


[PHP-DB] Re: Help... PostgreSQL on Windows 98!

2003-07-21 Thread Pete Morganic
I've succeeeded with windows 2000 under cygwin..
Configuration took a lot of time and in the end however it was a bit slow..
so I ended up with an olde pentium 233 box with SUSE upon it. Works great
pete



Bruno wrote:
Hi,
I'm trying to use PostgreSQL on Windows98!
Does anyone here succeded with it?
Thanks
Bruno (sorry.. my mistakes).


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


[PHP-DB] Re: sql to find one year in datetime MySQL column

2003-07-16 Thread Pete Morganic
select * from mytable where year(tstamp) = 2003

Bill wrote:
How can I find all the records for a single year from a db that has a datetime
column (in MySQL)?
This seems to work:

SELECT * from mytable
WHERE tstamp < '2003-01-01 00:00:00'
AND tstamp > '2002-01-01 00:00:00'
But this doesn't:
SELECT * from mytable
WHERE tstamp LIKE '2002%'
Is there a simpler way than the first one?

kind regards,

bill hollett



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


[PHP-DB] Re: Form Actions in PHP

2003-07-16 Thread Pete Morganic
you need  a bit of JAvascript

Rick Dahl wrote:
I have a small problem.  I need to have a form post to two different locations.  If a variable is a certain value, it goes to location_one.cgi and if it is another value, it goes to location_two.cgi.  This may turn out be a html problem but I figured php was the way to go since it is more dynamic.  Any help is appreciated.

- Rick



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


[PHP-DB] Re: Multiple same values only wanting one

2003-07-16 Thread Pete Morganic
select distinct(myCol) from table

Ron Allen wrote:
How do I select * from a table, but I do not want it to return the same
value if two fields are the same.  Example
test
test
test
test
new
new
new
Results that I want are just

test
new
Any suggestions?




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


[PHP-DB] Re: any Help !! the only way have to ODBC to Linux

2003-07-15 Thread Pete Morganic
Have you looked at Pear DB
http://pear.php.net/manual/en/package.database.php
This is what i use all the time and allows me to easily switch between 
mysql, mssql and postresql which i do all the time

pete

Nabil wrote:
I have an Linux server running Apache/PHP/MySQL.
and I need to connect to another server running  MSSQL server 7
THE POINT IS  the only way I have to connect is throu ODBC connection
because the network administrator only allowed me to connect thru port 1433
that ODBC uses..
I tried to make it direct connection, but this way uses many ports that the
firewall won't allowed..
He said for security reasons that he can't open those ports to prevents
hackers to use them ... do u think this is a true ? any advice what port the
direct connection uses??? does it uses NetBIOS?
if he was right ... so I have to change to ODBC
I heard about FreeDTS and iODBC, but I need some advice and notes to make it
easy for me..
Please HELP.. and your valuable comments will be appreciated..

Nabil




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


[PHP-DB] Re: windows explorer

2003-07-14 Thread Pete Morganic
http://www.hotscripts.com/PHP/Scripts_and_Programs/File_Manipulation/index.html

Gates Bill wrote:
Hello ,
i want to make an windows explorer like application in Php where on the left hand side i have the folders with + or - sign and if i click on + sign it should show me the sub-folders 
in that folder just like we can see in windows explorer, and when i click on - then it 
should fold back and only show the main folders.
Also if someone click on the folder then he can see all the items in that folder on the right hand sign frame.
hope u can provide with some input on how to do the same or where to get codes for the same .
thanks in advance.

-
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.


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


[PHP-DB] Re: PEAR DB getAssoc()

2003-07-11 Thread Pete Morganic
$sql = ' select contact_id, contact_name from contacts';

$contacts = $db->getAssoc($sql);

also try getAll which will give u a different result
$contacts = $db->getAll($sql);
pete

Jacob Marble wrote:
Hey all-
Could someone give an example of how to use the DB_Common::getAssoc()
function?  I'm trying to get an table into an array, and var_dump() shows
that the array is not associative.  Here's the code:
$sql = "select * from sr_names";
$table = $db->getAssoc($sql);
echo var_dump($table);
And here's the output:

array(1) {
  [1]=>
  array(16) {
[0]=>
string(5) "Jacob"
[1]=>
string(6) "Marble"
[2]=>
NULL

As I understand it, an associative array should return something more
like:
array(1) {
  [1]=>
  array(16) {
['firstname']=>
string(5) "Jacob"
['lastname']=>
string(6) "Marble"
['email']=>
NULL

Or am I showing off my newness... ;-)  Any help greatly appreciated!!

Jake

LandEZ




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


[PHP-DB] Re: OCIPLogon

2003-07-09 Thread Pete Morganic
> $conn = OCIPLogon("scott", "tiger", "testdb");

> $statement = OCIparse($conn, "INSERT INTO Dummy VALUES ('A')");
> OCIexecute($statement, OCI_DEFAULT);
>
> $statement = OCIparse($conn, "INSERT INTO Dummy VALUES ('B')");
> OCIexecute($statement, OCI_DEFAULT);
>
> $statement = OCIparse($conn, "INSERT INTO Dummy VALUES ('C')");
> OCIexecute($statement, OCI_DEFAULT);
> OCICommit($conn);



Sapporo wrote:
Hi,

I'm trying to avoid excessive database connections within my app.

 From the docs, I figured that the following code would insert 2 rows of 
data into table Dummy, since the connection would be reused and the 
transactions aren't isolated by using OCINLogon() (error handling left 
out for readability):

$conn = OCIPLogon("scott", "tiger", "testdb");
$statement = OCIparse($conn, "INSERT INTO Dummy VALUES ('A')");
OCIexecute($statement, OCI_DEFAULT);
$conn = OCIPLogon("scott", "tiger", "testdb");
$statement = OCIparse($conn, "INSERT INTO Dummy VALUES ('B')");
OCIexecute($statement, OCI_DEFAULT);
OCICommit($conn);

But it turns out that only the second row gets written to the database. 
So, what difference would it make to use OCINLogon()? Is this the 
expected behaviour?

How does everyone else handle this? Is it possible to store database 
connections in a session?

TIA,
-sapporo.
BTW, I'm using PHP 4.3 on Linux talking to Oracle9i.



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


Re: [PHP-DB] Re: odbc going nuts

2003-07-04 Thread Pete Morganic
I'd recmmend you use the $_POST vars as this is more secure

pete

George Pitcher wrote:
Pete,

Thanks for the tip. I do use $_REQUEST[] and then convert to variables.

I moved my code to another machine and it was OK, so I've narrowed it down
to a MS upgrade! Obviously tinkered with something.
George


-Original Message-----
From: Pete Morganic [mailto:[EMAIL PROTECTED]
Sent: 04 July 2003 1:56 pm
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: odbc going nuts
Are registed globals off, otherwise u name to change $username to
$_POST['username']
> Any suggestions (apart from dropping Access in favour of another db -
client choice)
Oh dear.. Access is a real pain in the butt and we now NEVER deal with a
client that selects Access. Never had any complaints since.
suggestions - mysql - postgresql - Firebird ...

Pete

George Pitcher wrote:

Hi all,

Just finishing off a site using odbc and Access and it's thrown
up a problem

that wasn't there yesterday.

I have a simple login with a username and password. If either
are blank, the

user gets bumped to the login page. otherwise the user table is
searched for

the username and password.

my code looks like:

$strSQL = "select * from user where (Username='$username' and
Paswd='$paswd')";
I have an error script that kicks in if the query fails, and prints the
query to screen. I've pasted the query straight into Access' SQL query
window and it worked fine.
I just can't see anything wrong with the code, or anything else.

Any suggestions (apart from dropping Access in favour of
another db - client

choice)

Cheers

George in Oxford



--
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: odbc going nuts

2003-07-04 Thread Pete Morganic
Are registed globals off, otherwise u name to change $username to 
$_POST['username']

> Any suggestions (apart from dropping Access in favour of another db - 
client choice)

Oh dear.. Access is a real pain in the butt and we now NEVER deal with a 
client that selects Access. Never had any complaints since.

suggestions - mysql - postgresql - Firebird ...

Pete

George Pitcher wrote:
Hi all,

Just finishing off a site using odbc and Access and it's thrown up a problem
that wasn't there yesterday.
I have a simple login with a username and password. If either are blank, the
user gets bumped to the login page. otherwise the user table is searched for
the username and password.
my code looks like:

$strSQL = "select * from user where (Username='$username' and
Paswd='$paswd')";
I have an error script that kicks in if the query fails, and prints the
query to screen. I've pasted the query straight into Access' SQL query
window and it worked fine.
I just can't see anything wrong with the code, or anything else.

Any suggestions (apart from dropping Access in favour of another db - client
choice)
Cheers

George in Oxford



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


[PHP-DB] Re: fatal error with DB.php

2003-07-04 Thread Pete Morganic
edit the php.ini file and chenge the include paths to being where your 
isntallation is ;

Jswalter wrote:
I am trying to use DB.php, but I am getting htis error...

Fatal error: main(): Failed opening required 'DB.php'
(include_path='.;c:\php4\pear')
I can't find this path defined *anywhere*

I don't have PHP installed there.

How can I "fix" this include path issue.

[besides placing the PEARS directory at that path.
 which I did and that works fine, but I don't
 want it there]
Thanks

Walter




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


[PHP-DB] Re: Database question

2003-07-03 Thread Pete Morganic
definately do NOT recommend this path-
Just make an include file at the top of each page
pete

Hardik Doshi wrote:
Hi Group,

Currently i am connecting the underlying database
server from every php page. To reduce the connection
overhead i am thinking to store the PEAR DB object
into the registry (session) at the time of user login.
Here i am connecting the Database only one time and
rest of the time i am using the object stored in the
memory. Even this is more helpful when the application
is connecting more than one database..My application
is getting feed from four different databases reside
on two different servers.
I don't know what ever i am thinking is correct or
not.. Please guide me if i am wrong anywhere and if
any one of you have better idea then please disucss.
Thanks

Hardik Doshi

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


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


[PHP-DB] Re: Acceso a Oracle (Replanteo mi pregunta)

2003-07-03 Thread Pete Morganic
Cristian Marin wrote:
OK, and what is your problem ? :))

Y trwbwl iw ti dim yn diach dim iaithg on english - twpsin twp

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


[PHP-DB] Re: insert NULL to mysql table.

2003-07-02 Thread Pete Morganic
> '$issue'" where $editor = " is null"
Anders Thoresson wrote:
Hi,

I've the query "UPDATE un_issue SET i_editor = '$editor' WHERE i_date = 
'$issue'" where $editor = "/0" but the inserted value in 
un_issue.i_editor becomes 0.

un_issue is defined as follows:

CREATE TABLE un_issue
(
i_id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
i_date DATE NOT NULL,
UNIQUE (i_date),
i_number INT,
i_editor INT
);
Isn't /0 the escapestring for NULL?



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


[PHP-DB] Re: hmmm

2003-07-01 Thread Pete Morganic
The man is entoxicated with the exuberance of his own verbosity

Winston Churchill

[EMAIL PROTECTED] wrote:
YOU FUCKING SHIT!!! UNSUBSCRIBE MY EMAIL PLEASE !!! GOD VERDOMME !!! 

UNSUBSCRIBE IT NOW,MOTHER FUCKER 

BABI LOE BANGSAT LOE KONTOL LOE !!! SIKTIR GIT!!! YALLA!!! 

HOER !!! GO AWAY FROM MY MAIL BOX WILL YA!!! FUCK SHIT U BASTARD MOTHER FUCKER 
ASSHOLE !!! 

PECUN LOE BABI LOE JANCUK !!!

--


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


[PHP-DB] Re: PHP help

2003-06-30 Thread Pete Morganic
 $query="INSERT INTO login VALUES ('$login')";

have fun

Bill Pilgrim wrote:
My System:  
Windows 98
Apache 1.3.27
PHP 4
mysql

Hello all, I am a PHP beginner and was wondering if I could get some help from some of 
the more experienced on this list.  I have been trying to use an html form (with 
textboxes, radio buttons, and textareas) to input data into a mysql database.  I am 
able to connect fully with the database and am able to create tables in it, but when I 
try to input information into the tables nothing happens. ever...  I don't really know 
what to do from here, but I assume that a configuration is not set properly between 
mysql, apache, windows, or php.  I really don't know what it could be.  My code is 
here and I have tried to simplify the form in order to get it working, so here is my 
barebones code that hopefully has some errors:
HTML:


Simplify



Login: 




PHP file called "addform.php":



$user="chris";
$database="test";
mysql_connect(localhost,$user);
@mysql_select_db($database) or die("unable to select database");
$query="INSERT INTO login VALUES ("'$login')";
mysql_query($query);
mysql_close();
?>
Login is the name of the table on the database named test.

I stopped using a password because it wouldn't let anything work even table creation when I tried to use a password.  Any help that anyone could give would be greatly appreciated; there is probably some grievious error in this script.  Thanks, Chris



-
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!


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


[PHP-DB] Re: POSTed form and address

2003-06-26 Thread Pete Morganic
 - this does not send it on the URL
pete
John Dillon wrote:
I have a simple page saying: if(password is correct){then print the page}
otherwise {print the login form}.  The login form uses the method=post.  But
the page I get back has the form values: login details, in the address line.
I thought get gave you the variables in the address line and with post you
just saw the page's address, without parameters after it, like ?pw=something
etc.  No?
John











































   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are confidential. If you are not the named recipient please notify the sender and immediately delete it. You may not disseminate, distribute, or forward this e-mail message or disclose its contents to anybody else. Copyright and any other intellectual property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission.  If verification is required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and any attachments for viruses. We make no representation or warranty as to the absence of viruses in this e-mail or any attachments. Please note that to ensure regulatory compliance and for the protection of our customers and business, we may monitor and read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and Legal Statement at http://www.cantor.com/legal_information.html



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


[PHP-DB] Re: Related Tables - Capture ID

2003-06-26 Thread Pete Morganic
$sql = "insert into table2(fld,fld2)values( 2, 4)";
$db->query($sql);
$new_id = $db->query('select last_insert_id');
$sql = "insert into table3(table2_id, fld) values($new_id,3)"
$db->query($sql);
the altenative syntax for the secound query could also be
$sql = "insert into table3(table2_id, fld) values(last_insert_id() ,3)"
hop it helps
Pete
Marie Osypian wrote:
Hello,

I have three table in which I am inserting records into in one script.  I
need to capture the ID of the second tables record insertion to insert into
a field into a related table in the third.  What would the easiest way to go
about this in php?
Thanks,

MAO




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


Re: [PHP-DB] Re: extract( $HTTP_POST_VARS ); <------------ whatdoes this do?

2003-06-24 Thread Pete Morganic
PHP newbie - YIpee

if your a windows users then the CHM version of the manual is cool 
(that's what I use)

I learn most of my stuff at the zend tutorials
http://www.zend.com/zend/tut/
have fun

Pete

Boa Constructor wrote:
Pete, I got my problem sorted out, thanks for directing me to the manual.
I'm not too fond of the manual as I find it difficult to understand as I'm
sure many newbies do.
Turns out I didn't have to use that function but thank you anyway!

Cheers,

Graeme :)

- Original Message -
From: "Pete Morganic" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 24, 2003 6:32 PM
Subject: [PHP-DB] Re: extract( $HTTP_POST_VARS ); < what does
this do?


http://uk2.php.net/extract

Boa Constructor wrote:

I'm wanting to overwrite the variables contained in a session, I read on
the

net somewhere that I could do this by explicitely making variables
global,

the code I looked at contained this:

extract( $HTTP_POST_VARS );

What exactly does this do?

Cheers,

Graeme :)



--
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: extract( $HTTP_POST_VARS ); <------------ what does this do?

2003-06-24 Thread Pete Morganic
http://uk2.php.net/extract

Boa Constructor wrote:
I'm wanting to overwrite the variables contained in a session, I read on the
net somewhere that I could do this by explicitely making variables global,
the code I looked at contained this:
extract( $HTTP_POST_VARS );

What exactly does this do?

Cheers,

Graeme :)



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


[PHP-DB] Re: md5 question!

2003-06-24 Thread Pete Morganic
I found this very useful
http://www.aspencrypt.com/crypto101.html
pete
Jerry wrote:
Hi,

If I use md5 to handle passwords to my database is
there a way to reverse the action if someone forgets
their password?  Is there a way for me to decode the
32bit to plain text?
Jerry

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.


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


[PHP-DB] Re: forms with php/mysql

2003-06-11 Thread Pete Morganic
try
http://www.hotscripts.com/PHP/Tips_and_Tutorials/User_Authentication/
Philippe Rousselot wrote:
Hi,

I need for an association to create a form using php/mysql. If I can 
understand php, I am not a coder, so if someone had the code I need, I would 
really be greatful.

I need :

1. on a page someone identify himself or register to the service using a form 
where the person enter name, email(username) and password.
2. once registered, the person can access a secured zone containing a form
3. the persone can fill the form, abandon half way and save the result, then 
come back and have the previously recorded information appearing again.

all data need to be in a Mysql database.

Thank you very much for your help.

Philippe



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