[PHP-DB] odbc_pconnect doesnt reuse connection

2002-04-02 Thread Maris Kalnins
Hi! Configuration: WinXP, the latest Apache, PHP4 The problem is that every time the script runs and the following command is executed $cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw); it happens very often that a new connection is created instead of reusing the old one! Is there any idea w

RE: [PHP-DB] Selecting random record from a database?

2002-04-02 Thread Beau Lebens
SELECT * FROM quotes ORDER BY RAND() LIMIT 1 something like that, take a quick look in the MySQL (or other) docs for the RAND() function. HTH Beau // -Original Message- // From: Dan Swensen [mailto:[EMAIL PROTECTED]] // Sent: Wednesday, 3 April 2002 1:45 PM // To: [EMAIL PROTECTED] //

[PHP-DB] Selecting random record from a database?

2002-04-02 Thread Dan Swensen
Hi all, Does anyone know a quick and easy way to select a random record from a database? I'm looking to put together a simple random quote generator, a la linux's "fortune." Any help would be much appreciated. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://ww

[PHP-DB] Re: odbc_pconnect

2002-04-02 Thread Peter Vereshagin
On Tue, 2 Apr 2002 18:27:40 +0300, Maris Kalnins <[EMAIL PROTECTED]> wrote: > $cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw); > > But unfortunately connection closes automatically when script is done! > What must I do to keep connection alive and be able to use $cx again and > again without

Re: [PHP-DB] Re: Database search question

2002-04-02 Thread olinux
I have a similar search. My table setup looks like this TABLE vendors: [ id | category_id | bla | bla | city | state | zip ] TABLE key_list: [ id | category_id | word ] sample data in key_list (category #1 - auto repair) [ 1 | 1 | automobile ] [ 2 | 1 | car ] [ 3 | 1 | repair ] [ 3 | 4 | autom

[PHP-DB] Re: autoincrement

2002-04-02 Thread Glenn Holden
First, I think an AUTO_INCREMENT column must be a numeric column, not TEXT. Second, be sure this column is indexed. If you have trouble, send us the results of a DESCRIBE TABLE `ajj47592`.`content`; statement. That may help us give you some specific syntax to try. Glenn "Daniel Broome" <[E

[PHP-DB] Re: autoincrement

2002-04-02 Thread Daniel Broome
Here is the info that I used, I know that there is something else that I have to add but I have done everything that I know... Please help... SQL-query : ALTER TABLE `ajj47592`.`content` CHANGE `code` `code` TEXT NOT NULL AUTO_INCREMENT MySQL said: Incorrect column specifier for column 'code'

[PHP-DB] Re: autoincrement

2002-04-02 Thread Daniel Broome
Here is the info that I used,I think there is something elce that I have to do but I have done everything to my know how.. Please help SQL-query : ALTER TABLE `ajj47592`.`content` CHANGE `code` `code` TEXT NOT NULL AUTO_INCREMENT MySQL said: Incorrect column specifier for column 'code' "

Re: [PHP-DB] PHP & MySql

2002-04-02 Thread Mike Meighan
Thanks, just as I had hit send on that messege, the thought of passing the session ID via a querystring hit me. I'm using linux for MySql and Secure Server processing so as data is being collected from various users while on the NT box, when it comes time for secure server type transactions, I tr

Re: [PHP-DB] need some help...

2002-04-02 Thread Alex Behrens
Awesome, thanks a ton! Thanks! -Alex "Big Al" Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-u

RE: [PHP-DB] PHP & MySql

2002-04-02 Thread Shrock, Court
You could store session vars that are set on the NT box in mssql and then pass them to the linux box with the session id in the querystring and then have the linux box verify and fetch the session data from the MSSQL server...problem solved. www.freeTDS.org is where you can get the necessary libs

[PHP-DB] PHP & MySql

2002-04-02 Thread Mike Meighan
I need a good suggestion as I've been a Microsoft ASP developer but now getting more into PHP. It appears there are some issues about session ID's, cookies, and passing data from an NT box to PHP running on a Linux box. Would you folks reccommend I first stuff the data into the Linux box via MySq

RE: [PHP-DB] need some help...

2002-04-02 Thread Shrock, Court
If you want your output to validate xhtml, you had better make sure that your html looks like: Link and NOT: Link > -Original Message- > From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 02, 2002 4:52 PM > To: '[EMAIL PROTECTED]' > Cc: '[EMAIL PROTECTED]' > Su

FW: [PHP-DB] need some help...

2002-04-02 Thread Peter Lovatt
hi Alex basically you load a variable with the contents of the page, and then write the contents of the variable to the file hope this helps Peter '; $db = mysql_connect( "db", "**", "**"); mysql_select_db( "net3dual_reviews",$db

RE: [PHP-DB] need some help...

2002-04-02 Thread Jonathan Hilgeman
Thank you. Someone else exists who has the sense of mind to use single quotes. I hate looking at other people's code that has tons of \"s in it. - Jonathan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 02, 2002 5:00 PM To: [EMAIL PROTECTED] Su

Re: [PHP-DB] need some help...

2002-04-02 Thread szii
Not really a database question, but why not... Step 1: Clean up the code... a) Convert all double-quote to single quotes in the HTML portion. I usually use doubles for PHP and singles for HTML. I hate having to escape quotes. b) Use of spacing an

