[PHP-DB] howto merge tables..

2003-08-22 Thread FB
Hi,

I have 3 similar tables. I want to merge them. The thing I use is

1) SELECT *
2) Make a while statement
3) INSERT each raw into the other table

is there a easier way?

FB




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



Re: [PHP-DB] howto merge tables..

2003-08-22 Thread Sean Burlington
FB wrote:
Hi,

I have 3 similar tables. I want to merge them. The thing I use is

1) SELECT *
2) Make a while statement
3) INSERT each raw into the other table
is there a easier way?

FB
if the columsn are identical

insert into table1 select * from table2;
insert into table1 select * from table3;
if the column names are different

insert into table12 (colname1, calname2)  select colname3, colname4 from 
walks;

the above works on mysql ...

--

Sean

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


Re: [PHP-DB] howto merge tables..

2003-08-22 Thread FB
that was preety good..

merged 3 tables with 2 million raws in 3 minutes...

thanks

FB

Sean Burlington [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 FB wrote:
  Hi,
 
  I have 3 similar tables. I want to merge them. The thing I use is
 
  1) SELECT *
  2) Make a while statement
  3) INSERT each raw into the other table
 
  is there a easier way?
 
  FB

 if the columsn are identical

 insert into table1 select * from table2;
 insert into table1 select * from table3;

 if the column names are different

 insert into table12 (colname1, calname2)  select colname3, colname4 from
 walks;

 the above works on mysql ...

 -- 

 Sean




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



[PHP-DB] Re: PHP Oci8 segmntation fault

2003-08-22 Thread Radovan Radic
Hello Lang Sharpe,

It seems this line
 #undef HAVE_OCI8_SHARED_MODE

did the trick. Maybe it can help other ppl too.

Thanks a lot, i cant say how much you helped me with this.

Radovan

Lang Sharpe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi Radovan

 Here are some suggestions

 Make sure $ORACLE_HOME is set in your environment. There may be other
 environment variables that the environment needs as well that are set for
 the webserver process, but not when you run the command line version.

 PHP 4.3.2 has a bug in it that causes php to crash with oracle support.
Try
 adding

 #undef HAVE_OCI8_SHARED_MODE

 near the top of ext/oci8/oci8.c

 If your getting a core dump, then you can compile php with --enable-debug
as
 a configure option. run the script again and use gdb to get a backtrace.
 There are instructions for doing this are at
 http://bugs.php.net/bugs-generating-backtrace.php
 This probably wont solve your problem, but is fun to do anyway.

 Lang


 Radovan Radic wrote:

  Hello
 
  I have php 4.3.2 installed as apache 2.0.45 module on RH Linux (7.3)
with
  oci8 support.
  Things work fine when php scripts are accessed via web, but when i try
to
  start them from command line using
  /usr/local/php4.3.2/bin/php test.php i get an error
  Segmentation fault.
  test.php has only 4-5 lines, for connecting to oracle, and printing data
  from one table, using same class as pages on the web.
 
  Anyone can help?
 
  Thanks,
  Radovan




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



Re: [PHP-DB] Segmentation fault (11) with PHP ODBC

2003-08-22 Thread Sebastian Haag

Tommy Apel said:
 Hi I'm having a little problem ondestanding whats going on
 The problem is that some and only some of my odbc_exec()'s functions while
 others don't and cause an segmentation fault in apache1/2
 My configuration is SuSE 8.1 with Apache2.0.44, PHP4.3.1 --with-iODBC
 after
 that i've added FreeTDS 0.61 as ODBC-driver for MS-SQL2K, now this works
 fine some of the way but not always

 Exampel:
 odbc_exec($conn,select id,name from $user_db.dbo.users); // Works fine
 no
 problem

 odbc_exec($conn,select * from $user_db.dbo.users where (id = '$idz'));
  ^   ^
Are you sure you need those parenthesis???

 //
 Does not work and causes seg fault (11)


 Can anyone maby help me explain this error

 Regards
 Tommy

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




-- 

Once a problem is defined - it is half way solved. (Henry Ford)

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



Re: [PHP-DB] Segmentation fault (11) with PHP ODBC

