Re: [PHP-DB] characters problem
I finally used the str_replace and now it works! :-) Thank you all for your help Panos Jochem Maas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Bastien Koert wrote: Two years and you haven't heard of: addslashes? mysql_reaL_escape_string? or even something as simple as $comments = str_replace(','',$comments); to replace the one quote with two single quotes (don't forget to remove them on the display...) I thount that the first single-quote escapes the second and only 1 is stored. so I took 2 seconds to type 'mysql.com single quote' into google and ... well check out: http://dev.mysql.com/doc/mysql/en/String_syntax.html (personally I think the style CS on the site makes some of the information hard to digest) good luck. bastien From: Panos Yahoo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] characters problem Date: Fri, 17 Dec 2004 09:38:15 +0200 Dear All, I am using php and mysql the last two years, and I still cannot find the way to update a field on mysql from php that containts the single quotes ( ` and ' ) Examples Here is an example of my index.php file. I have to type something on Comments field - ? include(../configs/dates.inc); include(../configs/config.inc); echo br body bgcolor=#FFF8E1 text=#2003CF link=#2003CF vlink=#2003CF alink=#2003CF center form method=post action=add.php font face=\Comic Sans MS\Commentsbrtextarea rows=3 cols=40 name=mycomments tabind ex=22/textarea input type=submit name=Submit value=\Add Ticket\ input type=reset name=Reset value=\Clear Form\ ; mysql_close($myconn); ? - In the html text area, I am typing the following text : Hello My name is Panos and I'm from Greece The add.php file looks like this : - ? include(../configs/dates.inc); include(../configs/config.inc); $myquery=INSERT INTO `$table` (`comments`) VALUES ('$mycomments'); $myresult=mysql_db_query($db,$myquery); mysql_close($myconn); echo done; ? - ANd when i'm trying to see what was added on mysql, i have the following result : Hello My name is Panos and I\ - The field on mysql is TEXT Does anyone knows how can i resolve this problem? Thanks Panos -- 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] Object oriented database in PHP?
Has anybody implemented an object oriented database in PHP yet? -- symbulos partners -.- symbulos - ethical services for your organisation http://www.symbulos.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Object oriented database in PHP?
From: symbulos partners [EMAIL PROTECTED] Has anybody implemented an object oriented database in PHP yet? No... PHP would not be a suitable programming language to create a database in... If you mean an OO abstraction layer to a database, however... then yeah. ---John Holmes... UCCASS - PHP Survey System http://www.bigredspark.com/survey.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] _POST, _GET, _REQUEST not working
Hello, I am running PHP 4.39 as a CGI under Tomcat 5.025, Linux 2.4.20-31.9. Configure = './configure' '--with-java=/usr/java/j2sdk1.4.2_04' '--with-servlet=/home/www/jakarta-tomcat-5.0.25' '--with-mysql' I cannot get the _GET function or _REQUEST functions to pick up values from a form generating even though I can see the query string values in the URL as in: http://localhost:8080/ip7/httptest.php?var1=212122var2=343434 My HTML is very simple: form action=http://localhost:8080/ip7/httptest.php; method=get input type=text name=var1 input type=text name=var2 input type=submit /form The PHP program httptest.php is also very simple: ?PHP global $_SERVER, $_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE; if(!empty($_REQUEST['var1'])) { $var1 = $_REQUEST['var1']; } else { $var1 ='undefined'; } if(!empty($_GET['var2'])) { $var2 = $_GET['var2']; } else $var2 ='undefined'; // Various HMTL tags removed for simplicity echo $var1 echo $var1 ? I have tried everything I can think of including using HTML POST instead of GET, setting register_globals = On/Off. Thanks in advance. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] New plPHP is out
Hello, There is a new release of plPHP. This version support PHP 4 and 5. The new version has the following new features: - allow return of SETOF of the base types; - arrays as parameters; - warnings are removed about cache memory leaks It can be found at http://plphp.commandprompt.com Sincerely, Joshua D. Drake -- Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC Postgresql support, programming shared hosting and dedicated hosting. +1-503-667-4564 - [EMAIL PROTECTED] - http://www.commandprompt.com PostgreSQL Replicator -- production quality replication for PostgreSQL -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] _POST, _GET, _REQUEST not working
Warren wrote: Hello, I am running PHP 4.39 as a CGI under Tomcat 5.025, Linux 2.4.20-31.9. Configure = './configure' '--with-java=/usr/java/j2sdk1.4.2_04' '--with-servlet=/home/www/jakarta-tomcat-5.0.25' '--with-mysql' I cannot get the _GET function or _REQUEST functions to pick up values from they are variables not functions. a form generating even though I can see the query string values in the URL as in: http://localhost:8080/ip7/httptest.php?var1=212122var2=343434 My HTML is very simple: form action=http://localhost:8080/ip7/httptest.php; method=get input type=text name=var1 input type=text name=var2 input type=submit /form The PHP program httptest.php is also very simple: ?PHP global $_SERVER, $_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE; all the vars listed above are super globals you don't have to declare them as global - they are everywhere! this may also be the cause of the problem, what happens when you remove this line? also have you tried var_dump() or print_r() on the $_GET/$_POST/etc arrays? ps - not a very DB related question is it? if(!empty($_REQUEST['var1'])) { $var1 = $_REQUEST['var1']; } else { $var1 ='undefined'; } if(!empty($_GET['var2'])) { $var2 = $_GET['var2']; } else $var2 ='undefined'; // Various HMTL tags removed for simplicity echo $var1 echo $var1 ? I have tried everything I can think of including using HTML POST instead of GET, setting register_globals = On/Off. leaving this off is recommended. Thanks in advance. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Redhat-MySQL Issues
I am trying to get PHP (4.3.2) to connect to MySQL 4.1.8 on a Redhat AS 3.0 server. I ran the command: up2date php-mysql And on the initial run-through, PHP connected to MySQL no problem. But then I changed something in the PHP.ini and the next time I ran a PHP to Mysql script, I got the following error message: Fatal error: Call to undefined function: mysql_connect() All I changed in the PHP.ini was the include path. What could have happened? I am so in the dark on how to fix this! Thanks, Nathan -- Nathan Mealey Director of Operations Cycle-Smart, Inc. P.O. Box 1482 Northampton, MA 01061-1482 [EMAIL PROTECTED] (413) 210-7984 (512) 681-7043 Fax
[PHP-DB] Parse errors ,,, can you. impart me about it.
hallo friend, i have developed simple and small database website using php ,html and java script. but i am getting these three parse errors on clicking , i have checked 3-4 imes on these line numbers, but there wasn't any $ variable. php script is also correctly written. what is this T_STRING error. can you help me regarding this. thank you. errors: Parse error: parse error, unexpected $ in /home/dollar1/public_html/signup.php3 on line 379 Parse error: parse error, unexpected $ in /home/dollar1/public_html/login.php3 on line 152 Parse error: parse error, unexpected T_STRING in /home/dollar1/public_html/addfunds.php3 on line 91 - Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. Learn more.