People don't like top posting, but I'm doing it for a reason. See what's at the end ....
1. Clint - Don't hijack threads. Some people use threaded mail clients, and your "getting started" will end up under Yui's thread. 2. Is it *necessary* to have a confidentiality notice that's just about equal in bulk to your message? If it's part of a canned sig, why not create a little simple one for this list.
On to your question. Since you don't have all the code posted here, I suspect something is going on earlier in the file. Maybe you have an opening PHP tag, and a line without a semi-colon to terminate it.
Why not try again, with just a single line file: <? phpinfo(); ?> Once that works, then expand it. Regards - Miles Thompson At 08:37 PM 9/19/2005, Clint Lovell 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: This is an HTML line <?php echo "This is a PHP line"; phpinfo(); ?> 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:Martin.Norland@xxxxxxxxxx] Sent: Monday, September 19, 2005 2:04 PM To: php-db@xxxxxxxxxxxxx Subject: RE: 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:yui@xxxxxxxxxxxxxxxxxxxx] Sent: Monday, September 19, 2005 1:26 PM To: php-db@xxxxxxxxxxxxx Subject: 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 2>&1", '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
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php