2003-08-22 Thread Tommy Apel
Sebastian Haag wrote:

 
 Tommy Apel said:
 Hi I'm having a little problem ondestanding whats going on
 The problem is that some and only some of my odbc_exec()'s functions
 while others don't and cause an segmentation fault in apache1/2
 My configuration is SuSE 8.1 with Apache2.0.44, PHP4.3.1 --with-iODBC
 after
 that i've added FreeTDS 0.61 as ODBC-driver for MS-SQL2K, now this works
 fine some of the way but not always

 Exampel:
 odbc_exec($conn,select id,name from $user_db.dbo.users); // Works fine
 no
 problem

 odbc_exec($conn,select * from $user_db.dbo.users where (id = '$idz'));
   ^   ^
 Are you sure you need those parenthesis???
Tommy: Yes they are there to fetch the name of the databare for the
currentuser of the system cause they are different from user to user
 
 //
 Does not work and causes seg fault (11)


 Can anyone maby help me explain this error

 Regards
 Tommy

 --
 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] Segmentation fault (11) with PHP ODBC

2003-08-22 Thread Tommy Apel
Tommy Apel wrote:

 Sebastian Haag wrote:
 
 
 Tommy Apel said:
 Hi I'm having a little problem ondestanding whats going on
 The problem is that some and only some of my odbc_exec()'s functions
 while others don't and cause an segmentation fault in apache1/2
 My configuration is SuSE 8.1 with Apache2.0.44, PHP4.3.1 --with-iODBC
 after
 that i've added FreeTDS 0.61 as ODBC-driver for MS-SQL2K, now this works
 fine some of the way but not always

 Exampel:
 odbc_exec($conn,select id,name from $user_db.dbo.users); // Works fine
 no
 problem

 odbc_exec($conn,select * from $user_db.dbo.users where (id = '$idz'));
   ^   ^
 Are you sure you need those parenthesis???
Correction : I've tryed both with and without but the result is the same

 
 //
 Does not work and causes seg fault (11)


 Can anyone maby help me explain this error

 Regards
 Tommy

 --
 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] MYSQL 4.1 derived tables and PHP

2003-08-22 Thread Jack van Zanen
Hi List,



I have installed MYSQL 4.1 with support for derived tables. If I query Mysql
with a query that has a subquery in the from clause it works fine. If I now
load this query in PHP I get invalid resource error. If I change the select
for another select w/o the subquery it works fine (So my php script must be
correct).

Does PHP do syntax checking before sending the query to mysql?
Any other solution?
I have tried PHP 4.3.2/4.3.3  5.0

TIA


Jack



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



[PHP-DB] Oracle and PHP

2003-08-22 Thread Roger Spears
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.

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 
dealing with connections, queries and the such.  Also, is there an 
application for Oracle databases that is similar to PHPMyAdmin for mysql 
databases?

Thanks,
Roger


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


Re: [PHP-DB] MYSQL 4.1 derived tables and PHP

2003-08-22 Thread CPT John W. Holmes
From: Jack van Zanen [EMAIL PROTECTED]
 I have installed MYSQL 4.1 with support for derived tables. If I query
Mysql
 with a query that has a subquery in the from clause it works fine. If I
now
 load this query in PHP I get invalid resource error. If I change the
select
 for another select w/o the subquery it works fine (So my php script must
be
 correct).

 Does PHP do syntax checking before sending the query to mysql?
 Any other solution?
 I have tried PHP 4.3.2/4.3.3  5.0

What does mysql_error() say?

---John Holmes...


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



[PHP-DB] php mssql tcpip

2003-08-22 Thread JD
I used to use named pipes to connect to a remote sql server.  My nt
department removed anonymous access account and now I have to use tcpip.
Since the change the performance of the php quering has decreased.  it takes
more time to load the page.

anything to look at in the sql configs or in the php.ini file to speed up
the tcpip query?  Any other ideas would be great.



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



RE: [PHP-DB] MYSQL 4.1 derived tables and PHP

2003-08-22 Thread Jacob A. van Zanen
Hi

THX

I added mysql_error()  to get the error message.

I got the message that the user did not have rights on table
/tmp/dbla.bla

I figured that I must give some more global read rights to this user
(not just DB read rights). After that it worked.


THX

Jack



-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 4:11 PM
To: Jack van Zanen Prive; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MYSQL 4.1 derived tables and PHP