[PHP-DB] need some help...

2002-04-02 Thread Alex Behrens
Hey Guys, I'm new to this list and I need some help outputing some code to a .shtml file instead of using a dynamic php file. Can someoneh elp me get this working? I have a script that outputs headlines for reviews and I need to output it to a file for inserting into my page, because I can't us

[PHP-DB] XSLT wihout Sablotron

2002-04-02 Thread Christian Weichel
Hi, does anybody know a way to use XSLT and PHP without Sablotron and Xerces or what ever is needed for it? greetz Christian W. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] XSLT wihout Sablotron

2002-04-02 Thread Christian Weichel
Hi, does anybody know a way to use XSLT and PHP without Sablotron and Xerces or what ever is needed for it? greetz Christian W. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] odbc vs mysql

2002-04-02 Thread Maris Kalnins
When connecting to database (Sybase) through ODBC it takes some time to establish odbc connection with: $cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw); And only after that I am able to access data through SQL Selects The problem is that every time the script is finished this connection is

Re: [PHP-DB] how to get consistent UTC from gmmktime (w/o dst-offset) ????

2002-04-02 Thread Patrick Sibenaler
I'm getting my brain fried on this. Tried to figure out the results of you code. I think you're at the point where I really started to get worried. So I tried to put it into a more simple question: Why doesn't gmmktime(15,1,0,11,1,2002) return the SAME number (= epoch timestamp) when execut

[PHP-DB] invalid link resource after deserialization

2002-04-02 Thread Hrvoje Bogunovic
Hi all, I have a problem that I loose connection_id (i.e. it gets set to 0) when I propagate object through session. This results in an error message when I use this connection. Warning: Supplied argument is not a valid PostgreSQL link resource Object has member variable $db which is of PEAR_DB

Re: RE: [PHP-DB] mail()

2002-04-02 Thread Adam Voigt
The last parameter of the mail command is for email headers, if you pass in just a single email address it doesn't know what you want to do with that since thats not a valid header. If you don't know what your doing with the last parameter then you don't need to have it, and should omit it, as it

Re: [PHP-DB] mail()

2002-04-02 Thread Adam Voigt
You know that $fromaddress must have the correct header's to, right? Like just "[EMAIL PROTECTED]" will not be interepreted but something like "Reply-to:[EMAIL PROTECTED]" will set the Reply-to header correctly. Also, did you try taking out the dynamic values and just entering a hardcoded test w

Re: [PHP-DB] mail()

2002-04-02 Thread Maureen
You do not show where $fromemail, $friendemail and $fromname are defined. Shouldn't $toaddress be the first item in your mail function? Try echoing these 3 variables to make sure it is what you think it should be. HTH MB James Kupernik <[EMAIL PROTECTED]> said: > I'm trying to run a mail func

[PHP-DB] mail()

2002-04-02 Thread James Kupernik
I'm trying to run a mail function .. the program is running, but I'm not getting the email. Here is the code .. any one have any ideas? $toaddress = $friendemail; $subject = "A message from ".$fromname."."; $mailcontent = "Here's a special message from a friend" ."Your friend, ".

[PHP-DB] odbc_pconnect

2002-04-02 Thread Maris Kalnins
Hi All! I have a situation where I need to keep connection still active after php script is done and page displayed! I tried to use $cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw); But unfortunately connection closes automatically when script is done! What must I do to keep connection aliv

[PHP-DB] Re: Variable names

