Re: [PHP-DB] Getting Started..
Maybe you don't need the trailing semicolon after the phpinfo()? This is just a thought as sometimes you don't need it in the final php statement before the ? tag. Mark On 20/09/05, Clint Lovell [EMAIL PROTECTED] wrote: I'm just getting started here and I'm working with PHP MySQL for Dummies. The book says to write a simple file called test.php with the following entries in it: html head titlePHP Test/title /head body pThis is an HTML line p ?php echo This is a PHP line; phpinfo(); ? /body/html When I run http://localhost/test.php, this is the error I got: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\apachefriends\xampp\htdocs\test.php on line 9. Can someone tell me what's wrong and what I need to do to get things squared away? Thank you... Respectfully, Clinton E. Lovell Principal Rainmaker Marketing Corporation 15519 Dawnbrook Drive Houston, Texas 77068 (281) 537-1200 (206) 203-1229 (eFax) CONFIDENTIALITY NOTICE: This communication and any documents, or files, attached to it, constitute an electronic communication within the scope of the Electronic Communication Privacy Act, 18 USCA 2510. This communication may contain non-public, confidential, or legally privileged information intended for the consideration of the designated recipients(s). The unlawful interception, use, or disclosure of such information is strictly prohibited by 18 USCA 2511 and any applicable laws. If you have received this e-mail in error, please immediately notify us at (281) 537-1200 or via reply email and permanently delete the original and any copy of any e-mail, file or attachment and destroy any printout thereof. Thank you for your assistance. -Original Message- From: Norland, Martin [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 2:04 PM To: php-db@lists.php.net Subject: RE: [PHP-DB] insert error for mysql One of the strings you're inserting has an quotation mark (apostrophe). You're going to have to do some more careful data scrubbing on the incoming data. E.G. one of the strings says it's used in the retail, banking, and insurance industries, among ... And it's breaking the containing ' - insert into foo (bar) values ('this isn't going to work.'); might I suggest starting with addslashes() Cheers, - Martin Norland, Sys Admin / Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital. -Original Message- From: Yui Hiroaki [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 1:26 PM To: php-db@lists.php.net Subject: [PHP-DB] insert error for mysql. . hi! I have an error message to try to insert character into table. But I have an error messages like below. When I try to insert $strbuf, I got error. Could not perform INSERT to table 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 's used in the retail, banking, and insurance industries, among I publish SQL; mysql create table view(b_col_id mediumint(255) NOT NULL AUTO_INCREMENT, b_col longblob NOT NULL,file_name varchar(255) NOT NULL,file_size varchar(255) NOT NULL,file_type varchar(255) NOT NULL,file_date time,vtext longtext,PRIMARY KEY(b_col_id))TYPE=MyISAM; mysql alter tablev view add fulltext (vtext); The code-- $handle = popen(/usr/bin/pdftotext \$original_tmp\ - -layout 21, 'r'); $strbuf = fread($handle, 2048000); echo $strbuf; pclose($handle); $sql_insert = INSERT INTO view(b_col,file_name,file_size,file_type,file_date,vtext) VALUES ('$binaryContent','$original_name','$original_size','$original_type',CUR TIME(),'$strbuf'); mysql_query($sql_insert) or DIE (Could not perform INSERT to table .mysql_errno().: .mysql_error()); mysql_close($db); Please do help me! Yui -- 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 -- theExile.vze.com www.stpaulswalsall.org.uk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Problem with mysql_connect(...)
this is a dll issue; if you are running php5 on windows! read this.. http://www.experts-exchange.com/Web/Web_Languages/PHP/PHP_Installation/Q_21077014.html ~viraj. On 9/19/05, Dan [EMAIL PROTECTED] wrote: If this is a windows computer, you might want to try adding C:\PHP (or whatever directory your PHP resides) into the path. I read somewhere that this needs to be done for PHP5 and MySQL. Not sure if it was true but seemed to clear up the problems I was having getting the 2 to talk to either other. -Original Message- From: Michael Louie Loria [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 2:19 AM To: php-db@lists.php.net Subject: [PHP-DB] Re: Problem with mysql_connect(...) -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello. I'm trying to connect to my MySQL server with mysql_connect(...). The server is up and running, and I'm running Apache with PHP properly installed. The code: $hleServer = mysql_connect($host, $user, $password) or die(Error: Database. Error code: 1. Contact the web master!); $host, $user, and $password are set to correct values (checked and double checked). The funny thing is that not only does the function call fail, but I'm not even getting the text defined by die(...). It seems that the function call is more or less a black hole. Of course the rest of the script doesn't execute either, I'm just left with a blank page. I didn't use to have this problem before (using PHP 5 now instead of 4). check your configurations again. Try checking as if it was a fresh install of PHP5 php5apache2.dll is for PHP5 and probably you httpd.conf stills contains php4apache2.dll Michael Louie Loria -BEGIN PGP SIGNATURE- Comment: Public Key: https://www.biglumber.com/x/web?qs=0x4A256EC8 Comment: Public Key: http://www.lorztech.com/GPG.txt Comment: Google, Skype, Yahoo ID: michaellouieloria iQEVAwUBQy6Cd7XBHi2y3jwfAQpZ/Qf/WE5JesJT5FtecqonOOsgsHvEnWXatzWQ T/ajJxAcFXftSP8xbxs2z4HZqagwD05PIKN4Jqff+ibqY7zWp74J910ibyDNyHab Ui9StkzWuuNvmbg/N8QIlNXbxUqFIugjaJargKnPrtH2X8wl+nHJ1hZf4huQhrX9 7xJb3tgaI521IC8c+h+w1SIG5tt90Vcp6U9m21pnbwEfj01nky95JTuD1+6yWZD+ pZlJ7qrFzTgbKKty1kshIG42wvPuDLrHBayb9+aKo5LeX/Qbfab7iueUMJDoNxAO j+NwG/x8R/qb5eqGuhcMNmYn+GxwiQdawk1c4hGj4nN6BGFsGf67vg== =VUIf -END PGP SIGNATURE- --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0537-2, 09/16/2005 Tested on: 9/19/2005 5:18:51 PM avast! - copyright (c) 1988-2005 ALWIL Software. http://www.avast.com -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 9/16/2005 __ Yahoo! for Good Donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ -- 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] ordimage problem!!! (question for php+oracle expert)
Hi all oracle+php expert, we kept all image in oracle db. Now nearly we have 1 000 000 image in database. we want to export them to directory. but with php we couldn't do it. our process : ordimage type - blob type - jpeg file type - directory(save) Any body know it? any advice, we appreciate!! thanks a lot. rasimsen -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] ordimage problem!! (export image from oracle to directory with php)
Hi all oracle+php expert, we kept all image in oracle db. Now nearly we have 1 000 000 image in database. we want to export them to directory. but with php we couldn't do it. our process : ordimage type - blob type - jpeg file type - directory(save) Any body know it? any advice, we appreciate!! thanks a lot. rasimsen -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Help with MySQL configuration
Hi, I'm running MySQL 5 on a Win2K3 machine (2x3.2Ghz 4Gb RAM) Lately I experience some heavy login problems, Can't connect to MySQL server on 'localhost' (10048) and Service error ERROR: 10060 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (connection time: 5 sec). I'm trying to connect thru PHP5. This happens like 200-300 times a day. Please help me with my configuration. // Joakim Status: Uptime: 497170 Threads: 12 Questions: 27327337 Slow queries: 0 Opens: 0 Flush tables: 1 Open tables: 64 Queries per second avg: 54.966 My.ini: safe-show-database port=3307 join_buffer_size=1M basedir=C:/Program Files/MySQL/MySQL Server 5.0/ datadir=C:/Program Files/MySQL/MySQL Server 5.0/Data/ default-character-set=latin1 default-storage-engine=MyISAM max_connections=2000 max_user_connections=200 query_cache_size=32M query_cache_limit=1M query_cache_type=1 table_cache=1024 tmp_table_size=64M thread_cache_size=64 myisam_max_sort_file_size=100G myisam_max_extra_sort_file_size=100G myisam_sort_buffer_size=64M key_buffer=64M key_buffer_size=129M read_buffer_size=1M read_rnd_buffer_size=256K sort_buffer_size=2M #skip-innodb innodb_additional_mem_pool_size=6M innodb_flush_log_at_trx_commit=1 innodb_log_buffer_size=3M innodb_buffer_pool_size=250M innodb_log_file_size=50M innodb_thread_concurrency=10 wait_timeout=7200 connect_timeout=10 max_allowed_packet=16M max_connect_errors=1000 bulk_insert_buffer_size=8M [mysqld_safe] open_files_limit=8192 [mysqldump] quick max_allowed_packet=16M [myisamchk] key_buffer=64M sort_buffer=64M read_buffer=16M write_buffer=16M
[PHP-DB] Fwd: Code Optimization Help
Hello Everyone, I have some code that is using COM to interact with MS Word to create a mail merge based on my mysql database, however it is running dreadfully slow 13.53846 seconds to be exact. This is only running on 34 records, i could imagine running this on a few hundred records not to mention thousand. Is COM usually this slow? These load times i believe to be accurate as they come from zend studio's profiler. You can see screenshots of the profile @ http://codebowl.dontexist.net/bugs/MailMerge/ Below you will see my code, anything you guys see that i could do to speed this up quite a bit i would appreciate it. It seems the naughty methods are CreateHeader, CreateDataSource, CreateDocument. CODE = ?php class MailMerge { private $mm_data_dir; private $obj; private $fieldcnt; private $rowcnt; private $letter_template; private $envelope_template; public function __construct($list = null, $letter = 'Has_Site', $envelope = 'Envelope', $data_dir = 'data/mailmerge') { if(!is_array($list)) throw new Exception('Cannot Create A Mail Merge With An Empty List.'); $this-mm_data_dir = 'F:/htdocs/csaf/'.$data_dir; $this-list = $list; $this-letter_template = $letter; $this-envelope_template = $envelope; $this-initilize(); $this-CreateHeaderFile(); $this-CreateDataSource(); $this-CreateDocument($this-letter_template); $this-CreateDocument($this-envelope_template); } public function __destruct() { unlink($this-mm_data_dir.'/ds.doc'); unlink($this-mm_data_dir.'/header.doc'); } private function initilize() { $this-rowcnt = count($this-list); $this-fieldcnt = count($this-list[0]); } private function Close() { $this-obj-Documents-Close(); } private function Quit() { $this-obj-Quit(); } private function Release() { $this-obj = NULL; } private function CreateHeaderFile() { $this-obj = new COM(word.application) or die('Couldnt load Word!'); if(!is_object($this-obj)) throw new Exception('Unable to instanciate Word!'); $this-obj-Documents-Add(); $this-obj-ActiveDocument-Tables-Add($this-obj-Selection-Range,1,$this-fieldcnt); for($i = 0; $i = $this-rowcnt; $i++) { foreach($this-list[$i] as $key = $value) { $this-obj-Selection-TypeText($key); $this-obj-Selection-MoveRight(); } } $this-obj-ActiveDocument-SaveAs($this-mm_data_dir.'/header.doc'); $this-Close(); $this-Quit(); $this-Release(); } private function CreateDataSource() { $this-obj = new COM(word.application); if(!is_object($this-obj)) throw new Exception('Unable to instanciate Word!'); $this-obj-Documents-Add(); $this-obj-ActiveDocument-Tables-Add($this-obj-Selection-Range,$this-rowcnt,$this-fieldcnt); for($i = 0; $i = $this-rowcnt; $i++) { foreach($this-list[$i] as $key = $value) { $this-obj-Selection-TypeText($value); $this-obj-Selection-MoveRight(); } } $this-obj-ActiveDocument-SaveAs($this-mm_data_dir.'/ds.doc'); $this-Close(); $this-Quit(); $this-Release(); } private function CreateDocument($template) { $this-obj = new COM(word.application); if(!is_object($this-obj)) throw new Exception('Unable to instanciate Word!'); $this-obj-Documents-Open($this-mm_data_dir.'/'.$template.'.dot'); $this-obj-ActiveDocument-MailMerge-OpenHeaderSource($this-mm_data_dir.'/header.doc'); $this-obj-ActiveDocument-MailMerge-OpenDataSource($this-mm_data_dir.'/ds.doc'); $this-obj-ActiveDocument-MailMerge-Execute(); $this-obj-ActiveDocument-SaveAs($this-mm_data_dir.'/'.$template.'.doc'); $this-Close(); $this-Quit(); $this-Release(); } } ? [EMAIL PROTECTED] -- Joseph Crawford Jr. Codebowl Solutions, Inc. 1-802-671-2021 [EMAIL PROTECTED]
RE: [PHP-DB] Re: Problem with mysql_connect(...)
The reason that this worked for that message board is that they copied the DLL into the system32 folder (which is in the windows path.) The following can be found at http://us3.php.net/mysql and as you can see from this article, moving that file to system32 will work however, not recommended. PHP 5+ MySQL is no longer enabled by default, so the php_mysql.dll DLL must be enabled inside of php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. See the FAQ titled How do I add my PHP directory to the PATH on Windows for information on how to do this. Although copying libmysql.dll to the Windows system directory also works (because the system directory is by default in the system's PATH), it's not recommended. -Original Message- From: viraj [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 20, 2005 12:14 AM To: Dan Cc: Michael Louie Loria; php-db@lists.php.net Subject: Re: [PHP-DB] Re: Problem with mysql_connect(...) this is a dll issue; if you are running php5 on windows! read this.. http://www.experts-exchange.com/Web/Web_Languages/PHP/PHP_Installation/Q_210 77014.html ~viraj. On 9/19/05, Dan [EMAIL PROTECTED] wrote: If this is a windows computer, you might want to try adding C:\PHP (or whatever directory your PHP resides) into the path. I read somewhere that this needs to be done for PHP5 and MySQL. Not sure if it was true but seemed to clear up the problems I was having getting the 2 to talk to either other. -Original Message- From: Michael Louie Loria [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 2:19 AM To: php-db@lists.php.net Subject: [PHP-DB] Re: Problem with mysql_connect(...) -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello. I'm trying to connect to my MySQL server with mysql_connect(...). The server is up and running, and I'm running Apache with PHP properly installed. The code: $hleServer = mysql_connect($host, $user, $password) or die(Error: Database. Error code: 1. Contact the web master!); $host, $user, and $password are set to correct values (checked and double checked). The funny thing is that not only does the function call fail, but I'm not even getting the text defined by die(...). It seems that the function call is more or less a black hole. Of course the rest of the script doesn't execute either, I'm just left with a blank page. I didn't use to have this problem before (using PHP 5 now instead of 4). check your configurations again. Try checking as if it was a fresh install of PHP5 php5apache2.dll is for PHP5 and probably you httpd.conf stills contains php4apache2.dll Michael Louie Loria -BEGIN PGP SIGNATURE- Comment: Public Key: https://www.biglumber.com/x/web?qs=0x4A256EC8 Comment: Public Key: http://www.lorztech.com/GPG.txt Comment: Google, Skype, Yahoo ID: michaellouieloria iQEVAwUBQy6Cd7XBHi2y3jwfAQpZ/Qf/WE5JesJT5FtecqonOOsgsHvEnWXatzWQ T/ajJxAcFXftSP8xbxs2z4HZqagwD05PIKN4Jqff+ibqY7zWp74J910ibyDNyHab Ui9StkzWuuNvmbg/N8QIlNXbxUqFIugjaJargKnPrtH2X8wl+nHJ1hZf4huQhrX9 7xJb3tgaI521IC8c+h+w1SIG5tt90Vcp6U9m21pnbwEfj01nky95JTuD1+6yWZD+ pZlJ7qrFzTgbKKty1kshIG42wvPuDLrHBayb9+aKo5LeX/Qbfab7iueUMJDoNxAO j+NwG/x8R/qb5eqGuhcMNmYn+GxwiQdawk1c4hGj4nN6BGFsGf67vg== =VUIf -END PGP SIGNATURE- --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0537-2, 09/16/2005 Tested on: 9/19/2005 5:18:51 PM avast! - copyright (c) 1988-2005 ALWIL Software. http://www.avast.com -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 9/16/2005 __ Yahoo! for Good Donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ -- 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 Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] ordimage problem!!! (question for php+oracle expert)
i just did this with mysql and asp...its certainly possible... What is your code like? Do you have the correct permissions on the folder you are writing to? What didn't work? Bastien From: Rasim ÞEN [EMAIL PROTECTED] Reply-To: Rasim ÞEN [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] ordimage problem!!! (question for php+oracle expert) Date: Tue, 20 Sep 2005 10:39:49 +0300 Hi all oracle+php expert, we kept all image in oracle db. Now nearly we have 1 000 000 image in database. we want to export them to directory. but with php we couldn't do it. our process : ordimage type - blob type - jpeg file type - directory(save) Any body know it? any advice, we appreciate!! thanks a lot. rasimsen -- 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] phptotext]
if there is only English word inside pdf, I can retrieve text from pdf, but there are involved Japanese text inside pdf, I got error and can not retrieve any text from pdf. I would like to retrieve text from pdf. It is not necessarey to retrieve Japanese text. code--- $handle = popen(/usr/bin/pdftotext \$original_tmp\ - -layout 21, 'r'); $strbuf = fread($handle, 2048000); echo $strbuf;// showing error message Error: $strbuf = addslashes($strbuf); pclose($handle); $sql_insert = INSERT INTO view(b_col,file_name,file_size,file_type,file_date,vtext) VALUES ('$binaryContent','$original_name','$original_size','$original_type',CURTIME(),'$strbuf'); Vicente wrote: Yui wrote: $handle = popen(/usr/bin/pdftotext \$original_name\ - -layout ,'r'); $read = fread($handle, 2048000); echo $read; pclose($handle); But I can not see anything!! Please do help me! $tmpfile = '/home/domain/public_html/pdf_files/myfile.pdf'; chmod ($tmpfile, 0777); $salida = shell_exec(pdftotext /home/domain/public_html/pdf_files/$tmpfile 21); Here we assume pdftotext.exe is inside /home/domain/public_html/pdf_files/ Maybe you have this inside /usr/bin... etc. In this case be aware of the security restrictions in your server when you try to execute a program outside your secure environment. If you have these problems then you can put the executable in the same file's folder. No fear. It works. Also, you can translate the pdftotext error codes or messages to japanese ^_^ if (ereg('some words in the console answer', $salida)) { print 'my message in jp'; } etc.. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Programming Design
Hi all, my company is trying to generate a programming standardization document and i'll like to consult you guys on some basic terminologies. please advise me if the following is true -- jobs | | programs | | - | | modules | | | - | | | functions | | | | basically, what i need to know is when designing a system, is it true that we will have: 1) many JOBS e.g. user maintenance page, customer maintenance page and these JOBS comprise of 2) many PROGRAMS e.g. user enquiry, user entry, user printout and these PROGRAMS comprise of 3) many MODULES e.g. a user entry program will need to display a list of users, the form to enter or edit a user's info and another to validate the entries and insert into the database and these MODULES comprise of 4) many FUNCTIONS e.g. calculateAge($dateOfBirth) is this true? what about the meaning of TASKS, OBJECTS and where do they fit? many thanks, Hwee -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php