[PHP-DB] Re: ECHO $variable

2006-10-08 Thread Ron Piggott
The database part of this is that I just retrieve $saved_message_title
from mySQL and thought it was already escaped and am not sure what went
wrong with the ECHO

On Sun, 2006-10-08 at 01:32 -0400, Ron Piggott (PHP) wrote:

 In one of my scripts I have
 
 input type=text name=message_title size=40 maxlength=80 value=?echo
 $saved_message_title;?
 
 where
 
 $saved_message_title is 1 Peter 5:7 Cast all your cares on Him for He
 cares about you
 --- note the  
 
 When this is displayed on the screen it reads
 
 1 Peter 5:7 
 
 I am assuming the  closes the value=
 
 How may I echo this to the screen and have the full text be displayed,
 not just 1 Peter 5:7 ?
 
 Ron

-- 
[EMAIL PROTECTED]
www.actsministrieschristianevangelism.org

Acts Ministries Christian Evangelism
Where People Matter
12 Burton Street
Belleville, Ontario, Canada K8P 1E6

In Belleville Phone: (613) 967-0032
In North America Toll Free: (866) ACTS-MIN


Re: [PHP-DB] Re: ECHO $variable

2006-10-08 Thread Niel Archer
Hi

 The database part of this is that I just retrieve $saved_message_title
 from mySQL and thought it was already escaped and am not sure what went
 wrong with the ECHO

That doesn't make it a DB question.  Not even close.  This list is for
matters *directly* concerning DB problems.

replace:

?echo $saved_message_title;?

with:

?echo htmlentities($saved_message_title);?

Niel

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



RE: [PHP-DB] ECHO $variable

2006-10-08 Thread Bastien Koert
easist way is to wrap the entire value in single quotes not double 
quotes...kinda breaks the rules but it will work..the other option is to 
search your value and do a replace on the double quotes


bastien



From: Ron Piggott (PHP) [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: PHP DB php-db@lists.php.net
Subject: [PHP-DB] ECHO $variable
Date: Sun, 08 Oct 2006 01:32:13 -0400

In one of my scripts I have

input type=text name=message_title size=40 maxlength=80 value=?echo
$saved_message_title;?

where

$saved_message_title is 1 Peter 5:7 Cast all your cares on Him for He
cares about you
--- note the 

When this is displayed on the screen it reads

1 Peter 5:7

I am assuming the  closes the value=

How may I echo this to the screen and have the full text be displayed,
not just 1 Peter 5:7 ?

Ron


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



Re: [PHP-DB] SELECT date query

2006-10-08 Thread Bastien Koert

i tend to take the approach of

$next_wed = date(Y-m-d, strtotime(next wednesday));


Bastien


From: Niel Archer [EMAIL PROTECTED]
Reply-To: php-db@lists.php.net
To: php-db@lists.php.net
Subject: Re: [PHP-DB] SELECT date query
Date: Sat, 07 Oct 2006 05:49:36 +0100

Hi Ron

I've made the assumption that if today is Wednesday, you still want next
Wednesday.
Try this:

$offset = array(3,2,1,7,6,5,4);
$date = explode(-, date(Y-n-j));
$ToDay = DayOfWeek($date[0], $date[1], $date[2]);
$NextWed = date(Y-n-j, time() + ($offset[$ToDay] * 24 * 60 * 60));

// Returns a digit in range 0-6. 0 = Sunday, 6 = Saturday
function DayOfWeek($Year, $Month, $Day)
{
$t = array(0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4);
$Year -= $Month  3;
return ($Year + ($Year / 4) - ($Year / 100) + ($Year / 400) +
$t[$Month - 1] + $Day) % 7;
}


Niel

--
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] ECHO $variable

2006-10-08 Thread Jan Bailleul

You can as well add a backslash BEFORE the 

eg. echo text \more text\ ;

So that will return this: 
   text more text
- Original Message - 
From: Bastien Koert [EMAIL PROTECTED]

To: [EMAIL PROTECTED]; php-db@lists.php.net
Sent: Sunday, October 08, 2006 3:35 PM
Subject: RE: [PHP-DB] ECHO $variable


easist way is to wrap the entire value in single quotes not double 
quotes...kinda breaks the rules but it will work..the other option is to 
search your value and do a replace on the double quotes


bastien



From: Ron Piggott (PHP) [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: PHP DB php-db@lists.php.net
Subject: [PHP-DB] ECHO $variable
Date: Sun, 08 Oct 2006 01:32:13 -0400

In one of my scripts I have

input type=text name=message_title size=40 maxlength=80 value=?echo
$saved_message_title;?

where

$saved_message_title is 1 Peter 5:7 Cast all your cares on Him for He
cares about you
--- note the 

When this is displayed on the screen it reads

1 Peter 5:7

I am assuming the  closes the value=

How may I echo this to the screen and have the full text be displayed,
not just 1 Peter 5:7 ?

Ron


--
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] mysqli auto rollback on script termination

2006-10-08 Thread Martin Koch Andersen

Hi,

In case the PHP script dies (from fatal error, die() or similar), is any 
started transaction (BEGIN TRANSACTION) automatically rolled back 
(ROLLBACK) by PHP then?


I can't find any documentation about this.

Thanks in advance for hints, links etc.

--
Martin - http://925.dk
Shoot for the moon, even if you miss, you'll land among the stars.

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



Re: [PHP-DB] mysqli auto rollback on script termination

2006-10-08 Thread Chris

Martin Koch Andersen wrote:

Hi,

In case the PHP script dies (from fatal error, die() or similar), is any 
started transaction (BEGIN TRANSACTION) automatically rolled back 
(ROLLBACK) by PHP then?


It should be rolled back when a connection is lost or a transaction 
isn't explicitly committed.


Whether that's a php script dying or the server being shut down 
mid-transaction or anything similar (eg a remote server's lan connection 
goes down).


Of course this assumes you're using innodb tables and not myisam - 
myisam doesn't support transactions..


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] Files uploaded through a form

2006-10-08 Thread Chris

Ron Piggott (PHP) wrote:

The way my web hosting server was configured is that files uploaded
through a web form to be processed by PHP are owned by 'www'.  I am
wondering if I am able to change the owner of the file to my ftp user
name before I use the move_uploaded_file command to the directory I need
the file to move to.  


No. Only the 'root' user on the server can change file ownership.


I am also wondering what the IF syntax is to see if the file upload was
successful.  Somehow I would like to know if 


move_uploaded_file( $userfile , $destination_file_name);


RTFM:
http://php.net/move_uploaded_file

If filename is not a valid upload file, then no action will occur, and 
move_uploaded_file() will return FALSE.


If filename is a valid upload file, but cannot be moved for some reason, 
no action will occur, and move_uploaded_file() will return FALSE. 
Additionally, a warning will be issued.


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] two versions of php on same box, on has mysql support the other can't find it?

2006-10-08 Thread Chris

Eddie Peloke wrote:

I have two php versions on one server.  One of them has mysql support, the
other has mssql support and is used to run scripts via the comand line.  I
am trying now to compile in mysql support to the command line one and I 
keep

getting:

configure: error: Cannot find MySQL header files under yes.

checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find MySQL header files under 
/usr/lib/php/modules.

Note that the MySQL client library is not bundled anymore!


That wasn't your configure line at all - this gives it away:

Cannot find MySQL header files under yes.


You need to tell php where mysql is:

--with-mysql=/usr

or

--with-mysql=/usr/local/mysql

or whatever the case may be on your server.

--
Postgresql  php tutorials
http://www.designmagick.com/

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