2002-04-02 Thread kodrik
Kodrik wrote: > If I have a variable, how do I extract the name of the variable. > > In principle: > > $varname=somefunction($myvar); > > The value of $varname is then "myvar" > > How do I do it? Sorry, this was meant for the general list. You an still reply though :) -- PHP Database Maili

[PHP-DB] Variable names

2002-04-02 Thread kodrik
If I have a variable, how do I extract the name of the variable. In principle: $varname=somefunction($myvar); The value of $varname is then "myvar" How do I do it? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] autoincrement

2002-04-02 Thread Rick Emery
what command are you using? When posting questions, give all details...wee can't read your mind -Original Message- From: Daniel Broome [mailto:[EMAIL PROTECTED]] Sent: Monday, April 01, 2002 9:33 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] autoincrement I am trying to add auto increment

RE: [PHP-DB] figuring out number of months between two dates

2002-04-02 Thread Rick Emery
select PERIOD_DIFF(DATE_FORMAT("2002-04-01","%Y%m"), DATE_FORMAT("2001-0801","%Y%m") ) as dd; +--+ | dd | +--+ |8 | +--+ 1 row in set (0.00 sec) -Original Message- From: John Hughes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 02, 2002 2:28 AM To: [EMAIL PROTECTED] S

[PHP-DB] Re: Fill select boxes with dependent data from a database. How?

2002-04-02 Thread Marij Bellen
-Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Verzonden: Friday, March 29, 2002 11:44 AM Aan: [EMAIL PROTECTED] Onderwerp: failure notice Hi. This is the qmail-send program at pb1.pair.com. I'm afraid I wasn't able to deliver your message to the following a

[PHP-DB] Re: menues problem

2002-04-02 Thread Marij Bellen
You don't have to reload three times!!! Just make the first two in static html and the third one with PHP like this: $category_array[category_name]"; } ?> MVG Marij - The information included in this message is personal and/or confidential and in

[PHP-DB] Re: date problem

2002-04-02 Thread Marij Bellen
-Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Verzonden: Friday, March 29, 2002 11:59 AM Aan: [EMAIL PROTECTED] Onderwerp: failure notice Hi. This is the qmail-send program at pb1.pair.com. I'm afraid I wasn't able to deliver your message to the following a

[PHP-DB] Re: text area

2002-04-02 Thread Marij Bellen
I have some code that could help you, Omschrijving:* Hope its enough, else mail me! Marij Bellen "Jas" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am wondering where I could find a good tutorial on displaying the contents > of a d

[PHP-DB] RE: failure notice

2002-04-02 Thread Marij Bellen
Got a function that migth do both thricks at once (found on PHP.NET: function valid_email($email) { #if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$", $email, $check)) if (eregi("^[0-9a-z_]([_\.-]?[0-9a-z])*@[0-9a-z][0-9a-z\.-]*\.[a-z]{2,4}\.?$", $em

[PHP-DB] RE: failure notice

2002-04-02 Thread Marij Bellen
You need to realize that sessions works in that way the same as headers. You can use session_start() when you have already outputted data. Always use sessions (like headers) at top of page!! "Killer Angel Clark" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >

[PHP-DB] dbase-mysql-php

2002-04-02 Thread Marij Bellen
I know its possible to use a .dbf file for input. Does anyone have an example how i can search through an .dbf - file? Thanks Mary -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] cookie question

2002-04-02 Thread wesley grubbs:.
i set up a form a while back where people submit urls that are written to a db. the form is fully validated.. only...I have been getting several double submissions of the same url. so i want to prevent this from happening. javascript is out of the question. for a pop-up window.. to put an anti-d

Re: [PHP-DB] figuring out number of months between two dates

2002-04-02 Thread Remco Oosten
Does this help? select 12*(year(current_date)-year('2001-03-02'))+(month(current_date)-month('2001- 03-15')); the result is 13. But it's quite a large query. - Original Message - From: "John Hughes" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 02, 2002 9:56 AM Subje

Re: [PHP-DB] figuring out number of months between two dates

2002-04-02 Thread John Hughes
I'm trying to get PERIOD_DIFF to work in my quest to count months between dates. I've run into a stumbling block: LEFT(CURRENT_DATE,7) produces 2002-04, as you would expect. LEFT(week_date,7) WHERE week_no = '1' produces 2001-08, again as expected (see table below) But PERIOD_DIFF(LEFT(CURRENT