From: Jack van Zanen [EMAIL PROTECTED]
 I have installed MYSQL 4.1 with support for derived tables. If I query
Mysql
 with a query that has a subquery in the from clause it works fine. If 
 I
now
 load this query in PHP I get invalid resource error. If I change the
select
 for another select w/o the subquery it works fine (So my php script 
 must
be
 correct).

 Does PHP do syntax checking before sending the query to mysql? Any 
 other solution? I have tried PHP 4.3.2/4.3.3  5.0

What does mysql_error() say?

---John Holmes...


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



[PHP-DB] join across databases - how to select databases?

2003-08-22 Thread Moshe Weitzman
I have looked all over the web but can't find an example *in php* for 
connecting to a mysql server, selecting database(s), and issueing a query 
which joins across databases. I already know the SQL required to achieve a 
multiple database query. My question is about how many calls to 
mysql_select_db() are required, does order matter, etc.

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


Re: [PHP-DB] join across databases - how to select databases?

2003-08-22 Thread jeffrey_n_Dyke

to my knowledge this is not possible in MySQL.  There are only joins at the
table level.  I've been curious about this in the past myself, so if i'm
incorrect, i'm hoping to hear it via this post.

hth
jeff


   
 
  Moshe Weitzman   
 
  [EMAIL PROTECTED]To:   [EMAIL PROTECTED]
  
  ourmet.org   cc:
 
Subject:  [PHP-DB] join across 
databases - how to select databases? 
  08/22/2003 11:16 AM  
 
   
 
   
 




I have looked all over the web but can't find an example *in php* for
connecting to a mysql server, selecting database(s), and issueing a query
which joins across databases. I already know the SQL required to achieve a
multiple database query. My question is about how many calls to
mysql_select_db() are required, does order matter, etc.


--
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] join across databases - how to select databases?

2003-08-22 Thread CPT John W. Holmes
From: Moshe Weitzman [EMAIL PROTECTED]


 I have looked all over the web but can't find an example *in php* for
 connecting to a mysql server, selecting database(s), and issueing a query
 which joins across databases. I already know the SQL required to achieve a
 multiple database query. My question is about how many calls to
 mysql_select_db() are required, does order matter, etc.

What have you tried? What does mysql_error() say after each attempt?

I assume something like the following would work, regardless of whether/how
you've called mysql_select_db()

SELECT t1.column FROM database1.table1 t1 JOIN database2.table2 t2 ON t1.id
= t2.id

If you have something working from the MySQL command line, then it's going
to work from mysql_query() with the same exact syntax.

---John Holmes...


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



Re: [PHP-DB] join across databases - how to select databases?

2003-08-22 Thread CPT John W. Holmes
From: [EMAIL PROTECTED]
 to my knowledge this is not possible in MySQL.  There are only joins at
the
 table level.  I've been curious about this in the past myself, so if i'm
 incorrect, i'm hoping to hear it via this post.

You can stop hoping now. It is indeed possible. :)

mysql select * from test1.table1;
++--+
| id | name |
++--+
|  1 | John |
|  2 | Bill |
|  3 | Mark |
++--+
3 rows in set (0.00 sec)

mysql select * from test2.table2;
++-+
| id | name|
++-+
|  1 | Holmes  |
|  2 | Foreman |
|  3 | Smith   |
++-+
3 rows in set (0.00 sec)

mysql select t1.name, t2.name from test1.table1 t1 join test2.table2 t2 on
t1.id = t2.id;
+--+-+
| name | name|
+--+-+
| John | Holmes  |
| Bill | Foreman |
| Mark | Smith   |
+--+-+
3 rows in set (0.00 sec)

---John Holmes...


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



Re: [PHP-DB] php mssql tcpip

2003-08-22 Thread Colbey

Thoughts... I've used mssql via PHP on linux via tcp/ip 1433 with good
success and performance..  Never used named pipes (I'm assuming you have
to be an entire ms environment to do that)

You might check into timing the process, perhaps the tcp/ip login is
taking longer for authentication against the mssql server as it could be
anybody connecting.

Might add some timing code into that..

Also depending on how busy things are, be sure all your webservers + sql
systems are hooked together 100MB or faster fully switched network..



, using named pipes, the sqlserver I would assum

