Odp: [PHP-DB] Text Control.
Od: "simon" <[EMAIL PROTECTED]> Temat: Re: [PHP-DB] Text Control. > Ian wrote: > > > Dear Sir / Madam, > > > > Problem :- > > Data from HTML > WRAP="virtual"> is likes, > > This is a testing messages:- > > 1. MSG A. > > 2. MSG B. > > 3. MSG C. > > > > So, I insert $test into MYSQL database. After that, I login into MYSQL and > > select the test field, the display is same as above. But, when I used PHP > > coding to select the test field and display it in HTML page, output likes, > > This is a testing messages:- 1. MSG A. 2. MSG B. 3. MSG C. > > > > How to display $test in the requested format? > You could try using the nl2br function, thus converting all newline > characters to tags. > > http://uk.php.net/manual/function.nl2br.php Eventually you can show contents of this field using tags - it's specially useful in situation like this: - in you enter text like MSG A MSG B <- note two [spaces] here MSG C <- here are four [spaces] - when you show it in html document you see exactly the same thing. Cheers Jarek Zgoda -- 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] Desperate Help needed
Hi, I made a database chatroom that seemed to be working perfectly fine - now, it seems, if more than two people log in, the 1st person of the three automatically gets logged out - its because i tried to make an automatic log off for those who cross the window How do you detect if a person has closed the window (hence killing the cookie) without logging off (so the database still has him listed, and therefore is shown to be online)? Here's the scenario: 1. one table lists the chatters' names 2. second table has 25 rows for each messages, they keep getting replaced as the new messages come in the problem: the chatters table lists those users who logged out ages ago... thanks.
Re: [PHP-DB] Desperate Help needed
Set up an expire time... if a user hasn't accessed the page showing the room's activity (where all the messages are shown) within, say, 3 minutes, then the next request that comes in, regardless of who makes it, should remove the timed-out user from the list. It's important, of course, to make sure all of the chat windows are refreshing faster than your timeout value; a refresh rate of 3 minutes or more wouldn't be very convenient anyway ;) --Toby - Original Message - From: "sarahana" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, January 14, 2001 11:04 AM Subject: [PHP-DB] Desperate Help needed Hi, I made a database chatroom that seemed to be working perfectly fine - now, it seems, if more than two people log in, the 1st person of the three automatically gets logged out - its because i tried to make an automatic log off for those who cross the window How do you detect if a person has closed the window (hence killing the cookie) without logging off (so the database still has him listed, and therefore is shown to be online)? Here's the scenario: 1. one table lists the chatters' names 2. second table has 25 rows for each messages, they keep getting replaced as the new messages come in the problem: the chatters table lists those users who logged out ages ago... thanks. -- 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] Desperate Help needed
It's probably alot more efficient to set up a scheduled job which
removes timed out users every minute. This keeps your 'check and see if
the user is expired' code from running any more frquently than it needs
to be.
george
Toby Butzon wrote:
>
> Set up an expire time... if a user hasn't accessed the page
> showing the room's activity (where all the messages are
> shown) within, say, 3 minutes, then the next request that
> comes in, regardless of who makes it, should remove the
> timed-out user from the list.
>
> It's important, of course, to make sure all of the chat
> windows are refreshing faster than your timeout value; a
> refresh rate of 3 minutes or more wouldn't be very
> convenient anyway ;)
>
> --Toby
>
> - Original Message -
> From: "sarahana" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, January 14, 2001 11:04 AM
> Subject: [PHP-DB] Desperate Help needed
>
> Hi,
> I made a database chatroom that seemed to be working
> perfectly fine - now, it seems, if more than two people log
> in, the 1st person of the three automatically gets logged
> out - its because i tried to make an automatic log off for
> those who cross the window
>
> How do you detect if a person has closed the window (hence
> killing the cookie) without logging off (so the database
> still has him listed, and therefore is shown to be online)?
>
> Here's the scenario:
> 1. one table lists the chatters' names
> 2. second table has 25 rows for each messages, they keep
> getting replaced as the new messages come in
>
> the problem: the chatters table lists those users who logged
> out ages ago...
>
> thanks.
>
> --
> 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]
--
$_ = 'George Schlossnagle';
s#.#(ord$')-(ord$&)+((index($_,$')-$&)?1002:0)#ego;s#-#((substr($],4,1)-6)?67:$-[0])#eog;$:=$_;print
join('',(map chr$_,reverse
map{substr($:,(3*$_),3)+(11,-109,-14,94,-894,-28,-61,-202,-417,83,-20,-678,53,96,4,-494,82,-869,-826,24,16,-684,-450,-27)[$_]}(0...length($_)/3)),chr(length($_)/2+ord$/),$/);
--
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] suscribe
_ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- 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] Problem width SQL on PHP4
I need to run SQL funtions on my PHP scripts, the server is an NT4 width service pack 6. I setup php4 and it working ok, but wen i want to run SQL functions (like mssql_connect()) it show me a message saying i have use a non supported funtion. Some idea ?... ill apreciate so much your help !!... THANKS ! _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- 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 "confirm" function?
Ok, I am trying to add a "yes"/"no" dialog for a delete operation and I was
attempting this via the javascript "confirm" function, but no matter if I
click yes or no, the php code block still executes. I tried this way:
-
if(!confirm("Are you sure you wish to delete this section? This will delete
all llamas in this section as well!!")) {
document.location.href="llama.php3";
} else{
open();
if(!$db->execute("delete from lf_llamas where lfl_lfs_id = $id"))
die(print $db->geterror() . " while deleting from lf_llamas.");
if(!$db->execute("delete from lf_sections where lfs_id = $id")) die(print
$db->geterror() . " while deleteing from lf_sections.");
$db->close();
?>
}
document.location.href="llama.php3";
-
thinking that the second code block would not be executed if they clicked
"no".
Does PHP have a native function for yes/no dialogs? I searched the docs and
couldn't find anything :(
Any help would be appreciated!
Sean Finkel
--
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] Problem width SQL on PHP4
you need to "enable" the mssql extension. I don't have the php.ini file here with me, but search the ini file for "extension" and you should come to a list of them that are commented out. just uncomment (by deleting the leading ";") the one for the extension you need and then shut down IIS and restart it. Sean -Original Message- From: Sebastian A. Davicco [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 14, 2001 2:20 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Problem width SQL on PHP4 I need to run SQL funtions on my PHP scripts, the server is an NT4 width service pack 6. I setup php4 and it working ok, but wen i want to run SQL functions (like mssql_connect()) it show me a message saying i have use a non supported funtion. Some idea ?... ill apreciate so much your help !!... THANKS ! _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- 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 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] PHP "confirm" function?
> Ok, I am trying to add a "yes"/"no" dialog for a delete
operation and I was
> attempting this via the javascript "confirm" function, but
no matter if I
> click yes or no, the php code block still executes. I
tried this way:
It'll work...
>
> if(!confirm("Are you sure you wish to delete this section?
This will delete
> all llamas in this section as well!!")) {
> document.location.href="llama.php3";
> } else{
> $db = NewDatabase("MySQL", "fusion", "5xc7hn3",
"fusion", "localhost");
> $db->open();
> if(!$db->execute("delete from lf_llamas where lfl_lfs_id
= $id"))
> die(print $db->geterror() . " while deleting from
lf_llamas.");
> if(!$db->execute("delete from lf_sections where lfs_id =
$id")) die(print
> $db->geterror() . " while deleteing from lf_sections.");
> $db->close();
> ?>
> }
> document.location.href="llama.php3";
>
> -
>
> thinking that the second code block would not be executed
if they clicked
> "no".
Think back to the order that this stuff is going to be
processed... PHP is server side, and the code is going to be
executed on the server before it even goes back to the
browser. Thus your db record will be deleted either way.
The way I do this is to create a JavaScript function on the
first page (the one with the buttons/links to delete stuff)
that looks something like this:
function dbDelete(strDescription, itemId) {
if (confirm('Warning:\n\nYou are about to delete ' .
strDescription . '.\n\nDo you wish to proceed?'))
location.href='path/to/delete/file.php?id=' .
itemId;
}
And let file.php perform the deletion and return to where
ever is an appropriate return location.
> Does PHP have a native function for yes/no dialogs? I
searched the docs and
> couldn't find anything :(
It doesn't because it's processed server-side and not
client-side...
--Toby
--
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] Boolean values in MySQL
I'm using tinyint. If you are afraid of data volume I think char(1) with
"T/F" values uses less disk space but requires more sophisticated code to
deal with.
Jayme.
http://www.conex.com.br/jjeffman
-Mensagem Original-
De: Cal Evans <[EMAIL PROTECTED]>
Para: <[EMAIL PROTECTED]>
Enviada em: sábado, 13 de janeiro de 2001 22:35
Assunto: [PHP-DB] Boolean values in MySQL
> Question to those of you using MySQL.
>
> What is the accepted practice for storing boolean values? Do you use a
> tinyInt 0=false 1=true or an enum("T","F")? Or is there another way I'm
not
> seeing?
>
> Cal
> *
> * Professional Nerd Herder
> * http://www.calevans.com
> *
>
>
> --
> 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 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] Desperate Help needed
You probably has configured your chat client page to make a timely refresh, so the user can get new messages every time the page is refreshed. I don't know if you allow the user to set up the refresh interval, any way you can have a logged users table with their login time and last refresh time. If current time is (for security) n times the refresh interval ( say twice ) you may log them out. Be careful with users connection speed ! You have all the control of your database so you know if the user didn't refresh the chat page in the last n refresh period. Messy ? HTH. Jayme. http://www.conex.com.br/jjeffman -Mensagem Original- De: sarahana <[EMAIL PROTECTED]> Para: <[EMAIL PROTECTED]> Enviada em: domingo, 14 de janeiro de 2001 14:04 Assunto: [PHP-DB] Desperate Help needed Hi, I made a database chatroom that seemed to be working perfectly fine - now, it seems, if more than two people log in, the 1st person of the three automatically gets logged out - its because i tried to make an automatic log off for those who cross the window How do you detect if a person has closed the window (hence killing the cookie) without logging off (so the database still has him listed, and therefore is shown to be online)? Here's the scenario: 1. one table lists the chatters' names 2. second table has 25 rows for each messages, they keep getting replaced as the new messages come in the problem: the chatters table lists those users who logged out ages ago... thanks. -- 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-using a result set
Hi, Is there some similar function available for oracle too ? thanks, Markus On Thu, Jan 11, 2001 at 03:18:25PM -0500, Finkel, Sean wrote : > Try calling: > > mysql_data_seek($connection, 0); > > then looping through again. This should reset the row pointer to the first > row so that you can go through again :) -- Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -- 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] Problem with oci8
On Fri, Jan 12, 2001 at 11:23:50PM +0100, Victor Foitzik wrote : > > I read in the FAQ that if MySql libs are linked with pthread, pthread > >should be removed from mysql libs to apache get started. I'm having also some problems with oracle too; can you point me to the FAQ where you read this ? thanks, Markus -- Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -- 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] Transactions. How?
The likest solution for you problem seems to be session. Start a session on the first page. On the next page validate every variable and if all went ok, bind it to the current session. Don't forget to make a page counter so no one can jump easily from page one to four. After your last form action and validation put all your data in the database and you are done. If you don't know about session, try reading the following http://www.php.net/manual/en/ref.session.php . kind regards, Markus On Wed, Jan 10, 2001 at 11:24:37AM -0400, Marko Perich wrote : > I need to make a transaction over several pages and commit it after > validating the last one. > I am using linux+apache+php4 module+Informix. -- Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -- 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] search engine
Hi,
Databases tend not to be the best solution for text index
searching what you want. There are better products like glimpse
that do what you want.
M.
On Wed, Jan 10, 2001 at 03:08:14PM +0100, Luescher Samuel (MMVZSLU) wrote :
> hi there. i am currently developing an active contant engine for fully
> dynamic web sites (php4/mysql). now what is a db-powered site without search
> functionality? nothing. thus, i want to implement an internal search engine.
>
> in a nutshell, i have all my content ("pages") stored in a table. the
> columns "name" (unique entry title) and "body" are interesting here. now
> searches on a topic are no problem, i can simply perform "name LIKE .."
> queries. the thing is, if there are no exact matches, how can i return a
> virtually unlimited list of near matches, using nothing but sql queries?
> furthermore, i want full-text search. the bodies are blobs. is there a way
> to get all the items containing a string, most hits on top? what's the
> trick, maybe regular expressions?
--
Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/
EMail: [EMAIL PROTECTED]
PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc
PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0
--
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] OCI8 and Listener
Hi, i've compiled my php modul with oci8.But I can't connect to my db. It tells me the error ORA-12162. In the documentation there is no such error mentioned. Do I need to start to Oracle listner? Is tere somebody who had solved this problem in the past? Thanks Stefan -- 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]
