[PHP-DB] split query per $_POST???
Could anyone, please, help me with this one. If I add the insert inside the loop it inserts as many orders in the order table as products have been chosen. There is really no way to split this? I have a problem with a script that gets the ID's of the selected products from the previous script and shows them with mysql_fetch_object. Now I'd like to insert them in the db, but when I pass every value to $vars and insert them it inserts only one of the selected products. I tried a change with mysql_fetch_array, with split and implode, ...useless. How can I get the products to be apart without breaking the values, ie, put name of all the selected products in name field in the db, put serial number of the selected products in serial field in the db, etc?: ... while($isc = mysql_fetch_object($antw)){ if (!empty($isc-pic)) { echo (img src='$isc-pic' width='50'br); } if (!empty($isc-Meas)) { echo ($isc-infMeasbr); } if (!empty($isc-Name)) { echo ($isc-Name, ); } if (!empty($isc-Ref)) { echo ($isc-Ref,br); } $ipic = $isc-pic; $iMeas = $isc-Meas; $iName = $isc-Name; $iRef = $isc-Ref; } ... $dem = INSERT INTO orders VALUES('$ipic','$iMeas','$iName','$iRef'); ... By the way how can I get them apart in the previous page by rows of 3 products each in the table?: ... echo (table width=100% border=1 align=center cellspacing=0 cellpadding=5 bordercolor=#FF); while ($inb = mysql_fetch_object($resultprd)) { echo (trtd width='20%'); if (!empty($inb-pic)) { echo (img src='$inb-pic' width='200'br); } else { echo (img src='http://.../notaval.gif' width='200'br); } if (!empty($inb-Type)) { echo ($inb-Type,br); } if (!empty($inb-Name)) { echo ($inb-Namebr); } if (!empty($inb-Ref)) { echo ($inb-Refbr); } if (!empty($inb-Meas)) { echo ($inb-Measbr); } if (!empty($inb-Ref)) { echo ($inb-Refbr); } if (!empty($inb-Serial)) { echo (strongSERIAL N°: $inb-Serial/strongbr); } if (!empty($inb-Description)) { echo (DETAILS: $inb-Description,br); } if (!empty($inb-Artw)) { echo ($inb-Artw,br); } if (!empty($inb-Cover)) { echo ($inb-Cover,br); } echo (/td/table); - Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage ! Créez votre Yahoo! Mail Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis.Téléchargez GRATUITEMENT ici !
[PHP-DB] Re: ODBC_Connect error message
Hello I'm having pretty much the same problem and no help from web. Im very curious to know, if you were able to solve this problem. My setup is as follows: RedHat EL WS on x86 apache 2.0.50, PHP 4.3.8 IBM UDB DB2 personal edition 8.1 PHP was configured with options --with-ibm-db2=/opt/IBM/db2/V8.1/ --with-apxs2=/usr/local/apache2/bin/apxs I also tried this with the RPM packages for apache provided by RedHat but there was no difference in behavior. The problem is in PHP, because when I use a simple script from command line to access DB2 (script below), I get the same gibberish SQL error than via web browser. Sequence of actions: launch db2profile from /home/db2inst1/sqllib (db2 instance user) restart apache from the same shell php db2.php script db2.php ?php $conn = odbc_connect('mmtest', 'd2inst1', 'instance'); odbc_close($conn); ? Line two gives the SQL error. Warning: odbc_connect(): SQL error: ?M?, SQL state d$ D?x???E,a;?? in SQLConnect in /usr/local/apache2/htdocs/db2.php on line 2 Any help is greatly appreciated. Anni Hienola Cameron Seader wrote: Greetings, I am having some trouble with this error message and finding out what it really means. I receive this in my HTTP error log from apache 1.3. [Tue Aug 17 23:36:04 2004] [error] PHP Warning: odbc_connect(): SQL error: , SQL state ÿÿÿþ in SQLConnect in /srv/www/htdocs/acquisuite/idxdb2.php on line 572 I have no idea why this is doing this. It worked on another machine, but eversince in I put it on a new machine i get this message. I am running SLES 8 for s390x on Mainframe. It is 64 bit. my configure options for PHP are: ./configure --with-apxs --enable-track-vars --with-ibm-db2=/home/db2admin/sqllib --enable-bcmath --with-zlib=yes So i have DB2 support with DB2 Connect installed on SUSE. It has worked before on a RedHat 7.2 OS on s390x platform. Does anyone have any idea what the SQL state ÿÿÿþ means? TIA, Cameron Seader [INFO] -- Access Manager: This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. A2 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Warning message -- session side-effect
Hi, I found the warning message below when I open the webpage. What am I do wrong with session variable? Please help to comment... Thanks, Wut Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0
Re: [PHP-DB] Security Question
From: Dylan Barber [EMAIL PROTECTED] I am accessing a database on my site from another site - I am not the only developer on the other site and there is the potential for someone to access the database for nefarious purposes from the other site. Can I somehow protect the password and still have it work? What database? I assume you mean your PHP script is logging into a remote database and you're concerned about the password being in the script? Not much you can do about it, really. You can log in over SSL (depending upon your database), which will protect the password in transit, but it's still sitting in the file. If you can't trust users on the server that you're on, find a better server. :) Or I had thought of this but I didn't know if it wuld or should work - include all my database routines in an include file and do something like include once http://domain.com/include.php; would that even work? It will work, but not like you're thinking. You'll get the _result_ of the PHP file and not the actual code. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Warning message -- session side-effect
I just came across this yesterday in fact. If you look in your php.ini file, you will see the following ; PHP 4.2 and less have an undocumented feature/bug that allows you to ; to initialize a session variable in the global scope, albeit register_globals ; is disabled. PHP 4.3 and later will warn you, if this feature is used. ; You can disable the feature and the warning seperately. At this time, ; the warning is only displayed, if bug_compat_42 is enabled. session.bug_compat_42 = 0 //yours is likely set to 1 session.bug_compat_warn = 1 Hope this helps. -Original Message- From: Matt M. [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 5:43 AM To: Worrawut Poonsuk Cc: PHP DB List Subject: Re: [PHP-DB] Warning message -- session side-effect Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 you have any code examples. Try looking into using the $_SESSION array. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] RE: log in script kicks me out
I have attempted to use session_write_close() but it makes no difference. Thanks for your help. Any other ideas I might be be able to try? Upon doing a quick search using something like $_SESSION second time I see that there are a number of others who seem to have similar problems, and no solutions. -Original Message- Sent: Tuesday, August 17, 2004 7:08 AM Irm Jr wrote: Each page checks for a particular session variable, if it isn't set to a particular value, the intruder is kicked out to the login form and asked to log in. The problem is this: On the production machine, even with a correct username and password (i.e. a successful login), the user is ALWAYS kicked back out and asked to log in. However, typing exactly the same information a second time allows the user right in. You can tell that the first attempt was successful because the script executes the header:Location . Use session_write_close() before your header() redirection. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals - www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: log in script kicks me out
Irm Jr [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have attempted to use session_write_close() but it makes no difference. Thanks for your help. Any other ideas I might be be able to try? Upon doing a quick search using something like $_SESSION second time I see that there are a number of others who seem to have similar problems, and no solutions. I couldn't see in your messages what PHP version you are using. Any chance to upgrade to 4.3.8? Regards, Torsten Roehr -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Lotus Notes DB to MySQL?
Hi there everyone, I have a client who uses Lotus Notes for her database, now she wants it converted to MySQL, is that possible? What format is notes DB in? Basically I will write a new front-end and back-end for her so she doesn't need notes anymore (Nasty, nasty software) but I need to import her old data first. Chris