On Thu, 21 Aug 2003, JD wrote:

 I used to use named pipes to connect to a remote sql server.  My nt
 department removed anonymous access account and now I have to use tcpip.
 Since the change the performance of the php quering has decreased.  it takes
 more time to load the page.

 anything to look at in the sql configs or in the php.ini file to speed up
 the tcpip query?  Any other ideas would be great.



 --
 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] join across databases - how to select databases?

2003-08-22 Thread Moshe Weitzman
I assume something like the following would work, regardless of whether/how
you've called mysql_select_db()
SELECT t1.column FROM database1.table1 t1 JOIN database2.table2 t2 ON t1.id
= t2.id
If you have something working from the MySQL command line, then it's going
to work from mysql_query() with the same exact syntax.
You are indeed correct. I had a bug in my join syntax. How embarrassing.

For the record, you don't even have to call mysql_select_db() at all.

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


[PHP-DB] Failure to interact with MySQL in Redhat 9 ?

2003-08-22 Thread David Haines
Hello all. I hope this is the best place to ask this (!)

Problem: verified that PHP, MySQL and Apache are all working fine.
My first little project, and search.html and results.php is not working in
Redhat 9. 
If I fail to enter a search term, I get the expected error message, but that
is just Apache, it's not even executing any PHP. When I enter a search term,
the results.php page loads with the proper page title, but the rest of the
page is blank.

**However**, the exact same project files work just as expected on my Mac
running OS X though... hmm: which is running Apache 1.3, PHP 4.1.2 and MySQL
4.1.2

So I have to wonder, what am I missing in Redhat ?

What I've done, what I'm doing:

I am learning MySQL and PHP, working through a lovely O'Reilly text.

I have MySQL and PHP and Apache all working fine on an istall of Redhat
Linux 9. I can work with MySQL in the terminal (command-line), and have even
installed MySQL Control Center (a fairly nice GUI).

My hello.php loads fine and returns Hellow world in my web-browser when
I load http://localhost/hello.php

The default Apache page loads, as do a simple index.html file when I put one
in place.

Apache 2 is running, PHP is version 4.2.2, MySQL is 4.0

I checked permissions and ownership of the search.html and results.php
files. My results.php file is setup the same (ownership  executable
flags) as my hello.php file (which does work).

My Apache error log offers nothing helpful. I cannot find any MySQL error
log in Redhat (checked and triple-checked), and
I can't seem to find any php error log. The php.ini file really doesn't
help, in terms of knowing where to look for an error log

===
I know this is long, but I've been as thorough as I know how to be - please
help ! (TIA)



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



Re: [PHP-DB] Failure to interact with MySQL in Redhat 9 ?

2003-08-22 Thread jeffrey_n_Dyke

do you get anything helpful if you set error_reporting(E_ALL) and rerun the
search.  could this be a register_globals issue?  can you print_r($_GET) or
print_r($_POST) depending on how you have defined the FORM action...and if
you can is there anything in those arrays?

hth
Jeff


   
 
  David Haines 
 
  [EMAIL PROTECTED]To:   [EMAIL PROTECTED]  
   
  .netcc: 
 
   Subject:  [PHP-DB] Failure to interact 
with MySQL in Redhat 9 ?  
  08/22/2003 01:07 
 
  PM   
 
   
 
   
 




Hello all. I hope this is the best place to ask this (!)

Problem: verified that PHP, MySQL and Apache are all working fine.
My first little project, and search.html and results.php is not working in
Redhat 9.
If I fail to enter a search term, I get the expected error message, but
that
is just Apache, it's not even executing any PHP. When I enter a search
term,
the results.php page loads with the proper page title, but the rest of the
page is blank.

**However**, the exact same project files work just as expected on my Mac
running OS X though... hmm: which is running Apache 1.3, PHP 4.1.2 and
MySQL
4.1.2

So I have to wonder, what am I missing in Redhat ?

What I've done, what I'm doing:

I am learning MySQL and PHP, working through a lovely O'Reilly text.

I have MySQL and PHP and Apache all working fine on an istall of Redhat
Linux 9. I can work with MySQL in the terminal (command-line), and have
even
installed MySQL Control Center (a fairly nice GUI).

My hello.php loads fine and returns Hellow world in my web-browser when
I load http://localhost/hello.php

