[PHP-DB] SID
Hi list, Wonder if someone could assist me in Enabling Trans SIDs. I know how to use them, but just dont know the telnet command to enable them. If someone could tell me exactly what I need to do in order to have them enabled it would be much appreciated. Many thanks Barry Zimmerman www.bzdpltd.co.uk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Saving DB Resuts to a file
Hi there everyone, I have a newsletter which works wonderfully, sends to everyone in the DB fine with error checking etc .. My problem is my client now wants to be able to easily save the email addresses from the DB into a text file - so my question is, how can this be done? Connecting to the DB and executing a search based on criteria is not a problem, the problem is how do I write a text file which has the field email (From the table name newsletter) in it? I just need to copy the contents of email to a text file, but missing our other columns such as id and name. Thanks for any help, it's very appreicated. Chris
Re: [PHP-DB] Saving DB Resuts to a file
Hi there, I entered the code in as you described below, and it LOOKS on the screen as thought it is doing it, but when I look at the server there is no output file, can you see anything obvious that I am doing wrong? Thanks for your help. Chris $connection = mysql_connect(localhost,xx,xx) or die(Couldn't make a connection.); // select database $db = mysql_select_db(mailinglist, $connection) or die(Couldn't select database.); return $connection; $query = mysql_query(select * from emaillist); fopen(/web/newsletter/test.txt, w); while ($row = mysql_fetch_array($query)) { fwrite($row[EMail]\n); echo $row[EMail]; } fclose(/web/newsletter/test.txt); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Saving DB Resuts to a file
Hi Chris, This is probably due to a permissions problem on your newsletter subdirectory. Go to the server and change the newsletter subdirectory's permissions to be 777 (leaving it that way could be a security hazard, depending on if you have important information stored in that directory or not, and if there are other people that could get on the server). Then try running the script again. - Jonathan -Original Message- From: Chris Payne [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 1:52 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Saving DB Resuts to a file Hi there, I entered the code in as you described below, and it LOOKS on the screen as thought it is doing it, but when I look at the server there is no output file, can you see anything obvious that I am doing wrong? Thanks for your help. Chris $connection = mysql_connect(localhost,xx,xx) or die(Couldn't make a connection.); // select database $db = mysql_select_db(mailinglist, $connection) or die(Couldn't select database.); return $connection; $query = mysql_query(select * from emaillist); fopen(/web/newsletter/test.txt, w); while ($row = mysql_fetch_array($query)) { fwrite($row[EMail]\n); echo $row[EMail]; } fclose(/web/newsletter/test.txt); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Using include file
I pasted your code into a file testinclude.php (changing only the server name), then wrote another file test.php: ? include('testinclude.php'); ? It parses okay for me. How are you doing the include? -Steve On Friday, April 12, 2002, at 03:02 PM, Alex Francis wrote: I get a parse error on line 2. The code is as follows: ? $server = mysql.xcalibre.co.uk; $user = user; $passwd = password; $dbname = rschool; $tablename1 = story; $tablename2 = guestbook; $tablename3 = drawing; $tablename4=notices; $link = mysql_connect ($server, $user, $passwd); ? As I said, when I paste the code into each file I don't have a problem. -- Alex Francis Cameron Design 35, Drumillan Hill Greenock PA16 0XD Tel 01475 798106 [EMAIL PROTECTED] http://www.camerondesign.co.uk This message is sent in confidence for the addressee only. It may contain legally privileged information. Unauthorised recipients are requested to preserve this confidentiality and to advise the sender immediately of any error in transmission. Steve Cayford [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Just a guess: Are you doing the include from a function? If so, make sure you explicitly mark your global vars. Otherwise, what's the error message? -Steve On Friday, April 12, 2002, at 12:28 PM, Alex Francis wrote: I have one site which I am having problems connecting to my database. If I create my connections in an include config file I get an error on the server connection. When I cut and paste the code exactly as it is into each file I have no problems. I have a local server set up in my office which I use to test my databases and scripts and have a slightly different config file on that one. The include file works fine. I have various other sites using include config files and have had no problems, but this one is a pain, I have to change each file when I move it mrom my test server to my hosting server. Any help would be appreciated. -- Alex Francis Cameron Design 35, Drumillan Hill Greenock PA16 0XD Tel 01475 798106 [EMAIL PROTECTED] http://www.camerondesign.co.uk This message is sent in confidence for the addressee only. It may contain legally privileged information. Unauthorised recipients are requested to preserve this confidentiality and to advise the sender immediately of any error in transmission. -- 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 Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: LOBS with CURSOR_SHARING=FORCE gives core dump
John! Thanks for the update. Did you find any work-around for this issue? Thanks, Prince. John Lim [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hmm, I have also been having similar problems with LOBs. However it might not be cursor_sharing=force, because on my Win 2000 oracle, LOBs work fine with PHP with this parameter set. However on our Sun server, PHP crashes as you mention (yes cursor_sharing=force is set here too). PS: this is set in init.ora. Prince [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have the following php code. If I add the parameter CURSOR_SHARING=FORCE in my init.ora and while executing the program I get the Segmentation fault. $ /usr/local/php4/bin/php -q curshare.php Segmentation fault (core dumped) Is there any work-around for this? Is this a bug? This seems to be happening only when LOB with returning clause is present. I tested a similar program from C program and is fine. Note: currently I have set the parameter (CURSOR_SHARING=FORCE ) only in the program/session level. Thanks, Prince. $ cat curshare.php #!/usr/local/php4/bin/php -q ? //program name curshare.php $conn = OCILogon($dbuser, $dbpass, $dbname); //This is added to affect only the current session. $sql = alter session set cursor_sharing=force; $stmt = ociparse($conn,$sql); OCIExecute($stmt,OCI_DEFAULT); $lob = OCINewDescriptor($conn, OCI_D_LOB); $sqlstmt = insert into blob_test ( packageid, packagebody ) values('12344321123efd', EMPTY_BLOB()) returning packagebody into :packagebody; $stmt = OCIParse($conn, $sqlstmt) ; OCIBindByName($stmt, ':packagebody', $lob, -1, OCI_B_BLOB); OCIExecute($stmt, OCI_DEFAULT); OCICommit($conn); OCIFreeDesc($lob); OCIFreeStatement($stmt); OCILogoff($conn); ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Re: arguments against php / mysql?
Sun Microsystems makes a package called ChiliSoft that allows Unix servers to run ASP. I have done a minimal amount of checking into this, but the majority opinion is that this is a bad idea. http://www.chilisoft.com There is also an app called ASP2PHP that converts ASP code to PHP. I have to think that many tweaks would be necessary before you coun on the code, but may speed things up enough that you could go the recoding route. I've run into a similar situation (our company has recent investments in ASP/MSSQL applications). I proposed the idea of running 2 servers, being that the databases will practivally always function separately. olinux --- Mallen Baker [EMAIL PROTECTED] wrote: Thanks to Michael, Barry, Steve, Cal and Rasmus for replies. We have just taken a contract for a dedicated server, and I tried rather hard to get it to be a Linux server. The killer for that was that we have a significantly complex site that will need to be migrated to the server which has been coded in asp - which leaves us rather stuck with Windows and IIS. I stared this hard in the face and asked questions about the cost of recoding before being reluctantly persuaded this had to be. So that being the case, am I picking up the message that the criticisms are basically correct? ie. no-one ought to start from here, but if you're forced to use IIS (because asp won't work with anything else) then php / mysql is not going to be the way to go (xxx are proposing coldfusion / sqlserver). Thanks - Mallen Michael Kimsal [EMAIL PROTECTED] 04/10/02 08:59pm Barry C. Hawkins wrote: Mallen, It sounds like you might have some non-technical or open-source execs to talk to, and that a non-MS platform is not an option (yet :^) ). If so, here are some more managerial-type arrows for your quiver: 1.) MySQL was one of the top 2 databases in a Ziff-Davis major vendor shootout recently, ranking alongside Oracle 9i. See http://www.mysql.com/news/index.html under the heading MySQL a winner in server database clash. They like products more if they're mentioned in the same sentence as Oracle. Oracle was on the SuperBowl, you know. :^) 2.) Actually, PHP doesn't officially say that CGI is the recommended install for IIS. They simply issue a few caveats regarding SAPI. Check it out at: http://www.php.net/manual/en/install.windows.php Officially perhaps but I think the overwhelming consensus has been that ISAPI under Windows just didn't work. It *does* work now, as long as you don't use any third party DLLs (like MySQL, GD, etc) rendering it pretty useless. Sorry, it's just anecdotal evidence, but you'll notice that no one in the PHP camp will unequivocally say that PHP under ISAPI is solid. The silence on ISAPI speaks volumes right now. 3.) I have nothing to offer on the search engine issue. Now, I know that some of what I just said will incense some folks, because yes, ideally this poor fellow would be able to use *nix with Apache, MySQL, and PHP. But, since he may not have that luxury, these items might put enough spin on things for him to get the Open Source items in the door. Once that initial yes has been given, the subsequent steps might come more easily. If the only way to get open source products in the door is to have them running half-crippled (running on OSes they weren't designed for) you're giving open source products a bad image. No one expects ASP to run on anything but IIS (chilisoft notwithstanding). If the server HAS to be Windows, use ActiveState's Perl or something else with a company behind it and just go down that road. Having PHP run poorly under Windows will just make PHP look bad, even if it's Windows' fault. Michael Kimsal http://www.phphelpdesk.com 734-480-9961 This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- PHP Database Mailing List
[PHP-DB] Closing curly brackets?
Hi everyone, I originally posted this in general by mistake. I have a question about this code. The way it sits now it always shows the last record in the database table. In other words if the user has 6 items, like: item id 1 item id 2 item id 5 item id 6 item id 7 item id 8 it will only show the last record item id 8. I believe it has something to do with the first while statement's closing curly bracket placement but I can't seem to get it in the right place. Can someone spot the mistake and show me how to fix it. see also comments in code. $id = $HTTP_GET_VARS[id]; $query = SELECT id, name, image, quantity, type FROM {$config[prefix]}_my_items WHERE uid={$session[uid]} ORDER BY id; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $iid = $row['id']; $image = $row['image']; $name = $row['name']; $quantity = $row['quantity']; $type = $row['type']; if($iid == $id) { $display_block =CENTERimg src=$image border=0brfont size = 2$nameBR$quantityBR$type/font/CENTER; echo $display_blockBRBR; if($type == food) //if book or weapon is present then set an option and include in the form later {$thisoption=OPTION VALUE=\feed\Feed my pet\n/OPTION; }else{ //if any other type is present then set a blank $thisoption=;} } } //check if form has been submitted if($submit){ if($sort == 'shop') { echo This item has been taken care ofBR; // We are selecting user id to insert into the users items. $db=SELECT uid FROM {$config[prefix]}_users WHERE uid={$session[uid]}; $ret = mysql_query($db); while(list($db)=mysql_fetch_row($ret)) { $user = $db; echo Your user ID is $userBR; } echo You have $quantity of this item and it's id is $iidBR; } // it seems like the first while statement's closing curly bracket should go //here but if I put it here I get a parse error. }else{ //if the form has not been submitted run the following ? FORM ACTION=?echo$PHP_SELF;? METHOD=post SELECT NAME=sort SIZE=1 ?echo $thisoption;? OPTION VALUE=shopPut in my shop/OPTION OPTION VALUE=lockerPut into my Footlocker/OPTION OPTION VALUE=discardDiscard this item/OPTION OPTION VALUE=donateDonate this item/OPTION /SELECT INPUT TYPE=submit VALUE=Submit NAME=submit /FORM ? } //if I put the first while statement's closing curly bracket here it works except it prints multiple dropdown lists on the page and only prints the first item id 1. I have tried the bracket in numerous places but I can't find the right spot. Thanks in advance Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Closing curly brackets?
Maybe change mysql_fetch_array($ret) to mysql_fetch_row($ret)? Not sure but I've used that before to do what appears to be similar while loops.. Wouldn't the data still get retrieved in array form with that? If I'm wrong, feel free to publicly ridicule me.. Later, Bob Weaver Jennifer Downey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi everyone, I originally posted this in general by mistake. I have a question about this code. The way it sits now it always shows the last record in the database table. In other words if the user has 6 items, like: item id 1 item id 2 item id 5 item id 6 item id 7 item id 8 it will only show the last record item id 8. I believe it has something to do with the first while statement's closing curly bracket placement but I can't seem to get it in the right place. Can someone spot the mistake and show me how to fix it. see also comments in code. $id = $HTTP_GET_VARS[id]; $query = SELECT id, name, image, quantity, type FROM {$config[prefix]}_my_items WHERE uid={$session[uid]} ORDER BY id; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $iid = $row['id']; $image = $row['image']; $name = $row['name']; $quantity = $row['quantity']; $type = $row['type']; if($iid == $id) { $display_block =CENTERimg src=$image border=0brfont size = 2$nameBR$quantityBR$type/font/CENTER; echo $display_blockBRBR; if($type == food) //if book or weapon is present then set an option and include in the form later {$thisoption=OPTION VALUE=\feed\Feed my pet\n/OPTION; }else{ //if any other type is present then set a blank $thisoption=;} } } //check if form has been submitted if($submit){ if($sort == 'shop') { echo This item has been taken care ofBR; // We are selecting user id to insert into the users items. $db=SELECT uid FROM {$config[prefix]}_users WHERE uid={$session[uid]}; $ret = mysql_query($db); while(list($db)=mysql_fetch_row($ret)) { $user = $db; echo Your user ID is $userBR; } echo You have $quantity of this item and it's id is $iidBR; } // it seems like the first while statement's closing curly bracket should go //here but if I put it here I get a parse error. }else{ //if the form has not been submitted run the following ? FORM ACTION=?echo$PHP_SELF;? METHOD=post SELECT NAME=sort SIZE=1 ?echo $thisoption;? OPTION VALUE=shopPut in my shop/OPTION OPTION VALUE=lockerPut into my Footlocker/OPTION OPTION VALUE=discardDiscard this item/OPTION OPTION VALUE=donateDonate this item/OPTION /SELECT INPUT TYPE=submit VALUE=Submit NAME=submit /FORM ? } //if I put the first while statement's closing curly bracket here it works except it prints multiple dropdown lists on the page and only prints the first item id 1. I have tried the bracket in numerous places but I can't find the right spot. Thanks in advance Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Advice for dataupload
Hey, if the databases contain the same data, why don't you just have them use one database. Just set up MySQL with a user on the internet server that the intranet system uses to connect to it with.. Do it over SSL and it would be secure then. Wouldn't that be somewhat simpler and less time consuming? I mean if they are meant to contain the same data anyway... Later, Bob Weaver Hayan Al Mamoun [EMAIL PROTECTED] wrote in message 000101c1de13$d9e9af00$5e00a8c0@cybernation">news:000101c1de13$d9e9af00$5e00a8c0@cybernation... Dear all, I have two design-identical database, one on my intranet, the other on the internet, is there any procedure that Synchronizes the content of two databases? I'm using PHP applications and MySQL Database, WindowsNT4 IIS Please advice Best Regards Hayan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Closing curly brackets?
No public ridicule, although it doesn't work. From what I understand $query = SELECT id, name, image, quantity, type FROM is an array so if I were to use mysql_fetch_row($ret) it is only returning 1 row. where as mysql_fetch_array($ret) is returning the whole array. However I could be wrong to. But that is the way I understand it to be. ;) But thanks for trying. Jennifer [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Maybe change mysql_fetch_array($ret) to mysql_fetch_row($ret)? Not sure but I've used that before to do what appears to be similar while loops.. Wouldn't the data still get retrieved in array form with that? If I'm wrong, feel free to publicly ridicule me.. Later, Bob Weaver Jennifer Downey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi everyone, I originally posted this in general by mistake. I have a question about this code. The way it sits now it always shows the last record in the database table. In other words if the user has 6 items, like: item id 1 item id 2 item id 5 item id 6 item id 7 item id 8 it will only show the last record item id 8. I believe it has something to do with the first while statement's closing curly bracket placement but I can't seem to get it in the right place. Can someone spot the mistake and show me how to fix it. see also comments in code. $id = $HTTP_GET_VARS[id]; $query = SELECT id, name, image, quantity, type FROM {$config[prefix]}_my_items WHERE uid={$session[uid]} ORDER BY id; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $iid = $row['id']; $image = $row['image']; $name = $row['name']; $quantity = $row['quantity']; $type = $row['type']; if($iid == $id) { $display_block =CENTERimg src=$image border=0brfont size = 2$nameBR$quantityBR$type/font/CENTER; echo $display_blockBRBR; if($type == food) //if book or weapon is present then set an option and include in the form later {$thisoption=OPTION VALUE=\feed\Feed my pet\n/OPTION; }else{ //if any other type is present then set a blank $thisoption=;} } } //check if form has been submitted if($submit){ if($sort == 'shop') { echo This item has been taken care ofBR; // We are selecting user id to insert into the users items. $db=SELECT uid FROM {$config[prefix]}_users WHERE uid={$session[uid]}; $ret = mysql_query($db); while(list($db)=mysql_fetch_row($ret)) { $user = $db; echo Your user ID is $userBR; } echo You have $quantity of this item and it's id is $iidBR; } // it seems like the first while statement's closing curly bracket should go //here but if I put it here I get a parse error. }else{ //if the form has not been submitted run the following ? FORM ACTION=?echo$PHP_SELF;? METHOD=post SELECT NAME=sort SIZE=1 ?echo $thisoption;? OPTION VALUE=shopPut in my shop/OPTION OPTION VALUE=lockerPut into my Footlocker/OPTION OPTION VALUE=discardDiscard this item/OPTION OPTION VALUE=donateDonate this item/OPTION /SELECT INPUT TYPE=submit VALUE=Submit NAME=submit /FORM ? } //if I put the first while statement's closing curly bracket here it works except it prints multiple dropdown lists on the page and only prints the first item id 1. I have tried the bracket in numerous places but I can't find the right spot. Thanks in advance Jennifer --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php