[PHP-DB] php and oracle
Hallo, I have problems installing php in Linux Mandrake 7.2. Php work, but I can't see the oracle funcions. I guessed I had to recompile the source. I have downloaded the latest version of php from php.net. I unzipped the file in /tmp but when I write ./configure the program go in abend with this message: creating cache ./config.cache checking for a BSD compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking whether make sets ${MAKE}... yes checking for working aclocal... missing checking for working autoconf... missing checking for working automake... missing checking for working autoheader... missing checking for working makeinfo... missing Updated php_version.h checking whether to enable maintainer-specific portions of Makefiles... no checking host system type... i586-pc-linux-gnu checking for gawk... gawk checking for bison... no checking for byacc... no configure: warning: You will need bison if you want to regenerate the PHP parsers. checking for gcc... gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... yes checking whether gcc accepts -g... yes checking how to run the C preprocessor... gcc -E checking for AIX... no checking for gcc option to accept ANSI C... none needed checking for ranlib... ranlib checking whether gcc and cc understand -c and -o together... yes checking whether ln -s works... yes checking for flex... lex checking for yywrap in -ll... no checking lex output file root... ./configure: lex: command not found configure: error: cannot find output from lex; giving up what is lex??? and where I did wrong? thank you very much. Bye Marco R. -- 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 and MySQL queries...
How about using 3 select menus: * One for the day called 'dayselect' * One for the month called 'monthselect; * One for the year called 'yearselect' When you get the values from the selects to perform query's upon, re-arrange the order the dates come in: In your form they'll be in the order: day,month,year To perform queries into a MySQL DB re-arrange them: $date = $yearselect . - . $monthselect . - . $yearselect; HTH Russ On Tue, 23 Oct 2001 10:52:41 -0600 Jason [EMAIL PROTECTED] wrote: I am having a hard time setting up a form for users to enter a date in the format of 00/00/ (of course they would use an actual date). My form is as follows... form name=auth method=post action=search.php p*I.E. - Format is 04/01/2001*/p pSearch for Ads by date: input type=text name=date /p p input type=submit name=login value=Submit input type=reset name=reset value=Reset /p /form On my search.php page I have the following MySQL connection and search parameters... ?php mysql_connect (db_hostname, db_username, db_password); mysql_select_db (db_name); if ($date == ) {$date = '%';} $result = mysql_query (SELECT fname,lname,address,city,state,zip,phonea,phone,email,crty,crnum,crmo,cryr,w eeks,ogden,rock,logan,ipaddress,ad,total,num,date,time FROM ads WHERE date LIKE '%$date%' LIMIT 0, 30 ); $count = -1; if ($row = mysql_fetch_array($result)) { $count ++; do { echo BName: /B; printf(mysql_result($result,$count,fname)); echo ; printf(mysql_result($result,$count,lname)); echo BR\n; echo BAddress: /B; printf(mysql_result($result,$count,address)); echo BR\n; echo BCity: /B; printf(mysql_result($result,$count,city)); echo BR\n; echo BState: /B; printf(mysql_result($result,$count,state)); echo BR\n; echo BZip: /B; printf(mysql_result($result,$count,zip)); echo BR\n; echo BPhone: /B(; printf(mysql_result($result,$count,phonea)); echo ) ; printf(mysql_result($result,$count,phone)); echo BR\n; echo BEmail: /B; printf(mysql_result($result,$count,email)); echo BR\n; echo BCredit Type: /B; printf(mysql_result($result,$count,crty)); echo BR\n; echo BCredit Number: /B; printf(mysql_result($result,$count,crnum)); echo BR\n; echo BCredit Card Date: /B; printf(mysql_result($result,$count,crmo)); echo ; printf(mysql_result($result,$count,cryr)); echo BR\n; echo BWeeks: /B; printf(mysql_result($result,$count,weeks)); echo BR\n; echo Btown1: /B; printf(mysql_result($result,$count,town1)); echo BR\n; echo Btown2: /B; printf(mysql_result($result,$count,town2)); echo BR\n; echo Btown3: /B; printf(mysql_result($result,$count,town3)); echo BR\n; echo BIP Address: /B; printf(mysql_result($result,$count,ipaddress)); echo BR\n; echo BAd: /B; $ad[$count] = (mysql_result($result,$count,ad)); $ad[$count] = ereg_replace (a, ', $ad[$count]); $ad[$count] = ereg_replace (q, \, $ad[$count]); $ad[$count] = ereg_replace (p, %, $ad[$count]); $ad[$count] = ereg_replace (bs, \\, $ad[$count]); echo $ad[$count]; echo BR\n; echo BTotal: /B; printf(mysql_result($result,$count,total)); echo BR\n; echo BAd Number: /B; printf(mysql_result($result,$count,num)); echo BR\n; echo BDate: /B; printf(mysql_result($result,$count,date)); echo BR\n; echo BTime: /B; printf(mysql_result($result,$count,time)); echo BR\n; } while($row = mysql_fetch_array($result)); } else {print Sorry, no records were found!;} ? So far I have come to the conclusion that the input from the user is probably where my problem is because I am assuming it is taking the / in the date they enter and doing something I don't want it to. In any event if someone could give me a clue as to how to resolve this issue it would be greatly appreciated. -- 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] #---# Believe nothing - consider everything Russ Michell Anglia Polytechnic University Webteam Room 1C 'The Eastings' East Road, Cambridge e: [EMAIL PROTECTED] w: www.apu.ac.uk/webteam www.theruss.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] Re: ADORecordset Equivalent in PHP?
Try http://php.weblogs.com/adodb This is a database wrapper library which is very similar to M'soft ADO. Very fast and full featured. Mrbaseball34 [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I know about mysql_fetch_array but how would I do it for each row into a recordset that I can use instead? -- 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: RE: [PHP-DB] looped insert
Just thought this would be helpful... I've found the occassional problem with trying to insert a script-generated null value (rare but it does happen). If this becomes a problem, remember that NULL is just another word for nothing. MySQL will accept either of the following: INSERT INTO table VALUES ('value1', 'value2', NULL, 'value3'); INSERT INTO table VALUES ('value1', 'value2', , 'value3'); NOTE: I didn't read the entire post below...it's too early in the morning to think about code. I'm off to populate some site content until my brain catches up with the clock. Mike Frazer Russ Michell [EMAIL PROTECTED] wrote in message news:SIMEON.10110231044.D@k1c. anglia.ac.uk... Hi Rick: Cheers for the info. Thwe following code almost does it, however, the NULL value isn't inserted, if checkboxes are != to 'yes': //If submit button selected, process those ticked checkbox categories: if(isset($submit)) { //Start off sql $sql = INSERT INTO $myanet02 (staffdev,strategies,rules,news,information,policies) VALUES(; //loop while categories have been ticked for($i=0;$icount($category);$i++) { if($category[$names] == 'yes') { $sql .= '$email',; } else { $sql .= NULL,; } } //Remove the last comma $sql = substr($sql,0,-1).); //$query = mysql_query($sql,$connect) or die(mysql_error()); echo $sql; } I believe the problem to be this line: 'if($category[$names] == 'yes') {' //Use this and NULL values aren't inserted 'if($HTTP_POST_VARS[category${$i}] == 'yes') {' //Use this and ONLY NULL values are inserted The values are taken from the checkboxes thus: //Get all table column names, dynamically display them and use to process subscriptions: $fields = mysql_list_fields($dbName, myanet_categories, $connect); $columns = mysql_num_fields($fields); for ($i=0; $i$columns; $i++) { $names = mysql_field_name($fields, $i) . \n; $catselect .= b$names /binput type=\checkbox\ name=\category[$names]\ value=\yes\br\n; } You can see it happening at: http://gertrude.anglia.ac.uk/intranet/myanet/index.php Many thanks. Russ On Mon, 22 Oct 2001 12:28:38 -0500 Rick Emery [EMAIL PROTECTED] wrote: Construct your INSERT a piece at a time. Something like: $sql = INSERT INTO $myanet02 (staffdev,strategies,rules,news,information,policies) VALUES(; for($i=0;$icount($category);$i++) { if($HTTP_POST_VARS[category{$i}] == 'yes') { $sql .= \'$email\',; } else { $sql .= NULL,; } } $sql = substring($sql,0,-1).); //$query = mysql_query($sql,$connect) or die(mysql_error()); echo $sql; -Original Message- From: Russ Michell [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 11:23 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] looped insert Hi everyone: I've been fiddling with this all day, and well - if it was working you wouldn't be reading this right now! ;-) My script should take the selections made by users and process them via straightforward MySQL inserts: //Get all table column names, dynamically display them as checkboxes. Use to process subscriptions: $fields = mysql_list_fields($dbName, myanet_categories, $connect); $columns = mysql_num_fields($fields); for ($i=0; $i$columns; $i++) { $names = mysql_field_name($fields, $i) . \n; $catselect .= b$names /binput type=\checkbox\ name=\category[$names]\ value=\yes\br\n; } //If submit button selected, process those ticked checkbox categories: if(isset($submit)) { //loop while categories have been ticked for($i=0;$icount($category);$i++) { if($HTTP_POST_VARS[category{$i}] == 'yes') { //Not sure about this bit... $sql = INSERT INTO $myanet02 (staffdev,strategies,rules,news,information,policies) VALUES('$email','$email','$email','$email','$email','$email'); //$query = mysql_query($sql,$connect) or die(mysql_error()); echo $sql; } } } At the moment not even echoing my $sql works. I know this aint gonna work as it is, because what I really need to know is: * How do I insert into only those categories that have been checked? (default is 'null' in a VARCHAR(50) field) * How do I only declare '$email' a single time as this is the only value being inserted? Many thanks: Russ #---# Believe nothing - consider everything Russ Michell Anglia Polytechnic University Webteam Room 1C 'The Eastings' East Road, Cambridge e: [EMAIL PROTECTED] w: www.apu.ac.uk/webteam www.theruss.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
Re: RE: [PHP-DB] looped insert
NOTE: I didn't read the entire post below...it's too early in the morning to think about code. haha I did that the other day when I tried (and failed) to help out someone else - damn tired, hadn't even had a whiff of beer... Cheers for your help! Russ On Wed, 24 Oct 2001 09:10:59 -0400 Mike Frazer [EMAIL PROTECTED] wrote: Just thought this would be helpful... I've found the occassional problem with trying to insert a script-generated null value (rare but it does happen). If this becomes a problem, remember that NULL is just another word for nothing. MySQL will accept either of the following: INSERT INTO table VALUES ('value1', 'value2', NULL, 'value3'); INSERT INTO table VALUES ('value1', 'value2', , 'value3'); NOTE: I didn't read the entire post below...it's too early in the morning to think about code. I'm off to populate some site content until my brain catches up with the clock. Mike Frazer Russ Michell [EMAIL PROTECTED] wrote in message news:SIMEON.10110231044.D@k1c. anglia.ac.uk... Hi Rick: Cheers for the info. Thwe following code almost does it, however, the NULL value isn't inserted, if checkboxes are != to 'yes': //If submit button selected, process those ticked checkbox categories: if(isset($submit)) { //Start off sql $sql = INSERT INTO $myanet02 (staffdev,strategies,rules,news,information,policies) VALUES(; //loop while categories have been ticked for($i=0;$icount($category);$i++) { if($category[$names] == 'yes') { $sql .= '$email',; } else { $sql .= NULL,; } } //Remove the last comma $sql = substr($sql,0,-1).); //$query = mysql_query($sql,$connect) or die(mysql_error()); echo $sql; } I believe the problem to be this line: 'if($category[$names] == 'yes') {' //Use this and NULL values aren't inserted 'if($HTTP_POST_VARS[category${$i}] == 'yes') {' //Use this and ONLY NULL values are inserted The values are taken from the checkboxes thus: //Get all table column names, dynamically display them and use to process subscriptions: $fields = mysql_list_fields($dbName, myanet_categories, $connect); $columns = mysql_num_fields($fields); for ($i=0; $i$columns; $i++) { $names = mysql_field_name($fields, $i) . \n; $catselect .= b$names /binput type=\checkbox\ name=\category[$names]\ value=\yes\br\n; } You can see it happening at: http://gertrude.anglia.ac.uk/intranet/myanet/index.php Many thanks. Russ On Mon, 22 Oct 2001 12:28:38 -0500 Rick Emery [EMAIL PROTECTED] wrote: Construct your INSERT a piece at a time. Something like: $sql = INSERT INTO $myanet02 (staffdev,strategies,rules,news,information,policies) VALUES(; for($i=0;$icount($category);$i++) { if($HTTP_POST_VARS[category{$i}] == 'yes') { $sql .= \'$email\',; } else { $sql .= NULL,; } } $sql = substring($sql,0,-1).); //$query = mysql_query($sql,$connect) or die(mysql_error()); echo $sql; -Original Message- From: Russ Michell [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 11:23 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] looped insert Hi everyone: I've been fiddling with this all day, and well - if it was working you wouldn't be reading this right now! ;-) My script should take the selections made by users and process them via straightforward MySQL inserts: //Get all table column names, dynamically display them as checkboxes. Use to process subscriptions: $fields = mysql_list_fields($dbName, myanet_categories, $connect); $columns = mysql_num_fields($fields); for ($i=0; $i$columns; $i++) { $names = mysql_field_name($fields, $i) . \n; $catselect .= b$names /binput type=\checkbox\ name=\category[$names]\ value=\yes\br\n; } //If submit button selected, process those ticked checkbox categories: if(isset($submit)) { //loop while categories have been ticked for($i=0;$icount($category);$i++) { if($HTTP_POST_VARS[category{$i}] == 'yes') { //Not sure about this bit... $sql = INSERT INTO $myanet02 (staffdev,strategies,rules,news,information,policies) VALUES('$email','$email','$email','$email','$email','$email'); //$query = mysql_query($sql,$connect) or die(mysql_error()); echo $sql; } } } At the moment not even echoing my $sql works. I know this aint gonna work as it is, because what I really need to know is: * How do I insert into only those categories that have been checked? (default is 'null' in a VARCHAR(50) field) * How do I only declare '$email' a single time as this is the only value being inserted? Many thanks: Russ #---# Believe nothing - consider everything Russ Michell Anglia Polytechnic University Webteam Room 1C 'The Eastings' East Road, Cambridge e: [EMAIL PROTECTED] w:
[PHP-DB] Stuck
I'm attempting to do basic authentication through PHP and am having little success. I have a login screen which requests a username and password, and I need to have that check against a Windows domain. IE: Domain: ALPHA Login: testusername Password: TestPassword SUBMIT Then PHP needs to check against the ALPHA domain if the username and password is correct. Is there anyway to do this without popping up a standard basic authentication form box? Thanks! Ryan -- 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] Stuck
Is there anyway to do this without popping up a standard basic authentication form box? Sure! Are you making use of a databsae for this? MySQL per chance? If so I may be able to help you out.. * Simply query the fields: 'username' 'password' 'domain' from a DB table called: 'users' * SELECT these on the basis that the data in the DB reflects thatwhich was inputed via login form * If they details exist - login * If not refuse Cheers Russ. On Wed, 24 Oct 2001 09:33:21 -0400 Ryan Marrs [EMAIL PROTECTED] wrote: I'm attempting to do basic authentication through PHP and am having little success. I have a login screen which requests a username and password, and I need to have that check against a Windows domain. IE: Domain: ALPHA Login: testusername Password: TestPassword SUBMIT Then PHP needs to check against the ALPHA domain if the username and password is correct. Is there anyway to do this without popping up a standard basic authentication form box? Thanks! Ryan -- 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] #---# Believe nothing - consider everything Russ Michell Anglia Polytechnic University Webteam Room 1C 'The Eastings' East Road, Cambridge e: [EMAIL PROTECTED] w: www.apu.ac.uk/webteam www.theruss.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] Abstraction layers
What is everyone's favorite abstraction layer? -- Jacob Singh, [EMAIL PROTECTED] on 10/24/2001 -- 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] RE: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries...
Title: RE: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries... In these days and times, conservation of a meg of disk space is really not a consideration. Not the primary one anyway. The data should be stored in a format such that the storage itself and then retrieval can be executed with a minimum of handling/intervention other than the required sanity-checking. I've found that a set of date/time select controls and storage in a datetime field have been optimal. Insertion requires no parsing or complex handling (just some gluing of array elements) and retrieval with mysql's date-related functions means I don't need to touch the data one bit to display it in a meaningful way. For me, having to parse information before insertion, or after retrieval in order to display it, wastes far more resources than storing dates in a format other than an int. Mike Robinson IT / Developer - Toronto Star TV Phone: 416.945.8786 Fax: 416.869.4566 Email: [EMAIL PROTECTED] -Original Message- From: Mike Frazer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 8:54 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries... Agreed. This is especially useful when you need to conserve every byte you can; a timestamp of 10/24/2001 or something similar is going to take 10 bytes as a string and an indeterminate number of bytes for an actual timestamp because of system variations, whereas an integer value of 10242001 will take you 2-4 bytes depending on the type of int you declare. Not a lot of space, but assume for a second you have 30 fields in your database and 5 million rows...suddenly those 6-8 bytes have multiplied on this one field alone. Space and speed are important in DBs :) Mike Frazer http://www.torontostartv.com - Webcasting Production http://www.tmgtv.ca - Hometown Television http://www.thestar.com - Canadas largest daily newspaper, The Toronto Star, online -- 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] Using A Query Results Multiple Times
Yes, I had the right code just was missing the mysql_data_seek. Thanks for the help. -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 1:09 PM To: 'Adam Douglas'; PHP-DB (mailing list) (E-mail) Subject: RE: [PHP-DB] Using A Query Results Multiple Times You're on the right track. Did you try?: while( $row[] = mysql_fetch_array($result) ); This should load each result row into a row of a multi-dimensional array. You would then access it with: $row[0]['colname'] -Original Message- From: Adam Douglas [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 1:48 PM To: PHP-DB (mailing list) (E-mail); PHP-General (mailing list) (E-mail) Subject: [PHP-DB] Using A Query Results Multiple Times I have an instance where I have to query my MySQL database and then use the multiple row results to create multiple pull down menus on a web page. My problem is how can I take the results of the query and use them more the once to create pull down menus? I've always used a while look to fetch each row of the results and have it create the pull down menu as it goes through each row. But doing it this way only stores one row of results in a variable. Is there a way I can grab all the results from a query that would go into an array so I could use it multiple times? I've looking briefly for a function to MySQL that would allow me to do this but haven't found anything unless I misunderstand mysql_fetch_array function. At first I thought I could loop through my while loop and have it put the results from the query of each row in to a multidimensional array. But then how would I add to the array after the initial row? BTW, I'm using PHP 3.0.16 so I can't use the added array functions that PHP 4 has. I do plan on upgrading soon. -- 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]
[PHP-DB] PHP will only work with anonymous (IUSR_XXX) user
I have my php script working correctly with IIS 5 and SQL 7 (2 seperate machines) as long as the user is anonymous. (the page is running as IUSR_XXX) But if you require the user to login, and use a username... even administrator, the php will return can not connect to database Help please Duane Cox [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]
[PHP-DB] export
how can i select records from mysql and store them in a text or spreadsheet file format? thanks for reply php 4 on win32 gerald clerc
RE: [PHP-DB] export
Do you mean via PHP or directly at the MySQL command line? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 10:12 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] export how can i select records from mysql and store them in a text or spreadsheet file format? thanks for reply php 4 on win32 gerald clerc -- 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] it works but i don't uderstand
Hello, I'm building some database class, so i can reuse my code when using a not mysql database system. I'm implementing a free_result now; some code of my class class database { function free_result($result) { mysql_free_result($result); return; } .. } ? some of the code: include (class_mysql.php); $db= new database(); $db-connect(); $result=$db-select_query(SELECT * FROM users); echo mysql_num_rows($result); $db-free_result($result); echo mysql_num_rows($result); Running this will give: 2 and Warning: 2 is not a valid MySQL result resource So this seems to work, but why? Why is $result handled as it is a global var? I should think it must be something like: function free_result($result) { mysql_free_result($result); return; } But this don't work. Thanks, Bas -- 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] Re: Html email
Hello- I've always had this type of mail statement work for me: mail($to, $Subject, $Body, From: $From\r\nContent-Type: text/html; charset=iso-8859-1); My guess is that Outlook doesnt know what to do with the header you're sending it (maybe too much info for outlook??)... Other than that I've got no idea =) -- Jason Wood Chief Technology Officer Expressive Tek, Inc. 407 Kehrs Mill Road Ballwin, MO 63011 Phone 636.256.1362 www.expressivetek.com Benny [EMAIL PROTECTED] wrote in message 001501c15c1d$7f2f5560$0b01a8c0@ISKAT">news:001501c15c1d$7f2f5560$0b01a8c0@ISKAT... Please help me. I have problem with html email. I send email to 3 email address : [EMAIL PROTECTED], [EMAIL PROTECTED] and [EMAIL PROTECTED] The email client for yahoo eudoramail is their web. And for the last destination, the email client is ms outlook. The html email for yahoo eudoramail are well received. But for the last destination the ms outlook display the wrong result like encrypted text. Below is my code and the result in ms outlook. My code : $s_to = '[EMAIL PROTECTED]'; $s_subject = 'Subject xxx'; $s_headers = From: [EMAIL PROTECTED]\r\n; $s_headers .= MIME-Version: 1.0\r\n; $s_boundary = uniqid(id); $s_headers .= Content-Type: multipart/alternative . ; boundary = $s_boundary\r\n\r\n; $s_headers .= This is a MIME encoded message.\r\n\r\n; $s_headers .= --$s_boundary\r\n . $s_headers .= Content-Type: text/html; charset=\iso-8859-1\\r\n . Content-Transfer-Encoding: base64\r\n\r\n; $s_headers2 = chunk_split(base64_encode(bla...bbla.../bbla...)); $s_headers = $s_headers.$s_headers2.'--'.$s_boundary.'--'; @mail ($s_to, $s_subject,, $s_headers); Result in ms outlook : Return-Path: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Received: (qmail 2773 invoked by uid 252); 22 Oct 2001 23:35:00 - Date: 22 Oct 2001 23:35:00 - Message-ID: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Subject xxx From: [EMAIL PROTECTED] MIME-Version: 1.0 Content-Type: multipart/alternative; boundary = id3bd4ad2486465 This is a MIME encoded message. --id3bd4ad2486465 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: base64 PGZvbnQgZmFjZT0iVmVyZGEhlbHZldGljYSwgc2Fucy1zZXJpZiIgc2l6ZT0i aXY+PC9mb250C90cj48L3RhYmxlPg== --id3bd4ad2486465-- Regards; Benny. -- 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: Html email
Chances are that Outlook is just looking for some Outlook-only headers. I wound up using the MIME::Lite Perl module when creating a program to send HTML-enabled e-mail. How about a vote: who else thinks that HTML e-mail just plain sucks? At 08:56 AM 10/24/2001, Jason Wood wrote: My guess is that Outlook doesnt know what to do with the header you're sending it (maybe too much info for outlook??)... Other than that I've got no idea =) Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- 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] Embedding Perl
I have a small situation where it would be good to be able to embed a perl routing in a php script. Is this possible? Or do I need to pass control from php to a perl script and return? A quick synopsis would be (in pseudo code) ?php if($theFileType == pdf { // call convert.pl to get a thumbnail } else { // other file type processing } ? Alternatively, is there a module that can take a pdf file and make a thumbnail of the first page? Thanks, Terry -- 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] Embedding Perl
: There is a solution but I don't know how good is it? I'm not sure but the name of the project is PHPerl or something about it. -- Andrey Hristov Web Developer Icygen Corporation BUILDING SOLUTIONS http://www.icygen.com On Wednesday 24 October 2001 12:05 pm, you wrote: I have a small situation where it would be good to be able to embed a perl routing in a php script. Is this possible? Or do I need to pass control from php to a perl script and return? A quick synopsis would be (in pseudo code) ?php if($theFileType == pdf { // call convert.pl to get a thumbnail } else { // other file type processing } ? Alternatively, is there a module that can take a pdf file and make a thumbnail of the first page? Thanks, Terry -- 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] Concatenating fields
I am using concat in my sql and it runs fine on mysql client. But when used in php it gives me an error: Supplied argument is not a valid MySQL result resource in b/var/www/html/scripts/cfg_code_delete.php/b on line $ssql=select concat(category, -, code) as fill_column, code_id as submit_column from sys_code_tbl order by category; echo OPTION selected value=\\/OPTION; $result = mysql_query($ssql); while ($row = mysql_fetch_array($result)) { echo OPTION value='.$row[submit_column].''.$row[fill_column].'/OPTION; } Help is appreciated. Regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -- 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] Concatenating fields
Try escaping the quotes: $ssql=select concat(category, \-\, code) as ... Either that, or try surrounding the - with single quotes, as in '-'. What's probably happening is that the query is being rendered as select concat (category, , which isn't a valid query. At 10:15 AM 10/24/2001, you wrote: I am using concat in my sql and it runs fine on mysql client. But when used in php it gives me an error: Supplied argument is not a valid MySQL result resource in b/var/www/html/scripts/cfg_code_delete.php/b on line $ssql=select concat(category, -, code) as fill_column, code_id as submit_column from sys_code_tbl order by category; echo OPTION selected value=\\/OPTION; $result = mysql_query($ssql); while ($row = mysql_fetch_array($result)) { echo OPTION value='.$row[submit_column].''.$row[fill_column].'/OPTION; } Help is appreciated. Regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -- 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] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- 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] RE:PHP and SNMP please help.
I have the following installed on RH 7.1 php-4.0.4pl1-9 php-ldap-4.0.4pl1-9 php-manual-4.0.4pl1-9 php-common-4.0.5-0.3 php-imap-4.0.4pl1-9 php-mysql-4.0.4pl1-9 ucd-snmp-devel-4.2-12 ucd-snmp-4.2-12 ucd-snmp-utils-4.2-12 and I cannot seem to use the PHP snmpget() commands this is a sample php_test.php file !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titlePHP Test/title /head body ?php $syscontact = snmpget(12.105.40.30, public, .1.3.6.1.2.1.1.4.0); echo $syscontact; ? /body /html I get the following responce Fatal error: Call to undefined function: snmpget() in /var/www/html/root/php_test.php on line 9 please help -- 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] PhpLib, PEAR DB, Metabase, ADODB and Native MySQL benchmarks
Someone asked me to benchmark PHPLib also. Here is the revised benchmarks, with some minor speedups for PEAR DB and Metabase. Benchmark was to select 82 rows from the products table 200 times. The tests were repeated 5 times. Connection times were excluded from the benchmark. Lower values are better. All numbers are in seconds. MySQL 1.12 1.12 1.17 1.15 1.14 ADODB 1.43 1.47 1.47 1.44 1.45 PhpLib 1.53 1.62 1.64 1.64 1.57 PEAR 2.91 2.90 2.85 2.83 2.84 (fetchInto) PEAR 3.14 3.13 3.22 3.12 3.16 (fetchRow) M'base 4.51 4.55 4.46 4.54 4.52 (numeric columns) M'base 4.99 4.72 4.71 4.71 4.72 (named columns) Average Overhead MySQL 1.14 - ADODB 1.45 27% PhpLib 1.60 40% PEAR 2.87 152% (fetchInto) PEAR 3.15 176% (fetchRow) M'base 4.52 296% (numeric cols) M'base 4.77 318% (named cols) Methodology Results on Pentium 800 Mhz running Win 2000, PHP 4.0.6 ISAPI on IIS5 with MySQL 3.23, all on the same machine. PEAR DB from PHP 4.0.6, ADODB 1.40, PhpLib 7.2d and Metabase 1.57 were used. Code revised on 22nd October 2001. PhpLib tests added 24th October 2001. Source code for these tests is available from http://phplens.com/lens/adodb/ -- 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] Re: Newbie in Need of Assistance
It´s very easy and to tell you the truth I descovered it by accident: Lets say you have a variable with the dynamic variable name (ej. $var_name = game1;) if you want to create this variable ($game1) then you can write: $$var_name And that´s it. try it. Jmack [EMAIL PROTECTED] escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Greetings. I have been playing around with PHP this week, programming a football pool. I have hit a small snag that I would like some assistance with, if anyone knows the answer -- it's probably very simple, but my Intro to PHP book does not tell me how to do it. I have an HTML form in a PHP page, with several controls on it. I am dynamically generating the names for these controls. Here is the example -- for each game, the user selects the winner in a SELECT control. It's set up to not care how many games there are for each week, just dynamically build the form/controls and name them pick1, pick2, etc. In my function that handles the form and uploads the user's picks to the database (MySQL), I need to also dynamically generate the variable names that refer to these controls. I have them all declared as global variables, since I know there will never be more than 15 games in a given week. But, I want to iterate through a loop for each game and update the database. As I loop through for each game, and try to dynamically generate the vaiable names for $pick1, $pick2, etc. I end up trying to update the DB by sending in the string $pick1 instead of the value from the form control for pick1. I have attached the PHP file in question. The code is not very clean, especially the part where I am having problems, but hopefully, someone will have some time to help me with this problem. Please respond to this newsgroup or directly to me at [EMAIL PROTECTED] Thank you. Joe Mack -- 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] array-problems
It looks like you need only one array, $date[begin] = $date[end]. Let's see, I think it'll work. I'll write it in your code then you try: $i=0; $result = mysql_query (SELECT DISTINCT date FROM linktracker WHERE name LIKE '$PHP_AUTH_USER' ORDER BY date); if ($row = mysql_fetch_array($result)) { do { $date[$i] = $row[date]); $i++; } while ($row = mysql_fetch_array($result)); } else {print (Sorry, no record were found.); } file://end else $result print(tabletrtdBegindate/tdtdEnddate/td/tr\n. trtdform method=\post\ action=\index.php\ name=\date_select\. input type=\hidden\ name=\action\ value=\date_select\. select name=\date_begin\); $i = 0; while ($date[$i]) { echo option value=\.$date_begin .\ . $date_begin . /option\n; $i++; } print(/select/tdtdselect name=\date_end\); $i--; while ($date[$i]) { echo option value=\.$date_end .\ . $date_end . /option\n; $i--; } print(/select/td/tr\ntrtd colspan=\2\. input type=\submit\ name=\Submit\ value=\Submit\. /form/td/tr/table); mysql_free_result ($result); mysql_close(); -- 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] array-problems
- Original Message - From: Jim Lucas [EMAIL PROTECTED] To: Bart Verbeek [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, October 24, 2001 12:42 PM Subject: Re: [PHP-DB] array-problems Try this: BEGIN:PHP-CODE $result = mysql_query (SELECT DISTINCT date FROM linktracker WHERE name LIKE '$PHP_AUTH_USER' GROUP BY date ORDER BY date); if (mysql_num_rows($result)) { for($i=0;$icount($row);$i++) { $date = array( begin = array($i = $row[date]), end = array($i = $row[date]) ); } } else { print (Sorry, no record were found.); } function drawSelect($which) { global $date; foreach($date[$which] AS $date_begin) { ? option value=?=$date_begin??=$date_begin?/option ? } } ? table tr tdBegindate/td tdEnddate/td /tr tr tdform method=post action=index.php name=date_select input type=hidden name=action value=date_select select name=date_begin ? drawSelect(begin); ? /select /td tdselect name=date_end ? rsort($date[end]); drawSelect(end); ? /select /td /tr tr td colspan=2input type=submit name=Submit value=Submit/form/td /tr/table END:PHP-CODE btw - you need to watch your closing '' you are missing a few. Plus to get distince to work right you need to use the GROUP BY clause. Jim - Original Message - From: Bart Verbeek [EMAIL PROTECTED] To: Php-General-list [EMAIL PROTECTED]; PHP-DB mailinglist [EMAIL PROTECTED] Sent: Wednesday, October 24, 2001 12:23 PM Subject: [PHP-DB] array-problems Hello, Can anyone help me with this script I'm using? I've saved dates in a database and want to make two select-lists of these dates in a html-form. I want to select each unique date one time (no doubles). List 1 is used to set the begin-date of the query for the report, List 2 will set the end-date and must be reversed. When the form is processed the data selected between the begin-date and the end-date has to be show. I can't seem to get my code to work: the select-lists stay empty after processing the code below. Can anyone help? Tips... regards, Bart BEGIN:PHP-CODE $i=0; $result = mysql_query (SELECT DISTINCT date FROM linktracker WHERE name LIKE '$PHP_AUTH_USER' ORDER BY date); if ($row = mysql_fetch_array($result)) { do { $date = array( begin = array($i = $row[date]), end = array($i = $row[date]) ); $i++; } while ($row = mysql_fetch_array($result)); } else {print (Sorry, no record were found.); } //end else $result print(tabletrtdBegindate/tdtdEnddate/td/tr\n. trtdform method=\post\ action=\index.php\ name=\date_select\. input type=\hidden\ name=\action\ value=\date_select\. select name=\date_begin\); while (list($key, $date_begin) = each($date[begin])) { echo option value=\.$date_begin .\ . $date_begin . /option\n; } print(/select/tdtdselect name=\date_end\); rsort($date[end]); while (list($key, $date_end) = each($date[end])) { echo option value=\.$date_end .\ . $date_end . /option\n; } print(/select/td/tr\ntrtd colspan=\2\. input type=\submit\ name=\Submit\ value=\Submit\. /form/td/tr/table); mysql_free_result ($result); mysql_close(); END:PHP-CODE -- 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] Embedding Perl
Ok, I found snippets that talk about using either exec() or backticks. The problem is that it still doesn't call the perl script. Or at least doesn't seem to. exec(convert-pdf.pl Blank.gif,$out); echo(implode(\n,$out)); $out = `convert-pdf.pl Blank.gif`; echo($out); If I run perl convert-pdf.pl Blank.gif from the shell, it responds with 135x105 and creates a secondary file. This is what the script is meant to do. Calling it in either of the example above, results in either an Array or nothing being displayed. No secondary file gets created. On Wednesday, October 24, 2001, at 11:05 AM, Terry Romine wrote: I have a small situation where it would be good to be able to embed a perl routing in a php script. Is this possible? Or do I need to pass control from php to a perl script and return? A quick synopsis would be (in pseudo code) ?php if($theFileType == pdf { // call convert.pl to get a thumbnail } else { // other file type processing } ? Alternatively, is there a module that can take a pdf file and make a thumbnail of the first page? Thanks, Terry -- 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] Embedding Perl
You have to put the actual command in the exec or backticks as you would type it in your shell, not just the filename. So instead of $out = `convert-pdf.pl Blank.gif`; Try $out = `perl convert-pdf.pl Blank.gif`; Sheridan Saint-Michel Website Administrator FoxJet, an ITW Company www.foxjet.com - Original Message - From: Terry Romine [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 24, 2001 3:23 PM Subject: Re: [PHP-DB] Embedding Perl Ok, I found snippets that talk about using either exec() or backticks. The problem is that it still doesn't call the perl script. Or at least doesn't seem to. exec(convert-pdf.pl Blank.gif,$out); echo(implode(\n,$out)); $out = `convert-pdf.pl Blank.gif`; echo($out); If I run perl convert-pdf.pl Blank.gif from the shell, it responds with 135x105 and creates a secondary file. This is what the script is meant to do. Calling it in either of the example above, results in either an Array or nothing being displayed. No secondary file gets created. On Wednesday, October 24, 2001, at 11:05 AM, Terry Romine wrote: I have a small situation where it would be good to be able to embed a perl routing in a php script. Is this possible? Or do I need to pass control from php to a perl script and return? A quick synopsis would be (in pseudo code) ?php if($theFileType == pdf { // call convert.pl to get a thumbnail } else { // other file type processing } ? Alternatively, is there a module that can take a pdf file and make a thumbnail of the first page? Thanks, Terry -- 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]
[PHP-DB] MySQL Last Modified
Is there any way to tell when a TABLE in MySQL was last modified? I don't want to add a timestamp field as there are thousands of rows, and I just need to know when ANYTHING in the table was last modified. I haven't been able to find anything on this, and thought I would ask before kludging together a workaround =P Sheridan Saint-Michel Website Administrator FoxJet, an ITW Company www.foxjet.com
RE: [PHP-DB] MySQL Last Modified
MySQL command: show table status This command returns multiple fields, including date/time of last update, for each table in the selected database. Call it with mysql_query(show table status) Check the MySQL manual for more information -Original Message- From: Sheridan Saint-Michel [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 4:07 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL Last Modified Is there any way to tell when a TABLE in MySQL was last modified? I don't want to add a timestamp field as there are thousands of rows, and I just need to know when ANYTHING in the table was last modified. I haven't been able to find anything on this, and thought I would ask before kludging together a workaround =P Sheridan Saint-Michel Website Administrator FoxJet, an ITW Company www.foxjet.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] Hmmm? PHP+PostgreSQL
I've installed PostgreSQL into /usr/local/pgsql, then I tried to include into my PHP support for PostgreSQL and made next: (I had pre-compiled support for mySQL before that) make clean ./configure --with-apxs=/usr/local/apache/bin/apxs --enable-versioning --enable-track-vars --with-pgsql --with-mysql make make install (I have mySQL, too) Compilation process was great, no errors. Nevertheless, next little PHP script: html head titletesting needed functions of current-gtlg with PHP+PostgreSQL/title /head body bgcolor=white ?php $conn = pg_connect (host=localhost port=5432 dbname=test user=postgres); ? /body /html still says: Fatal error: Call to undefined function: pg_connect() in /usr/local/apache/htdocs/pg-php/index.php on line 7 What I did wrong, guys? Will be looking forward your answer, please, CC: to [EMAIL PROTECTED] Thanks. -- green [http://www.extrasy.net] -- 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] Hmmm? PHP+PostgreSQL
On Wednesday 24 October 2001 23:21, Alexey Prohorenko wrote: I've installed PostgreSQL into /usr/local/pgsql, then I tried to include into my PHP support for PostgreSQL and made next: (I had pre-compiled support for mySQL before that) make clean ./configure --with-apxs=/usr/local/apache/bin/apxs --enable-versioning --enable-track-vars --with-pgsql --with-mysql make make install Did you restart apache after the installation ? You can also try to compile with --with-pgsql=/usr/local/pgsql -- Meir Kriheli (I have mySQL, too) Compilation process was great, no errors. Nevertheless, next little PHP script: html head titletesting needed functions of current-gtlg with PHP+PostgreSQL/title /head body bgcolor=white ?php $conn = pg_connect (host=localhost port=5432 dbname=test user=postgres); ? /body /html still says: Fatal error: Call to undefined function: pg_connect() in /usr/local/apache/htdocs/pg-php/index.php on line 7 What I did wrong, guys? Will be looking forward your answer, please, CC: to [EMAIL PROTECTED] 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: Newbie in Need of Assistance
carols - true, but to avoid confusion and problem sif your names get more complex (i.e. i think $$some_name will go crazy, you should always do it like this $var_name = game1; ${$var_name} cheers guys // -Original Message- // From: Carlos Augusto Abarca [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 25 October 2001 3:19 AM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] Re: Newbie in Need of Assistance // // // It´s very easy and to tell you the truth I descovered it by accident: // // Lets say you have a variable with the dynamic variable name // (ej. $var_name = // game1;) // // if you want to create this variable ($game1) then you can write: // $$var_name // And that´s it. // // try it. // // Jmack [EMAIL PROTECTED] escribió en el mensaje // [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... // Greetings. I have been playing around with PHP this week, // programming a // football pool. I have hit a small snag that I would like // some assistance // with, if anyone knows the answer -- it's probably very // simple, but my // Intro // to PHP book does not tell me how to do it. // // I have an HTML form in a PHP page, with several controls // on it. I am // dynamically generating the names for these controls. Here is the // example -- // for each game, the user selects the winner in a SELECT // control. It's // set // up to not care how many games there are for each week, // just dynamically // build the form/controls and name them pick1, pick2, etc. // // In my function that handles the form and uploads the // user's picks to the // database (MySQL), I need to also dynamically generate the // variable names // that refer to these controls. I have them all declared as global // variables, // since I know there will never be more than 15 games in a // given week. But, // I // want to iterate through a loop for each game and update // the database. As // I // loop through for each game, and try to dynamically // generate the vaiable // names for $pick1, $pick2, etc. I end up trying to update the DB by // sending // in the string $pick1 instead of the value from the form // control for // pick1. // // I have attached the PHP file in question. The code is not // very clean, // especially the part where I am having problems, but // hopefully, someone // will // have some time to help me with this problem. Please // respond to this // newsgroup or directly to me at [EMAIL PROTECTED] Thank you. // // Joe Mack // // // // // // // // -- // 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] Using A Query Results Multiple Times
Thanks for the help. I had all the code right just had to add the mysql_data_seek. Wasn't aware it operated in this manner. -Original Message- From: Peter Lovatt [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 3:41 PM To: Adam Douglas; PHP-DB (mailing list) (E-mail); PHP-General (mailing list) (E-mail) Subject: RE: [PHP-DB] Using A Query Results Multiple Times Hi while(...) { do whatever } mysql_data_seek ($mysqlresultid, 0) while(...) { do whatever } mysql_data_seek ($mysqlresultid, 0) etc will set the pointer back to the beginning of the result set, so you can scan through it as many times as you need to, without needing to repeat the query. HTH Peter -Original Message- From: Adam Douglas [mailto:[EMAIL PROTECTED]] Sent: 23 October 2001 19:48 To: PHP-DB (mailing list) (E-mail); PHP-General (mailing list) (E-mail) Subject: [PHP-DB] Using A Query Results Multiple Times I have an instance where I have to query my MySQL database and then use the multiple row results to create multiple pull down menus on a web page. My problem is how can I take the results of the query and use them more the once to create pull down menus? I've always used a while look to fetch each row of the results and have it create the pull down menu as it goes through each row. But doing it this way only stores one row of results in a variable. Is there a way I can grab all the results from a query that would go into an array so I could use it multiple times? I've looking briefly for a function to MySQL that would allow me to do this but haven't found anything unless I misunderstand mysql_fetch_array function. At first I thought I could loop through my while loop and have it put the results from the query of each row in to a multidimensional array. But then how would I add to the array after the initial row? BTW, I'm using PHP 3.0.16 so I can't use the added array functions that PHP 4 has. I do plan on upgrading soon. -- 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] Re: Html email
H, try not to set your encoding to base64. I think that Outlooks works find and decodes the base64 stream but this stream is a normal text, so with this in header you make obfuscating. You pass fox jumps over a lazy dog and Outlook thinks that is base64, so it decodes to blablaba -- Andrey Hristov Web Developer Icygen Corporation BUILDING SOLUTIONS http://www.icygen.com -=-=-=--==--==--=-=-=-=-=-=-=-=-=-==--=-=-=-=-==--=-= Hello- I've always had this type of mail statement work for me: mail($to, $Subject, $Body, From: $From\r\nContent-Type: text/html; charset=iso-8859-1); My guess is that Outlook doesnt know what to do with the header you're sending it (maybe too much info for outlook??)... Other than that I've got no idea =) -- Jason Wood Chief Technology Officer Expressive Tek, Inc. 407 Kehrs Mill Road Ballwin, MO 63011 Phone 636.256.1362 www.expressivetek.com Benny [EMAIL PROTECTED] wrote in message 001501c15c1d$7f2f5560$0b01a8c0@ISKAT">news:001501c15c1d$7f2f5560$0b01a8c0@ISKAT... Please help me. I have problem with html email. I send email to 3 email address : [EMAIL PROTECTED], [EMAIL PROTECTED] and [EMAIL PROTECTED] The email client for yahoo eudoramail is their web. And for the last destination, the email client is ms outlook. The html email for yahoo eudoramail are well received. But for the last destination the ms outlook display the wrong result like encrypted text. Below is my code and the result in ms outlook. My code : $s_to = '[EMAIL PROTECTED]'; $s_subject = 'Subject xxx'; $s_headers = From: [EMAIL PROTECTED]\r\n; $s_headers .= MIME-Version: 1.0\r\n; $s_boundary = uniqid(id); $s_headers .= Content-Type: multipart/alternative . ; boundary = $s_boundary\r\n\r\n; $s_headers .= This is a MIME encoded message.\r\n\r\n; $s_headers .= --$s_boundary\r\n . $s_headers .= Content-Type: text/html; charset=\iso-8859-1\\r\n . Content-Transfer-Encoding: base64\r\n\r\n; $s_headers2 = chunk_split(base64_encode(bla...bbla.../bbla...)); $s_headers = $s_headers.$s_headers2.'--'.$s_boundary.'--'; @mail ($s_to, $s_subject,, $s_headers); Result in ms outlook : Return-Path: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Received: (qmail 2773 invoked by uid 252); 22 Oct 2001 23:35:00 - Date: 22 Oct 2001 23:35:00 - Message-ID: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Subject xxx From: [EMAIL PROTECTED] MIME-Version: 1.0 Content-Type: multipart/alternative; boundary = id3bd4ad2486465 This is a MIME encoded message. --id3bd4ad2486465 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: base64 PGZvbnQgZmFjZT0iVmVyZGEhlbHZldGljYSwgc2Fucy1zZXJpZiIgc2l6ZT0i aXY+PC9mb250C90cj48L3RhYmxlPg== --id3bd4ad2486465-- Regards; Benny. -- 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]
[PHP-DB] array-problems
Hello, Can anyone help me with this script I'm using? I've saved dates in a database and want to make two select-lists of these dates in a html-form. I want to select each unique date one time (no doubles). List 1 is used to set the begin-date of the query for the report, List 2 will set the end-date and must be reversed. When the form is processed the data selected between the begin-date and the end-date has to be show. I can't seem to get my code to work: the select-lists stay empty after processing the code below. Can anyone help? Tips... regards, Bart BEGIN:PHP-CODE $i=0; $result = mysql_query (SELECT DISTINCT date FROM linktracker WHERE name LIKE '$PHP_AUTH_USER' ORDER BY date); if ($row = mysql_fetch_array($result)) { do { $date = array( begin = array($i = $row[date]), end = array($i = $row[date]) ); $i++; } while ($row = mysql_fetch_array($result)); } else {print (Sorry, no record were found.); } //end else $result print(tabletrtdBegindate/tdtdEnddate/td/tr\n. trtdform method=\post\ action=\index.php\ name=\date_select\. input type=\hidden\ name=\action\ value=\date_select\. select name=\date_begin\); while (list($key, $date_begin) = each($date[begin])) { echo option value=\.$date_begin .\ . $date_begin . /option\n; } print(/select/tdtdselect name=\date_end\); rsort($date[end]); while (list($key, $date_end) = each($date[end])) { echo option value=\.$date_end .\ . $date_end . /option\n; } print(/select/td/tr\ntrtd colspan=\2\. input type=\submit\ name=\Submit\ value=\Submit\. /form/td/tr/table); mysql_free_result ($result); mysql_close(); END:PHP-CODE -- 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] Re: [PHP] Using A Query Results Multiple Times
On Tuesday 23 October 2001 20:47, Adam Douglas wrote: mysql_fetch_array function. At first I thought I could loop through my while loop and have it put the results from the query of each row in to a multidimensional array. But then how would I add to the array after the initial row? while ($row = mysql_fetch_array (...)) { $MyArray[] = $row; } Look up arrays in the manual -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) Very funny, Scotty! Now beam up my clothes... -- 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]