The default Apache page loads, as do a simple index.html file when I put
one
in place.

Apache 2 is running, PHP is version 4.2.2, MySQL is 4.0

I checked permissions and ownership of the search.html and results.php
files. My results.php file is setup the same (ownership  executable
flags) as my hello.php file (which does work).

My Apache error log offers nothing helpful. I cannot find any MySQL error
log in Redhat (checked and triple-checked), and
I can't seem to find any php error log. The php.ini file really doesn't
help, in terms of knowing where to look for an error log

===
I know this is long, but I've been as thorough as I know how to be - please
help ! (TIA)



--
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] DISTINCT not working

2003-08-22 Thread Fernando Soto






I havelookingthe MySQL manual for"distinctrow" andI didn't findit, i think you should change for"distinct"


$query="CREATE TABLE IF NOT EXISTS temp3TEMP
 SELECT DISTINCT ROUND($tbl2.Net*.175,2) AS ExpNet175,
 CONCAT($tbl2.Journal,$tbl2.Description) AS CON175
 FROM $tbl2
 WHERE $tbl2.Dept='$rcc'
 AND $tbl2.Net0";


Hope it helps

eLFeR...


---Original Message---


From: Dillon, John
Date: Jueves, 21 de Agosto de 2003 11:03:51 a.m.
To: [EMAIL PROTECTED]
Subject: [PHP-DB] DISTINCT not working

Any ideas on why the DISTINCT would not work in the following testing code:

$query="CREATE TABLE IF NOT EXISTS temp3TEMP
 SELECT DISTINCTROW ROUND($tbl2.Net*.175,2) AS ExpNet175,
 CONCAT($tbl2.Journal,$tbl2.Description) AS CON175
 FROM $tbl2
 WHERE $tbl2.Dept='$rcc'
 AND $tbl2.Net0";

$query="CREATE TABLE IF NOT EXISTS temp3
 SELECT DISTINCTROW temp3TEMP.ExpNet175,
 LEFT(temp3TEMP.CON175,2048) AS CON175
 FROM temp3TEMP
 ORDER BY temp3TEMP.CON175";

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



.







 IncrediMail - Email has finally evolved - Click Here

[PHP-DB] WHERE mydatestamp '2003-08-22 13:13:13'

2003-08-22 Thread Matt Babineau
Hey All-

I'm trying to find things in my database that are greater then Now(),
but the date is stored in a blob (don't ask, I know :-0). Is there a way
I can do that comparison to find things that are in the future?

Thanks, Matt


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



[PHP-DB] It\'s wierd when I\'ve used forms...

2003-08-22 Thread Joe Walker
I've got a form (for sending mail to a user) and the user input is in an
html form using the post method to pass:
textarea name=message rows=10 cols=80 wrap=virtual
along with some other vars to a php page which sends the message using:
mail([EMAIL PROTECTED], $msgSubject, $message, From: $addyFrom);
 
But if you type:
What's it's problem?  I've got flippin' issues!
 
In the message box, it comes in e-mail as:
What\'s it\'s problem?  I\'ve got flippin\' issues!
 
Escaping every apostrophe.  
 
How do I have this not happen?   
 
Thanks in advance.
Joe


Re: [PHP-DB] It\'s wierd when I\'ve used forms...

2003-08-22 Thread Jacob A. van Zanen
You'll have to look into stripslashes function (of the top of my head)

PHP automatically puts slashes around variables


Jack
On Fri, 2003-08-22 at 23:35, Joe Walker wrote:
 I've got a form (for sending mail to a user) and the user input is in an
 html form using the post method to pass:
 textarea name=message rows=10 cols=80 wrap=virtual
 along with some other vars to a php page which sends the message using:
 mail([EMAIL PROTECTED], $msgSubject, $message, From: $addyFrom);
  
 But if you type:
 What's it's problem?  I've got flippin' issues!
  
 In the message box, it comes in e-mail as:
 What\'s it\'s problem?  I\'ve got flippin\' issues!
  
 Escaping every apostrophe.  
  
 How do I have this not happen?   
  
 Thanks in advance.
 Joe


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



Re: [PHP-DB] It\'s wierd when I\'ve used forms...

2003-08-22 Thread Jacob A. van Zanen
I mean in front of special characters off course :-)

Jack
On Fri, 2003-08-22 at 23:40, Jacob A. van Zanen wrote:
 You'll have to look into stripslashes function (of the top of my head)
 
 PHP automatically puts slashes around variables
 
 
 Jack
 On Fri, 2003-08-22 at 23:35, Joe Walker wrote:
  I've got a form (for sending mail to a user) and the user input is in an
  html form using the post method to pass:
  textarea name=message rows=10 cols=80 wrap=virtual
  along with some other vars to a php page which sends the message using:
  mail([EMAIL PROTECTED], $msgSubject, $message, From: $addyFrom);
   
  But if you type:
  What's it's problem?  I've got flippin' issues!
   
  In the message box, it comes in e-mail as:
  What\'s it\'s problem?  I\'ve got flippin\' issues!
   
  Escaping every apostrophe.  
   
  How do I have this not happen?   
   
  Thanks in advance.
  Joe
 


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



Re: [PHP-DB] WHERE mydatestamp '2003-08-22 13:13:13'

2003-08-22 Thread CPT John W. Holmes
From: Matt Babineau [EMAIL PROTECTED]

 I'm trying to find things in my database that are greater then Now(),
 but the date is stored in a blob (don't ask, I know :-0). Is there a way
 I can do that comparison to find things that are in the future?

Option 1: Make a second column of DATETIME and UPDATE Table SET
datetime_column = blob_column and then drive on...

Option 2: Use the CAST() function... SELECT * FROM Table WHERE
CAST(blob_column AS DATETIME)  NOW()

Option 3: SELECT * FROM Table WHERE UNIX_TIMESTAMP(blob_column) 
UNIX_TIMESTAMP(NOW())

I'm sure there are more...

---John Holmes...


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



Re: [PHP-DB] It\'s wierd when I\'ve used forms...

2003-08-22 Thread CPT John W. Holmes
From: Jacob A. van Zanen [EMAIL PROTECTED]
 You'll have to look into stripslashes function (of the top of my head)

 PHP automatically puts slashes around variables

PHP automatically escapes quotes in incoming form data when magic_quotes_gpc
is enabled. If you do not want then, then either disable the setting or use
stripslashes() to remove the escape characters.

---John Holmes...


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



[PHP-DB] Re: Failure to interact with MySQL in Redhat 9 ?

2003-08-22 Thread Roberto Dragva Filho
Hello david,

do you set register_globals  to ON  in /usr/local/lib/php.ini ?
try it.

Roberto

David Haines [EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL PROTECTED]
 Hello all. I hope this is the best place to ask this (!)

 Problem: verified that PHP, MySQL and Apache are all working fine.
 My first little project, and search.html and results.php is not working in
 Redhat 9.
 If I fail to enter a search term, I get the expected error message, but
that
 is just Apache, it's not even executing any PHP. When I enter a search
term,
 the results.php page loads with the proper page title, but the rest of the
 page is blank.

 **However**, the exact same project files work just as expected on my Mac
 running OS X though... hmm: which is running Apache 1.3, PHP 4.1.2 and
MySQL
 4.1.2

 So I have to wonder, what am I missing in Redhat ?

 What I've done, what I'm doing:

 I am learning MySQL and PHP, working through a lovely O'Reilly text.

 I have MySQL and PHP and Apache all working fine on an istall of Redhat
 Linux 9. I can work with MySQL in the terminal (command-line), and have
even
 installed MySQL Control Center (a fairly nice GUI).

 My hello.php loads fine and returns Hellow world in my web-browser
when
 I load http://localhost/hello.php

 The default Apache page loads, as do a simple index.html file when I put
one
 in place.

 Apache 2 is running, PHP is version 4.2.2, MySQL is 4.0
 
 I checked permissions and ownership of the search.html and results.php
 files. My results.php file is setup the same (ownership  executable
 flags) as my hello.php file (which does work).

 My Apache error log offers nothing helpful. I cannot find any MySQL error
 log in Redhat (checked and triple-checked), and
 I can't seem to find any php error log. The php.ini file really doesn't
 help, in terms of knowing where to look for an error log

 ===
 I know this is long, but I've been as thorough as I know how to be -
please
 help ! (TIA)




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003



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