Re: [PHP-DB] Prepared Statements Insert Problem
On Sun, Sep 2, 2012 at 6:45 AM, Ethan Rosenberg, PhD erosenb...@hygeiabiomedical.com wrote: Dear List - I wish to accomplish the following with prepared statements: $stmt = mysqli_stmt_init($cxn); if($stmt = mysqli_stmt_prepare($stmt, INSERT INTO Intake3 (Site, MedRec, Fname, Lname, Phone, Height, Sex, Hx, Bday, Age) VALUES(?,?,?,?,?,?,?,?,?,?)!=0) It seems you're missing a ')' here. Help and advice, please. Ethan Rosenberg If that doesn't fix it, try printing mysqli_error($cxn) instead of Ouch.. - Matijn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Prepared Statements Insert Problem
Ethan Rosenberg, PhD /Pres/CEO/ *Hygeia Biomedical Research, Inc* 2 Cameo Ridge Road Monsey, NY 10952 T: 845 352-3908 F: 845 352-7566 erosenb...@hygeiabiomedical.com On 09/02/2012 08:33 AM, Matijn Woudt wrote: On Sun, Sep 2, 2012 at 6:45 AM, Ethan Rosenberg, PhD erosenb...@hygeiabiomedical.com wrote: Dear List - I wish to accomplish the following with prepared statements: $stmt = mysqli_stmt_init($cxn); if($stmt = mysqli_stmt_prepare($stmt, INSERT INTO Intake3 (Site, MedRec, Fname, Lname, Phone, Height, Sex, Hx, Bday, Age) VALUES(?,?,?,?,?,?,?,?,?,?)!=0) It seems you're missing a ')' here. Help and advice, please. Ethan Rosenberg === If that doesn't fix it, try printing mysqli_error($cxn) instead of Ouch.. - Matijn +++ No error. Ethan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Prepared Statements Insert Problem - Any more ideas?
On Sun, Sep 2, 2012 at 6:45 AM, Ethan Rosenberg, PhD erosenb...@hygeiabiomedical.com wrote: Dear List - I wish to accomplish the following with prepared statements: $stmt = mysqli_stmt_init($cxn); if($stmt = mysqli_stmt_prepare($stmt, INSERT INTO Intake3 (Site, MedRec, Fname, Lname, Phone, Height, Sex, Hx, Bday, Age) VALUES(?,?,?,?,?,?,?,?,?,?)!=0) Help and advice, please. Ethan Rosenberg *+ Any more idead? -- 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] Prepared Statements Insert Problem - Any more ideas?
On Sun, Sep 2, 2012 at 10:41 PM, Ethan Rosenberg, PhD erosenb...@hygeiabiomedical.com wrote: On Sun, Sep 2, 2012 at 6:45 AM, Ethan Rosenberg, PhD erosenb...@hygeiabiomedical.com wrote: Dear List - I wish to accomplish the following with prepared statements: $stmt = mysqli_stmt_init($cxn); if($stmt = mysqli_stmt_prepare($stmt, INSERT INTO Intake3 (Site, MedRec, Fname, Lname, Phone, Height, Sex, Hx, Bday, Age) VALUES(?,?,?,?,?,?,?,?,?,?)!=0) Help and advice, please. Ethan Rosenberg *+ Any more idead? You're still missing the closing parenthesis here, and I told you that mysqli_error should give you some more info. Did you try that? Your reply with 'no error' doesn't really make sense on it's own.. Also, IIRC, I think you need to use one extra set of parenthesis, like this: if(($stmt = mysqli_stmt_prepare()) != 0) - Matijn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Prepared Statement Insert Problem
Remove the quotes around the variables in all your statements. For example, this statement: mysqli_stmt_bind_param($submitadmin, isss, '$numrows', '$admin', sha1('$password'), '$email'); could be rewritten as: mysqli_stmt_bind_param($submitadmin, isss, $numrows, $admin, sha1($password), $email); On Tue, Jul 21, 2009 at 8:01 PM, Jason Carson ja...@jasoncarson.ca wrote: Hello everyone, I have a problem. I use the following to *try* and insert data into my MySQL database... //Variables come from a form $username= $_POST['username']; $password = $_POST['password']; $email = $_POST['email']; //Connect to the database $connect = mysqli_connect($hostname, $dbusername, $dbpassword, $database)or die(cannot connect); //Find out how many rows in the database $aidcount = mysqli_query ($connect, SELECT * FROM administrator); $numrows = mysqli_num_rows($aidcount); //The next 3 lines are using prepared statements to insert data but the //second line ...mysqli_stmt_bind_param.. results in this error... //Fatal error: Only variables can be passed by reference in file.php line 46 $submitadmin = mysqli_prepare($connect2, INSERT INTO administrator VALUES (?, ?, ?, ?)); mysqli_stmt_bind_param($submitadmin, isss, '$numrows', '$admin', sha1('$password'), '$email'); mysqli_stmt_execute($submitadmin); ...anyone know how I can solve this problem so I can insert data into my database with prepared statements? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Prepared Statement Insert Problem
That worked, thanks! Remove the quotes around the variables in all your statements. For example, this statement: mysqli_stmt_bind_param($submitadmin, isss, '$numrows', '$admin', sha1('$password'), '$email'); could be rewritten as: mysqli_stmt_bind_param($submitadmin, isss, $numrows, $admin, sha1($password), $email); On Tue, Jul 21, 2009 at 8:01 PM, Jason Carson ja...@jasoncarson.ca wrote: Hello everyone, I have a problem. I use the following to *try* and insert data into my MySQL database... //Variables come from a form $username= $_POST['username']; $password = $_POST['password']; $email = $_POST['email']; //Connect to the database $connect = mysqli_connect($hostname, $dbusername, $dbpassword, $database)or die(cannot connect); //Find out how many rows in the database $aidcount = mysqli_query ($connect, SELECT * FROM administrator); $numrows = mysqli_num_rows($aidcount); //The next 3 lines are using prepared statements to insert data but the //second line ...mysqli_stmt_bind_param.. results in this error... //Fatal error: Only variables can be passed by reference in file.php line 46 $submitadmin = mysqli_prepare($connect2, INSERT INTO administrator VALUES (?, ?, ?, ?)); mysqli_stmt_bind_param($submitadmin, isss, '$numrows', '$admin', sha1('$password'), '$email'); mysqli_stmt_execute($submitadmin); ...anyone know how I can solve this problem so I can insert data into my database with prepared statements? -- 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] Prepared Statement Insert Problem
kesavan trichy rengarajan wrote: could be rewritten as: mysqli_stmt_bind_param($submitadmin, isss, $numrows, $admin, sha1($password), $email); Turning on E_STRICT in PHP 5.3 will show PHP Strict Standards: Only variables should be passed by reference This is also true in earlier versions although the warning isn't displayed. For compliance, try: $s = sha1($password); mysqli_stmt_bind_param($submitadmin, isss, $numrows, $admin, $s, $email); Chris -- Blog: http://blogs.oracle.com/opal Twitter: http://twitter.com/ghrd -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Prepared Statement Insert Problem
Done. Thanks for letting me know about that. kesavan trichy rengarajan wrote: could be rewritten as: mysqli_stmt_bind_param($submitadmin, isss, $numrows, $admin, sha1($password), $email); Turning on E_STRICT in PHP 5.3 will show PHP Strict Standards: Only variables should be passed by reference This is also true in earlier versions although the warning isn't displayed. For compliance, try: $s = sha1($password); mysqli_stmt_bind_param($submitadmin, isss, $numrows, $admin, $s, $email); Chris -- Blog: http://blogs.oracle.com/opal Twitter: http://twitter.com/ghrd -- 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] Prepared Statement Insert Problem
Hi i wanna ask a question. I am trying to create an image on fly, please do help me , following is the code. *File Name : Font.php Code: * html head titleImage Creation/title script language=javascript var xmlhttp; function showPic() { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert (Browser does not support HTTP Request); return; } var text = document.getElementById(textfield).value; var url=image.php; url=url+?text=text; alert(url); url=url+sid=+Math.random(); xmlhttp.onreadystatechange=stateChanged; xmlhttp.open(GET,url,true); xmlhttp.send(null); } function stateChanged() { if (xmlhttp.readyState==4) { if(xmlhttp.responseText == 1) { document.getElementById(pic).style.display=block; } } } function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject(Microsoft.XMLHTTP); } return null; } /script /head body form name=form1 method=post action= onSubmit= return false; table width=304 border=1 tr td colspan=2div align=centerText/div/td /tr tr tdText/td tdlabel input type=text name=textfield id=textfield /label/td /tr tr td colspan=2label div align=center input type=submit name=button id=button value=Update onClick=showPic() /div /label/td /tr tr td colspan=2div id=pic style=display:noneimg src=pic.jpg //div/td /tr /table /form /body /html *File Name : image.php Code:* [php] $name = $_GET['text']; $pic = imagecreatetruecolor(100, 100); $text_color = imagecolorallocate($pic, 255, 255, 255); imagestring($pic, 10, 15, 15, $name, $text_color); $pi = Imagejpeg($pic,pic.jpg); echo $pi; ImageDestroy($pic); [/php] *Problem: * What this code is doing is that, it creates a new image with the text (that user enters) on it, but loads the image that was created previously, I want that it should display the text on the picture which users enter on the fly. ( e.g. If user enter TEXT as text it should display TEXT on the picture displayed).Hope you got the problem. Thanks For me, it shoould work like this: User enters text intext filed (in font.html) , when pressed button, image.php should create an im On Tue, Jul 21, 2009 at 10:46 PM, Christopher Jones christopher.jo...@oracle.com wrote: kesavan trichy rengarajan wrote: could be rewritten as: mysqli_stmt_bind_param($submitadmin, isss, $numrows, $admin, sha1($password), $email); Turning on E_STRICT in PHP 5.3 will show PHP Strict Standards: Only variables should be passed by reference This is also true in earlier versions although the warning isn't displayed. For compliance, try: $s = sha1($password); mysqli_stmt_bind_param($submitadmin, isss, $numrows, $admin, $s, $email); Chris -- Blog: http://blogs.oracle.com/opal Twitter: http://twitter.com/ghrd -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL update statement problem
You need to separate the SET arguments with commas, not ANDs... It's really doing something like this: UPDATE shop_customer SET eu_vat_number = (SK1234567890 AND vat_amount = 0 AND total_amount = 8.4925) WHERE customer_id = 7 AND hash=dcd5e751 (SK1234567890 AND vat_amount = 0 AND total_amount = 8.4925) evaluates to false (0) , so that's what gets set. Kevin Davies - Bonhurst Consulting wrote: Hi, Apologies if this isn't the right place to ask - but I'm banging my head against the wall with this one! I'm trying to update a record in the table (creation script below) using the following SQL statement: UPDATE shop_customer SET eu_vat_number = SK1234567890 AND vat_amount = 0 AND total_amount = 8.4925 WHERE customer_id = 7 AND hash=dcd5e751 Before running the query the value for eu_vat_number is 'null', vat_amount is 0.085 and total_amount = 8.5775. After I run the query (mysql_affected_rows = 1) the values for vat_amount and total_amount remain the same, but vat_number is changed to 0. I've been looking at this most of the afternoon, and it's probably something really simple but I just can't see it... Any ideas? Thanks in advance for your help... Cheers, Kev -- Server version: 3.23.58 -- PHP Version: 4.3.10 CREATE TABLE `shop_customer` ( `customer_id` int(11) NOT NULL auto_increment, `hash` varchar(8) NOT NULL default '', `first_name` varchar(255) NOT NULL default '', `last_name` varchar(255) NOT NULL default '', `email_address` varchar(255) NOT NULL default '', `member_id` int(11) default NULL, `address1` varchar(255) default NULL, `address2` varchar(255) default NULL, `town` varchar(255) default NULL, `county` varchar(255) default NULL, `postcode` varchar(255) default NULL, `country` int(11) NOT NULL default '0', `eu_vat_number` varchar(15) default NULL, `total_items` int(11) default '0', `net_amount` float default '0', `vat_amount` float default '0', `shipping_amount` float default '0', `total_amount` float default '0', `added` datetime NOT NULL default '-00-00 00:00:00', `payment_received` datetime default NULL, PRIMARY KEY (`customer_id`) ) TYPE=MyISAM AUTO_INCREMENT=8 ; -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL update statement problem
Jenaro, You're absolutely right (',' instead of 'and' - schoolboy error!). I've obviously been staring at the screen too long! Strange that MySQL accepted it as a valid statement though. Many thanks for the quick reply. I'm off to have a lie down! :) Thanks and regards, Kevin -Original Message- From: Jenaro Centeno Gómez [mailto:[EMAIL PROTECTED] Sent: 04 March 2006 17:35 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MySQL update statement problem Maybe I am wrong, biut isn´this the rigth way to do this: UPDATE shop_customer SET eu_vat_number = SK1234567890, vat_amount = 0,total_amount = 8.4925 WHERE customer_id = 7 AND hash=dcd5e751 Sorry, I've not used too much MySQL but this is the rigth way in Oracle, PostgreSQL and SQLServer. Hope this helps. Kevin Davies - Bonhurst Consulting escribió: Hi, Apologies if this isn't the right place to ask - but I'm banging my head against the wall with this one! I'm trying to update a record in the table (creation script below) using the following SQL statement: UPDATE shop_customer SET eu_vat_number = SK1234567890 AND vat_amount = 0 AND total_amount = 8.4925 WHERE customer_id = 7 AND hash=dcd5e751 Before running the query the value for eu_vat_number is 'null', vat_amount is 0.085 and total_amount = 8.5775. After I run the query (mysql_affected_rows = 1) the values for vat_amount and total_amount remain the same, but vat_number is changed to 0. I've been looking at this most of the afternoon, and it's probably something really simple but I just can't see it... Any ideas? Thanks in advance for your help... Cheers, Kev -- Server version: 3.23.58 -- PHP Version: 4.3.10 CREATE TABLE `shop_customer` ( `customer_id` int(11) NOT NULL auto_increment, `hash` varchar(8) NOT NULL default '', `first_name` varchar(255) NOT NULL default '', `last_name` varchar(255) NOT NULL default '', `email_address` varchar(255) NOT NULL default '', `member_id` int(11) default NULL, `address1` varchar(255) default NULL, `address2` varchar(255) default NULL, `town` varchar(255) default NULL, `county` varchar(255) default NULL, `postcode` varchar(255) default NULL, `country` int(11) NOT NULL default '0', `eu_vat_number` varchar(15) default NULL, `total_items` int(11) default '0', `net_amount` float default '0', `vat_amount` float default '0', `shipping_amount` float default '0', `total_amount` float default '0', `added` datetime NOT NULL default '-00-00 00:00:00', `payment_received` datetime default NULL, PRIMARY KEY (`customer_id`) ) TYPE=MyISAM AUTO_INCREMENT=8 ; -- L.A. Jenaro Centeno Gómez Administración de Redes y Bases de Datos Alimentos La Concordia, S.A. de C.V. Loma de Prados No. 1332 Col. La Marimba Lagos de Moreno, Jal. C.P. 47470 Tel.- 01 474 741 92 00 Ext. 9280 La informacion contenida en este mensaje y sus anexos es de caracter privado y confidencial y para el uso exclusivo de la persona o institucion a la cual ha sido enviado y para otros autorizados para recibirlo, por lo que no podra distribuirse sin la autorizacion expresa del remitente. Si usted no es el destinatario a quien este mensaje fue dirigido o si no es un empleado responsable del envio de este mensaje al destinatario, se hace de su conocimiento que cualquier revision, diseminacion, distribucion, copia u otro uso o acto realizado con base en o relacionado con el contenido de este mensaje y sus anexos está estrictamente prohibida y puede ser ilegal. Asimismo, el presente mensaje no representa la manifestacion del consentimiento de ninguna de las partes, por lo que no genera derecho u obligación alguna para ambas sino hasta que sus representantes legales asi lo manifiesten por escrito. Si usted ha recibido este comunicado y sus anexos por error, le solicitamos lo notifique inmediatamente al remitente respondiendo a este correo y borre el presente y sus anexos de su sistema sin conservar copia de los mismos. Se suprimieron acentos y caracteres especiales para legibilidad del mismo. Gracias. Alimentos La Concordia, S.A. de C.V. The information contained in this message and its attachments is private and confidential and is intended solely for the use of the individual or entity to whom it is addressed and others who are authorized to receive it; therefore, its distribution cannot be possible without authorization from the sender. If you are not the intended recipient or an employee responsible for delivering this message to the intended recipient, you are hereby notified that any revision, dissemination, distribution, copying or other use or action based upon or relative to the information contained in this message and its attachments is strictly prohibited and may be unlawful. You are also informed that the contents of this message shall not be considered as an agreement between the parties and shall not bind any of them until their attorneys decide to do so in writing. If you have received this message and its attachments
RE: [PHP-DB] MySQL in PHP5 - problem with charset
does your web server, php and db all use the same charset? they all should match From: Dominik Fi¹er [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] MySQL in PHP5 - problem with charset Date: Sun, 11 Sep 2005 14:35:44 +0200 I have problem with MySQL in PHP 5.0.4 (WIN XP). I use charset cp1250 (win-1250, Czech) and PHP5 show results from db in incorect charset. When i use PHP 4, there is no problem! Configuration MySQL server is in both case the same. -- 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] MySQL in PHP5 - problem with charset
I think yes. PHP default_charset = win-1250, mysql: def. char. set cp1250, apahce 2: AddDefaultCharset WINDOWS-1250 (AddCharset WINDOWS-1250 .cp-1250 .win-1250) With php4 with same configuration apache2 and mysql server is all OK. Bastien Koert [EMAIL PROTECTED] pí¹e v diskusním pøíspìvku news:[EMAIL PROTECTED] does your web server, php and db all use the same charset? they all should match From: Dominik Fi¹er [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] MySQL in PHP5 - problem with charset Date: Sun, 11 Sep 2005 14:35:44 +0200 I have problem with MySQL in PHP 5.0.4 (WIN XP). I use charset cp1250 (win-1250, Czech) and PHP5 show results from db in incorect charset. When i use PHP 4, there is no problem! Configuration MySQL server is in both case the same. -- 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] load data infile -- problem
I could be 100% wrong on this, but I do not think that a command line statement can be executed through mysql_query() - try exec(). If I remember correctly mysql load data infile ... is not executed from within mysql, but at the command line. (Hint: look at the source for phpMyAdmin and copy how it is done.) Regards - Miles At 08:30 AM 8/18/2005, select.now wrote: Helo everyone ! I find this problem and I think I am close to the solution but ... The question: I need to import a few thousand of record storee in a *.csv file on my local harddisk, with my php application, managing my mysql engine. So, in command line, all works fine, all records are correctly imported. command line code - mysql load data infile 'c:\\datastream\\import\import -into table iport - fields terminated by ';' - ignore 9 lines; - /command line code But in my php app, because I am confuse a bit (use of ['], [] and the definition of variables in mysql_query), I don't make this import. -- php code --- $a = 'c:\\\datastream\\\import\\\import'; $extra_arg = 'fields terminated by \';\' ignore 9 lines;'; $query = 'load data infile \''.$a.'\' into table import '.$extra_arg.''; $result = mysql_query ($query) or die_mysql (brExecutia comenzii i$query/i a esuat.br); -- /php code -- I get this output-error: === load data infile 'c:\\datastream\\import\\import' into table import fields terminated by ';' ignore 9 lines; === and the import doesn't occured. Where is located my mistake ? Thanks in advance. -- cu respect, [EMAIL PROTECTED] -- 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] load data infile -- problem
You can definitely do a load file from within the mysql client, so I'd guess you can do it through mysql_query, too. I'm wondering about the semi-colon within the query. Maybe it needs to be escaped, too. David I could be 100% wrong on this, but I do not think that a command line statement can be executed through mysql_query() - try exec(). If I remember correctly mysql load data infile ... is not executed from within mysql, but at the command line. (Hint: look at the source for phpMyAdmin and copy how it is done.) Regards - Miles At 08:30 AM 8/18/2005, select.now wrote: Helo everyone ! I find this problem and I think I am close to the solution but ... The question: I need to import a few thousand of record storee in a *.csv file on my local harddisk, with my php application, managing my mysql engine. So, in command line, all works fine, all records are correctly imported. command line code - mysql load data infile 'c:\\datastream\\import\import -into table iport - fields terminated by ';' - ignore 9 lines; - /command line code But in my php app, because I am confuse a bit (use of ['], [] and the definition of variables in mysql_query), I don't make this import. -- php code --- $a = 'c:\\\datastream\\\import\\\import'; $extra_arg = 'fields terminated by \';\' ignore 9 lines;'; $query = 'load data infile \''.$a.'\' into table import '.$extra_arg.''; $result = mysql_query ($query) or die_mysql (brExecutia comenzii i$query/i a esuat.br); -- /php code -- I get this output-error: === load data infile 'c:\\datastream\\import\\import' into table import fields terminated by ';' ignore 9 lines; === and the import doesn't occured. Where is located my mistake ? Thanks in advance. -- cu respect, [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] load data infile -- problem
is the file sitting on the same server as the db? Are the webserver and db on the same machine? If they are not, and the file uploaded to the webserver, the db sesrver machine won't have access to the file unless you ftp it over... You may want/need to investigate a more php based approach where you open the file and read it in, parsing thru it to access the data elements and running sql statements thru a loop Bastien From: [EMAIL PROTECTED] To: Miles Thompson [EMAIL PROTECTED] CC: php-db-list php-db@lists.php.net Subject: Re: [PHP-DB] load data infile -- problem Date: Thu, 18 Aug 2005 09:25:22 -0500 You can definitely do a load file from within the mysql client, so I'd guess you can do it through mysql_query, too. I'm wondering about the semi-colon within the query. Maybe it needs to be escaped, too. David I could be 100% wrong on this, but I do not think that a command line statement can be executed through mysql_query() - try exec(). If I remember correctly mysql load data infile ... is not executed from within mysql, but at the command line. (Hint: look at the source for phpMyAdmin and copy how it is done.) Regards - Miles At 08:30 AM 8/18/2005, select.now wrote: Helo everyone ! I find this problem and I think I am close to the solution but ... The question: I need to import a few thousand of record storee in a *.csv file on my local harddisk, with my php application, managing my mysql engine. So, in command line, all works fine, all records are correctly imported. command line code - mysql load data infile 'c:\\datastream\\import\import -into table iport - fields terminated by ';' - ignore 9 lines; - /command line code But in my php app, because I am confuse a bit (use of ['], [] and the definition of variables in mysql_query), I don't make this import. -- php code --- $a = 'c:\\\datastream\\\import\\\import'; $extra_arg = 'fields terminated by \';\' ignore 9 lines;'; $query = 'load data infile \''.$a.'\' into table import '.$extra_arg.''; $result = mysql_query ($query) or die_mysql (brExecutia comenzii i$query/i a esuat.br); -- /php code -- I get this output-error: === load data infile 'c:\\datastream\\import\\import' into table import fields terminated by ';' ignore 9 lines; === and the import doesn't occured. Where is located my mistake ? Thanks in advance. -- cu respect, [EMAIL PROTECTED] -- 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] Newbie with mail problem
Use a real hostname, not 'localhost'.- -- Atte, Andrés G. Montañez Técnico en Redes y Telecomunicaciones Montevideo - Uruguay -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Newbie with mail problem
Andrés G. Montañez [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Use a real hostname, not 'localhost'.- Will give that a try. Thank you. -- Atte, Andrés G. Montañez Técnico en Redes y Telecomunicaciones Montevideo - Uruguay -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] strtotime: Last Month problem
try the mktime function bastien From: Shay [EMAIL PROTECTED] Reply-To: Shay [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] strtotime: Last Month problem Date: Wed, 30 Mar 2005 15:02:27 -0700 Hi, I'm trying to use strtotime(last month), strtotime(-1 month), or strtotime(1 month ago) to get the last month. However, it keeps returning March, not February. This started happening just yesterday, March 29th. This obviously has something to do with February's shorter amount of days, since I've never had this problem before. Anyone know a way around this? Thanks in advance. -- 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] is this a problem ?
amol patil wrote: hallo, i have changed file signup1.php with login1.php, in action fied of form form name=form1 method=POST action=-- and saved . but when i run this file and click on submit button, it still shows old sighnup1.php. and data is also not entering in database. while it data was entering in databse before this. but not now with this change. no error shown. only shows previous page and no data entry Amol: Please slow down and do some basic debugging as Cpt. Holmes suggests. You need to be able to trace your form submittal every step of the way. You can do this by carefully observing your browser, page source (as it is received by your browser), your browser's Javascript console, your server logs (both access and error logs). You should insert debug statments in your script as necessary so you can tell exactly what is happening. You have not responded to my previous reply, namely: --Are you getting any messages in your webserver error log when you click on 'submit'? (And let me add: Are you even getting a second hit on your webserver access log when you submit your form? You may not be leaving the browser when you click on submit.) --Try including an 'else' in your 'if' statement (along with a debug message) so you can see if the 'submit' is detected by your script when the form is submitted. -John -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] is this a problem ?
There are scores of examples / tutorials on this. Google turned up 6,070 hits on this expression: add user php mysql example Here's one of them, although it assumes register globals is on http://www.php-scripts.com/php_diary/072000.php3 Why don't you pick one, work with it and adapt it to your needs. However, why is your form's action parameter set to a string of hyphens? Regards - Miles Thompson At 09:25 AM 12/28/2004, amol patil wrote: hallo, i have changed file signup1.php with login1.php, in action fied of form form name=form1 method=POST action=-- and saved . but when i run this file and click on submit button, it still shows old sighnup1.php. and data is also not entering in database. while it data was entering in databse before this. but not now with this change. no error shown. only shows previous page and no data entry __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] is this a problem ?
On Tue 28 Dec 04, 11:44 AM, Miles Thompson [EMAIL PROTECTED] said: At 09:25 AM 12/28/2004, amol patil wrote: hallo, i have changed file signup1.php with login1.php, in action fied of form form name=form1 method=POST action=-- and saved . but when i run this file and click on submit button, it still shows old sighnup1.php. and data is also not entering in database. while it data was entering in databse before this. but not now with this change. no error shown. only shows previous page and no data entry There are scores of examples / tutorials on this. Google turned up 6,070 hits on this expression: add user php mysql example Here's one of them, although it assumes register globals is on http://www.php-scripts.com/php_diary/072000.php3 Why don't you pick one, work with it and adapt it to your needs. However, why is your form's action parameter set to a string of hyphens? Regards - Miles Thompson Agreed. Also, you'd get *much* better replies to your request for help if you read this: http://www.catb.org/~esr/faqs/smart-questions.html Sometimes it's very difficult to ask a good question, and I think esr breaks his own rule (volume is not precision), but he says all the right things, and has some excellent advice. This isn't meant to be a put-down or a joke. Most people think that asking a question absolves them of thinking. Like a quick-fix. On the contrary, asking a good question can be a lot of work. Respectfully, Pete -- The mathematics of physics has become ever more abstract, rather than more complicated. The mind of God appears to be abstract but not complicated. He also appears to like group theory. -- Tony Zee's Fearful Symmetry GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Multi-User Update Problem
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 30 November 2004 14:45, SCALES, Andrew wrote: Thanks very much for your help. The main difficulty I was having really was unlocking the record again if the user crashed out or just closed down their browser/computer (something they have a bad habit of doing) but storing the time the record was locked and ignoring the lock if it's over that time sounds interesting. I may try storing the data in a session variable and then comparing that to the database before the updated data is inserted into the record as Bastien suggested. We wanted to keep hits on the db to a minimum, but seen as some extra traffic will be necessary anyway I may just try that. Another approach to this might be: Keep a column in your database table for time of last update of each record. When a user reads a record for update, don't lock it at this point, but save the time at which it was read into the user's session (or somewhere in the database). On receiving a potential update, check the time the record was read (as recorded above) and the last update time of the record (lock the record as part of this query) -- if the update time is later then the read time, someone else has updated in the interim and you should abandon ship; otherwise, update the record including a new last-updated value; in either case, unlock the record. This methodology keeps both the lock and unlock in the same script (and potentially within a single database transaction), so no need for any external checks for locked records, and minimizes the amount of time for which any one record is locked. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Multi-User Update Problem
I apologise if my explanation caused confusion. What I meant to say was that the update page will pull down the relative record as chosen by a search page prior to the update page and then populate the form with that data. Then when someone submits the form all of the fields will be updated in that record, even if they haven't changed anything. The problem is that we have some pages where more than one person has to work on the same record and so there's always a risk of two people with the same record open at once overwriting each other's changes. Thanks very much for your suggestions though. Andy -Original Message- From: Norland, Martin [mailto:[EMAIL PROTECTED] Sent: Monday, 29 November 2004 15:36 To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Multi-User Update Problem -Original Message- Does anyone know a good way of locking out access to a record on a MySQL database when someone has the update page open? The problem is that we have a local intranet site which is accessed by members of different departments. Now at the moment when someone loads the page all of the data is pulled into the form, and then when they submit, all of that data is passed back to the database, including anything they haven't changed. snip You should really rethink whether sending all those records is necessary, or wise. Is the convenience of mass updates really worth the headache? What we are trying to avoid is situations where for example someone leaves the form open on their computer and goes away for lunch. In the meantime someone else at a different station makes changes to the form. Then when the first person comes back from lunch, they submit the form, thereby writing over all of the second person's changes with the old data. snip My personal opinion on this: Any database that's so simple/small that it should have its entire contents updated every change, should only be managed by a single person. If that isn't an option, then the individuals should be modifying individual records instead of the entire recordset. This means a listing page, and selecting the record (or records, using checkboxes) to update. This is where you can easily set your locking, perhaps with a timestamp that will time out after X minutes, to prevent users overwriting. If neither of these are options, you have larger problems then you'll be able to properly solve in a web environment. Forcing the browser to re-display the page every minute [set the href explicitly, not reload, in case of post/etc.] is something that should at least reduce the chances of massive overwrite errors. Not that I particularly approve of that method :) It is, however, a relatively functional solution - if you're stuck with neither of the above as being options. - Martin Norland, 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. -- 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] Multi-User Update Problem
Thanks very much for your help. The main difficulty I was having really was unlocking the record again if the user crashed out or just closed down their browser/computer (something they have a bad habit of doing) but storing the time the record was locked and ignoring the lock if it's over that time sounds interesting. I may try storing the data in a session variable and then comparing that to the database before the updated data is inserted into the record as Bastien suggested. We wanted to keep hits on the db to a minimum, but seen as some extra traffic will be necessary anyway I may just try that. Thank you both for the advice, Andy -Original Message- From: Gryffyn, Trevor [mailto:[EMAIL PROTECTED] Sent: Monday, 29 November 2004 15:44 To: [EMAIL PROTECTED] Cc: Bastien Koert; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Multi-User Update Problem Yeah, all good thoughts. Someone else had a similar question that I answered recently (I think it was in private email) and in addition to the thoughts below, you might also look into recording WHEN the record was opened (and locked) so you can expire the lockout. I'd use this in conjunction with a browser side META REFRESH and a PRAGMA cache expire command so if the person who opened the record doesn't do anything with it within 2 hours, their browser auto-refreshes (maybe notifying them that their session was terminating and if they want to save the work they've done already) and it unlocks the file. You could also have a nightly job run that looks for all records locked over 2 hours ago or something and auto-unlock them (or just have the script that looks to see if something's locked see if it was over 2 hours ago and ignore the Locked == TRUE tag in the database). Anyway, the idea is to expire the session and user's cache so that they'll get a Warning: Page Expired making it impossible for them to update something after 2 hours has passed or something like that. Also to free up locked pages on a regular basis or allow people to get into them again if they time out. -TG -Original Message- From: Bastien Koert [mailto:[EMAIL PROTECTED] Sent: Monday, November 29, 2004 10:22 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Multi-User Update Problem Its a tough one. My personal fav is to mark the record as locked by changing a field called 'locked' from 0 to 1. Check for this when extracting the record and if is present, alert the user this record is locked (if you want to get fancy you could even track who locked it and the tell the user that) and show a non-updatable form of the page (either with the fields as readonly or by creating some kind of view only page where the data is simply echoed out). If you want to get REALLY out there, you could track who requested the locked record and notify them when it was released(by the original requestor submitting the form). The possibilities are endless The other option is to create/write an entire concurrency module that will store the record in a separate entity (another table or session object) and then compare any changes made upon submission. I have seen this but I don't really like it, since the ultimate choice is left to the user as to what data is correct. Bastien From: SCALES, Andrew [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] Multi-User Update Problem Date: Mon, 29 Nov 2004 11:16:08 - Hello, Does anyone know a good way of locking out access to a record on a MySQL database when someone has the update page open? The problem is that we have a local intranet site which is accessed by members of different departments. Now at the moment when someone loads the page all of the data is pulled into the form, and then when they submit, all of that data is passed back to the database, including anything they haven't changed. What we are trying to avoid is situations where for example someone leaves the form open on their computer and goes away for lunch. In the meantime someone else at a different station makes changes to the form. Then when the first person comes back from lunch, they submit the form, thereby writing over all of the second person's changes with the old data. Does anyone know of a good way to solve or work around this problem? We have thought about setting a flag on the database whenever someone pulls down the data, however if their browser crashes or they shutdown with the window open then this is going to leave the data locked. Thanks very much, Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Multi-User Update Problem
You could always lock a record and only allow that user to see the locked files (maybe showing an icon indicating that it SHOULD already be checked out in another browser window and ask if the user still wants to open the file (in the case of a computer crash or they closed their browser without properly checking the file back in, etc). Keeping hits on a database to a minimum is a good goal, but databases are meant to be used and abused too.. So don't be afraid to do a little select or update from time to time. It's when you do things like select * from MillionRowTable repeatedly that you have issues. :) Good luck! -TG -Original Message- From: SCALES, Andrew [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 30, 2004 9:45 AM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Multi-User Update Problem Thanks very much for your help. The main difficulty I was having really was unlocking the record again if the user crashed out or just closed down their browser/computer (something they have a bad habit of doing) but storing the time the record was locked and ignoring the lock if it's over that time sounds interesting. I may try storing the data in a session variable and then comparing that to the database before the updated data is inserted into the record as Bastien suggested. We wanted to keep hits on the db to a minimum, but seen as some extra traffic will be necessary anyway I may just try that. Thank you both for the advice, Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Multi-User Update Problem
Its a tough one. My personal fav is to mark the record as locked by changing a field called 'locked' from 0 to 1. Check for this when extracting the record and if is present, alert the user this record is locked (if you want to get fancy you could even track who locked it and the tell the user that) and show a non-updatable form of the page (either with the fields as readonly or by creating some kind of view only page where the data is simply echoed out). If you want to get REALLY out there, you could track who requested the locked record and notify them when it was released(by the original requestor submitting the form). The possibilities are endless The other option is to create/write an entire concurrency module that will store the record in a separate entity (another table or session object) and then compare any changes made upon submission. I have seen this but I don't really like it, since the ultimate choice is left to the user as to what data is correct. Bastien From: SCALES, Andrew [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] Multi-User Update Problem Date: Mon, 29 Nov 2004 11:16:08 - Hello, Does anyone know a good way of locking out access to a record on a MySQL database when someone has the update page open? The problem is that we have a local intranet site which is accessed by members of different departments. Now at the moment when someone loads the page all of the data is pulled into the form, and then when they submit, all of that data is passed back to the database, including anything they haven't changed. What we are trying to avoid is situations where for example someone leaves the form open on their computer and goes away for lunch. In the meantime someone else at a different station makes changes to the form. Then when the first person comes back from lunch, they submit the form, thereby writing over all of the second person's changes with the old data. Does anyone know of a good way to solve or work around this problem? We have thought about setting a flag on the database whenever someone pulls down the data, however if their browser crashes or they shutdown with the window open then this is going to leave the data locked. Thanks very much, Andy -- 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] Multi-User Update Problem
-Original Message- Does anyone know a good way of locking out access to a record on a MySQL database when someone has the update page open? The problem is that we have a local intranet site which is accessed by members of different departments. Now at the moment when someone loads the page all of the data is pulled into the form, and then when they submit, all of that data is passed back to the database, including anything they haven't changed. snip You should really rethink whether sending all those records is necessary, or wise. Is the convenience of mass updates really worth the headache? What we are trying to avoid is situations where for example someone leaves the form open on their computer and goes away for lunch. In the meantime someone else at a different station makes changes to the form. Then when the first person comes back from lunch, they submit the form, thereby writing over all of the second person's changes with the old data. snip My personal opinion on this: Any database that's so simple/small that it should have its entire contents updated every change, should only be managed by a single person. If that isn't an option, then the individuals should be modifying individual records instead of the entire recordset. This means a listing page, and selecting the record (or records, using checkboxes) to update. This is where you can easily set your locking, perhaps with a timestamp that will time out after X minutes, to prevent users overwriting. If neither of these are options, you have larger problems then you'll be able to properly solve in a web environment. Forcing the browser to re-display the page every minute [set the href explicitly, not reload, in case of post/etc.] is something that should at least reduce the chances of massive overwrite errors. Not that I particularly approve of that method :) It is, however, a relatively functional solution - if you're stuck with neither of the above as being options. - Martin Norland, 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. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Multi-User Update Problem
Yeah, all good thoughts. Someone else had a similar question that I answered recently (I think it was in private email) and in addition to the thoughts below, you might also look into recording WHEN the record was opened (and locked) so you can expire the lockout. I'd use this in conjunction with a browser side META REFRESH and a PRAGMA cache expire command so if the person who opened the record doesn't do anything with it within 2 hours, their browser auto-refreshes (maybe notifying them that their session was terminating and if they want to save the work they've done already) and it unlocks the file. You could also have a nightly job run that looks for all records locked over 2 hours ago or something and auto-unlock them (or just have the script that looks to see if something's locked see if it was over 2 hours ago and ignore the Locked == TRUE tag in the database). Anyway, the idea is to expire the session and user's cache so that they'll get a Warning: Page Expired making it impossible for them to update something after 2 hours has passed or something like that. Also to free up locked pages on a regular basis or allow people to get into them again if they time out. -TG -Original Message- From: Bastien Koert [mailto:[EMAIL PROTECTED] Sent: Monday, November 29, 2004 10:22 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Multi-User Update Problem Its a tough one. My personal fav is to mark the record as locked by changing a field called 'locked' from 0 to 1. Check for this when extracting the record and if is present, alert the user this record is locked (if you want to get fancy you could even track who locked it and the tell the user that) and show a non-updatable form of the page (either with the fields as readonly or by creating some kind of view only page where the data is simply echoed out). If you want to get REALLY out there, you could track who requested the locked record and notify them when it was released(by the original requestor submitting the form). The possibilities are endless The other option is to create/write an entire concurrency module that will store the record in a separate entity (another table or session object) and then compare any changes made upon submission. I have seen this but I don't really like it, since the ultimate choice is left to the user as to what data is correct. Bastien From: SCALES, Andrew [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] Multi-User Update Problem Date: Mon, 29 Nov 2004 11:16:08 - Hello, Does anyone know a good way of locking out access to a record on a MySQL database when someone has the update page open? The problem is that we have a local intranet site which is accessed by members of different departments. Now at the moment when someone loads the page all of the data is pulled into the form, and then when they submit, all of that data is passed back to the database, including anything they haven't changed. What we are trying to avoid is situations where for example someone leaves the form open on their computer and goes away for lunch. In the meantime someone else at a different station makes changes to the form. Then when the first person comes back from lunch, they submit the form, thereby writing over all of the second person's changes with the old data. Does anyone know of a good way to solve or work around this problem? We have thought about setting a flag on the database whenever someone pulls down the data, however if their browser crashes or they shutdown with the window open then this is going to leave the data locked. Thanks very much, Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MSSQL INSERT query problem
Chris wrote: Here is the code I use: [snip] $sql = $db-prepare(INSERT INTO ExitSurveyAnswers (session_id, Question_id, answer) VALUES ?,?,?); [snip] When I execute it I keep recieving and error message stating: DB Error: syntax error Not a MSSQL expert, but shouldn't the ?,?,? in your query have parenthesis around it?? $sql = $db-prepare(INSERT INTO ExitSurveyAnswers (session_id, Question_id, answer) VALUES (?,?,?)); -- John Holmes php|architect - The magazine for PHP professionals - http://www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Easy reg expression problem
In article [EMAIL PROTECTED], Jason Wong wrote: On Friday 16 July 2004 08:05, Justin Patrin wrote: If you're simply trying to get '@email.com' then use strstr(). Of courseI'm just so used to pregs... Well the advantage of using a regex is that you can perform some form of validation on the address. And in the end compare your regular expression with the one at: http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html -- Tim Van Wassenhove http://home.mysth.be/~timvw -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Easy reg expression problem
On Friday 16 July 2004 16:01, Tim Van Wassenhove wrote: In article [EMAIL PROTECTED], Jason Wong wrote: On Friday 16 July 2004 08:05, Justin Patrin wrote: If you're simply trying to get '@email.com' then use strstr(). Of courseI'm just so used to pregs... Well the advantage of using a regex is that you can perform some form of validation on the address. And in the end compare your regular expression with the one at: http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html That's why I qualified my statement by saying some form of. Anyway, in general using a regex as opposed to a straight string function will allow some form of data validation. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db -- /* What we Are is God's gift to us. What we Become is our gift to God. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Easy reg expression problem
On Friday 16 July 2004 08:05, Justin Patrin wrote: If you're simply trying to get '@email.com' then use strstr(). Of courseI'm just so used to pregs... Well the advantage of using a regex is that you can perform some form of validation on the address. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db -- /* Never mind the bullet with your name on it, try to avoid the shrapnel addressed to occupant -- Murphy's New Military Laws n4 */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Extremely Urgent: Problem with PHP and Oracle
Justin Patrin wrote: Charles Morris wrote: putenv(ORACLE_SID=PROJ); putenv(ORACLE_HOME=/home/oracle9); I have tried putenv myself and it doesn't seem to work for Oracle connections. Putting those in your shell environment, then restarting apache. Check to see if the env vars are set from a PHP script (without using putenv to set them of course). I agree. See http://otn.oracle.com/tech/opensource/php/php_troubleshooting_faq.html#envvars Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Load data infile problem
Actually, I have just figured it out. It had to do with the 'slashes' around the query. The original $sql code was created using phpmyadmin, but I messed around with it until it worked, now using the following query: mysql_query(LOAD DATA INFILE 'C:abc.txt' INTO TABLE abc FIELDS TERMINATED BY '\\t' ESCAPED BY '\\\' LINES TERMINATED BY '\\r\\n'); So it was the query formatting which was the problem. Thanks Justin -Original Message- From: Jonathan Haddad [mailto:[EMAIL PROTECTED] Sent: Tuesday, 8 June 2004 2:06 PM To: Baiocchi, Justin (LI, Armidale) Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Load data infile problem does your server have the post variables set as globals? you might have to use $_POST['submit'] instead. On Jun 7, 2004, at 9:17 PM, [EMAIL PROTECTED] wrote: Hello, I have a page with a button that when clicked loads a pre-determined text file into my database. The code is posted below. However, when clicked the button does nothing, just opens up the same page again. The data does not get loaded into the database. any ideas? Thanks Justin The page is viewall.php which has the button on it. So I want it (when clicked) to update the database and return to the page. td width=100% align=center ?php if ($submit) { $dbH = mysql_connect('localhost', 'root', 'password') or die('Could not connect to MySQL server.br' . mysql_error()); mysql_select_db(options); $sql = 'LOAD DATA INFILE \'C:abc.txt\' REPLACE INTO TABLE `abc`' . 'FIELDS TERMINATED BY \'\\t\'' . 'ENCLOSED BY \'\'' . 'ESCAPED BY \'\'' . 'LINES TERMINATED BY \'\\r\\n\''; } ? ?php $d = form method=post action='viewall.php'. input type=submit name=submit value='Submit'/form; echo $d; ? /td -- Jonathan Haddad [EMAIL PROTECTED] http://www.superwebstuff.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql - SELECT DISTINCT problem
Very odd. I would think it would return every record seeing as the auto_increment ID field is different for every record. I use SELECT DISTINCT tip, marca, model FROM modele to select records without duplicates on the field tip. This works ok, BUT if I use SELECT DISTINCT tip, marca, model, id FROM... (id is auto_increment and is the table's primary key) my query won't produce any result. ANyone has a clue? Thank you! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] another strange MYSQL problem
- Original message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Sat, 8 May 2004 23:23:05 +0300 Subject: [PHP-DB] another strange MYSQL problem Hello, First, I use this, and all is ok: SELECT * FROM modele WHERE marca='Aprilia' ORDER BY tip ASC. Then, I use this: SELECT * FROM modele WHERE marca='Cagiva' ORDER BY tip ASC and the records are not ordered ascending by the field tip. In the first case, the records were ordered. Anyone knows what is wrong? Thank you! Best regards, Marius Panaitescu -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Well, this might not answer your question (or it might) but you should not use * in your queries. Specify each column you want to retrieve. This also might fix you problem, but I'm not sure. -- Marcjon -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] another strange MYSQL problem
Run those queries again and send in the result set. Maybe they're being sorted but it looks off, also what is the data type for you 'tip' column. Post your db schema if possible. R Quoting Marcjon Louwersheimer [EMAIL PROTECTED]: - Original message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Sat, 8 May 2004 23:23:05 +0300 Subject: [PHP-DB] another strange MYSQL problem Hello, First, I use this, and all is ok: SELECT * FROM modele WHERE marca='Aprilia' ORDER BY tip ASC. Then, I use this: SELECT * FROM modele WHERE marca='Cagiva' ORDER BY tip ASC and the records are not ordered ascending by the field tip. In the first case, the records were ordered. Anyone knows what is wrong? Thank you! Best regards, Marius Panaitescu -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Well, this might not answer your question (or it might) but you should not use * in your queries. Specify each column you want to retrieve. This also might fix you problem, but I'm not sure. -- Marcjon -- 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] another strange MYSQL problem
[EMAIL PROTECTED] wrote: First, I use this, and all is ok: SELECT * FROM modele WHERE marca='Aprilia' ORDER BY tip ASC. Then, I use this: SELECT * FROM modele WHERE marca='Cagiva' ORDER BY tip ASC and the records are not ordered ascending by the field tip. In the first case, the records were ordered. Anyone knows what is wrong? Thank you! The first query works perfectly. The second returns no results. The data type for 'tip' is text. Then you have no rows where marca is equal to 'Cagiva'... -- ---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
Re: [PHP-DB] Re: PHP OO Problem
Is there any way to destroy the object in PHP? http://us2.php.net/manual/en/function.unset.php Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] INSERT dynamic values problem - Need help urgently!
Irin, First of all, you need to do this instead of what you're doing: while ($row = mysql_fetch_row($sql)) Second, this value should be storable just as any other values. i.e. mysql_query(insert into database (table) values(' . $_POST['class_code'] . ')); I hope this helps you a bit. Regards, Mikael On Feb 27, 2004, at 15:26, [EMAIL PROTECTED] wrote: Hi all: I am trying to create a registration form whereby one of the user input is as follows: (a drop down menu with values retrieved from DB): --- -- td class=lighter width=350Class Code:/td td class=lighter width=450 select class=textarea name=class_code ? $sql = mysql_query(SELECT DISTINCT class_code FROM class); while ($row = mysql_fetch_array($sql)) { print OPTION VALUE=\$class_code\ .$row[class_code]. /option; } $result = $db-query($sql); ? /select --- -- My problem was: 1. I was unable to print the values I have selected from this drop down menu and 2. insert this dynamic values into the DB?? I was able to insert static values into DB but not dynamic values... How should I go about doing this? Really need some help here... Thanks in advance. All help are greatly appreciated. Regards, Irin. -- 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] SQL File Import problem (Was: HELP!!!)
I have the same problem right now, after a very short search in google i found this: http://www.mysql.com/documentation/mysql/bychapter/manual_Problems.html#Gone _away In my case i get the message max_allowed_packet is too small because i was trying to insert an image 1M into the database. - Original Message - From: Doug Thompson [EMAIL PROTECTED] To: Robin 'Sparky' Kopetzky [EMAIL PROTECTED] Cc: Erwin Kerk [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 27, 2004 1:04 AM Subject: Re: [PHP-DB] SQL File Import problem (Was: HELP!!!) On Fri, 27 Feb 2004 01:16:20 +0100, Erwin Kerk wrote: Robin 'Sparky' Kopetzky wrote: Good afternoon! I used SQLYOG to export the tables and data from a Mysql database. Now, when i try to re-import the data back into a different database, I get an error stating Error : MySQL server has gone away. What is happening and how do I fix this. I NEED this script to execute badly. I even tries running it under mysql using source filename.sql and got the same error. One table is over 75,000 entries. The queries are taking too long. Are this plain .sql files? If so, try to split them up in say, 10 separate files, and import them all separately. That should work. And in the futue, try putting a more descriptive text in youre subject. Erwin Kerk Web Developer -- Erwin is exactly right.That being said: You don't say and it's risky to assume if you can do any other tasks on the new server. In other words, is it running at all? You don't say which of SQLyog's methods you used to create the backup. In this case, I would have used DB - Export Database as Batch Scripts and I would save the file as somefile.sql and transfer that file to the mysql/bin directory on the new system. Assuming mysqld is running on the new system, cd to the mysql/bin subdirectory and type ./mysql -uusername -ppassword somefile.sql Of course, all the foregoing syntax for re-installing presumes *n*x. I move databases from my local windows system to a remote *n*x site frequently using the above process and it is very reliable and repeatable. hth, Doug -- 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] INSERT dynamic values problem - Need help urgently!
Hi all: I am trying to create a registration form whereby one of the user input is as follows: (a drop down menu with values retrieved from DB): - td class=lighter width=350Class Code:/td td class=lighter width=450 select class=textarea name=class_code ? $sql = mysql_query(SELECT DISTINCT class_code FROM class); while ($row = mysql_fetch_array($sql)) { print OPTION VALUE=\$class_code\ .$row[class_code]. /option; } $result = $db-query($sql); ? /select 1. The variable $class_code is undefined. Use: print OPTION VALUE=\. $row[ class_code ] .\ .$row[class_code]. /option; 2. Use mysql_fetch_assoc() instead mysql_fetch_array() if you want to fetch hashed array ONLY. 3. After the form submitted the variable $_REQUEST[ 'class_code' ] contains selected item value, for example 1234. You can insert it into database using the following SQL query: $sql = 'INSERT INTO `class` (`class_code`, `another_field`, `third_etc` ) VALUES( ' . mysql_escape_string( $_REQUEST[ 'class_code' ] ) . ', value, value_etc )'; Sorry for my english. Pavel. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] INSERT dynamic values problem - Need help urgently!
Try: OPTION VALUE=\$row['class_code']\ .$row[class_code]. /option; while ($row = mysql_fetch_array($sql)) { print OPTION VALUE=\$class_code\ .$row[class_code]. /option; } $result = $db-query($sql); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] SQL File Import problem (Was: HELP!!!)
On Fri, 27 Feb 2004 01:16:20 +0100, Erwin Kerk wrote: Robin 'Sparky' Kopetzky wrote: Good afternoon! I used SQLYOG to export the tables and data from a Mysql database. Now, when i try to re-import the data back into a different database, I get an error stating Error : MySQL server has gone away. What is happening and how do I fix this. I NEED this script to execute badly. I even tries running it under mysql using source filename.sql and got the same error. One table is over 75,000 entries. The queries are taking too long. Are this plain .sql files? If so, try to split them up in say, 10 separate files, and import them all separately. That should work. And in the futue, try putting a more descriptive text in youre subject. Erwin Kerk Web Developer -- Erwin is exactly right.That being said: You don't say and it's risky to assume if you can do any other tasks on the new server. In other words, is it running at all? You don't say which of SQLyog's methods you used to create the backup. In this case, I would have used DB - Export Database as Batch Scripts and I would save the file as somefile.sql and transfer that file to the mysql/bin directory on the new system. Assuming mysqld is running on the new system, cd to the mysql/bin subdirectory and type ./mysql -uusername -ppassword somefile.sql Of course, all the foregoing syntax for re-installing presumes *n*x. I move databases from my local windows system to a remote *n*x site frequently using the above process and it is very reliable and repeatable. hth, Doug -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] SQL File Import problem (Was: HELP!!!)
Thank you to all who helped. I was able using UltraEdit to chop up the sql file and created all of the individual INSERT statements. Now, I'm up and running again. Slow but it worked! Thanks again! Robin Kopetzky -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] SQL File Import problem (Was: HELP!!!)
Robin 'Sparky' Kopetzky wrote: Good afternoon! I used SQLYOG to export the tables and data from a Mysql database. Now, when i try to re-import the data back into a different database, I get an error stating Error : MySQL server has gone away. What is happening and how do I fix this. I NEED this script to execute badly. I even tries running it under mysql using source filename.sql and got the same error. One table is over 75,000 entries. The queries are taking too long. Are this plain .sql files? If so, try to split them up in say, 10 separate files, and import them all separately. That should work. And in the futue, try putting a more descriptive text in youre subject. Erwin Kerk Web Developer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PHP Java problem
Thanks Justin, thats a handy function. I've been testing my code and found that it works up until I start passing objects into methods. This is the code I'm using to set up some objects (they are being passes variables that have been settype()'d): $sessioniser = new Java('com.SessionManager', adam, ); $homeaddress = new Java('com.Address', $hline1, $hline2, $hline3, $hline4, $hline5, $hline6); $deliveryaddress = new Java('com.Address', $dline1, $dline2, $dline3, $dline4, $dline5, $dline6); $name = new Java('com.Name', $firstname, $middlename, $lastname); $coname = new Java('com.Name', $cofirstname, $comiddlename, $colastname); When I print_r each of these, it produces these results: Sessioniser: java Object ( [0] = 8 ) HomeAddress: java Object ( [0] = 9 ) DeliveryAddress: java Object ( [0] = 10 ) Name: java Object ( [0] = 11 ) CoName: java Object ( [0] = 12 ) These objects do not correspond to the data I'm passing in to them. I've asked the programmer why this is the case and he has shown his classes working using a command line. I must be doing something wrong in php but can't see what. Any suggestions most appreciated. Thanks, Don function objToAssoc($obj) { if(is_object($obj)) { $arr = get_object_vars($obj); } else { $arr = $obj; } if(is_array($arr)) { foreach($arr as $key = $val) { $arr[$key] = objToAssoc($val); } } return $arr; } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] RE: [PHP-INSTALL] Problem by running mysql-connection in php-script
Looks possible that php isn't using that particular ini file. Make sure it's the correct ini file, because your error message has it looking in a different location. Try mysql_connect(127.0.0.1:3306:/tmp/mysql.sock, etc etc etc) for your connect (that might supposed to be the path to socket, not the file itself, try both). -Original Message- From: Ruprecht Helms [mailto:[EMAIL PROTECTED] Sent: Friday, October 03, 2003 8:15 AM To: Michael Scappa Cc: [EMAIL PROTECTED] Subject: [PHP-DB] RE: [PHP-INSTALL] Problem by running mysql-connection in php-script On Thu, 2003-10-02 at 22:28, Michael Scappa wrote: Ruprecht, Make sure you have PHP pointing to the right location for the mysql.sock. locate mysql.sock. Sometimes its in the /tmp dir. If it is in another location you can point to it specifically when you call mysql_connect (refer to php.net for the exact string), or just change it in your php.ini. This are the entries I've made in the php.ini [MySQL] ; Allow or prevent persistent links. mysql.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. mysql.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. mysql.max_links = -1 ; Default port number for mysql_connect(). If unset, mysql_connect() will use ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look ; at MYSQL_PORT. mysql.default_port = ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. mysql.default_socket = /tmp/mysql.sock ; Default host for mysql_connect() (doesn't apply in safe mode). mysql.default_host = localhost ; Default user for mysql_connect() (doesn't apply in safe mode). mysql.default_user = root And this is my actual /tmp-directorylinux:/tmp # ls . .esd AcroSaTWYY aaa ksocket-root migrate-2 noteedit.2vmq44 .. .shtool.8404 AcroWx7cEx alsaplayer_root_0mc-root migrate-3 noteedit.rvtxIc .ICE-unix .webmin Acrol21KzJ audacity1.1-root mcop-root migrate-4 orbit-root .X0-lock AcroAgqtL1AcrooMY5eg gsr-record-Untitled.wav-1603.BHH8QX medusa-idled-service migrate-5 .X11-unix AcroMfep2RAcrowt39f1 jpsock.141.6939 migrate migrate-6 .caitmpAcroQUQtXcAcrox5BdJI kde-root migrate-1 mysql.sock You see there is the mysql.sock And this is the connection-command in some scripts I use. Normaly it works fine, but now It fails and I get the reported error. mysql_connect(localhost,root); -- 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] To many connections problem with LAMP
On Thu, 4 Sep 2003, Balaji H. Kasal wrote: It is usually better not to use persistenc connections. So drop the pmysql_connect or if you really need to use them set set max connections higher for mysql. Which problem it has? On a really busy site persistent connections will just pile up and in the end the sql server will reach its max connections limit. Unless you will do many connects per page you will virtually gain almost nothing by using persistent connections. If you absolutely need to use persistent connections you can stop max connections filling up by dropping MaxRequestsPerChild from httpd.conf to something like 150 or lower. This way unnesseccary connections get killed when the Apache child dies. -- Mika Tuupola http://www.appelsiini.net/~tuupola/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] To many connections problem with LAMP
On Wed, 3 Sep 2003, Merlin wrote: After doing some research it looks like this is a problem because I am using pmysql_connect instead of mysql_connect. It is usually better not to use persistenc connections. So drop the pmysql_connect or if you really need to use them set set max connections higher for mysql. -- Mika Tuupola http://www.appelsiini.net/~tuupola/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] To many connections problem with LAMP
After doing some research it looks like this is a problem because I am using pmysql_connect instead of mysql_connect. It is usually better not to use persistenc connections. So drop the pmysql_connect or if you really need to use them set set max connections higher for mysql. Which problem it has? Bec' I am using it without any problem. Regards, --Balaji -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP - Apache config problem
FYI: OOPS!! I dug around in the install.txt file in PHP, and found that php4ts.dll needs to be relocated to either where apache.exe resides, where php4apache.dll resides, or in the windows system directory. All now works as expected. David [EMAIL PROTECTED] on 07/14/2003 11:35:42 AM To: [EMAIL PROTECTED] cc:(bcc: David P. Giragosian/MDACC) Subject: [PHP-DB] PHP - Apache config problem Howdy everyone, I'm in the process of setting up a new development environment with Apache 1.3.27 and PHP 4.3.2 on a Win2k machine with SP2. I'm getting an error message from apache saying that it can't find the c:/php/sapi/php4apache.dll . However, that is indeed where the dll is located. This is the exact line in httpd.conf that apache is choking on:LoadModule php4_module c:/php/sapi/php4apache.dll . Funny thing is, I have the same http.conf file in another Win2k machine running the same apache version but with PHP 4.2.3 , and everything is OK. Anyone have any ideas? Thanks in advance. David -- 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] actualy result of problem with formfieldvalues under Suse 8.2
Hi Am Donnerstag, 19. Juni 2003 23:21 schrieb Ruprecht Helms: Hi, in the meantime I set the value of register_globals = off the next to on. I get the same result. The following script I use for testing the formfieldvalues ? echo $begriff ? As I said before, this the wrong way. You should leave register_globals=off and acces your data this way: ?php echo $_POST['begriff']; ? Your second mistake was to forget the ; and the end of the echo-line The value I take from a normal formfield by the default transfermethod. What the heck do you mean with default. You should always set: form action=\foo.php?op=bar\ method=\POST\ or mybe with method=\GET\ and access it with $_GET After switching to the php-script I get a blank page without the value I inserted into the textfield. No wonder;-) CU Thorsten -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] actualy result of problem with formfieldvalues underSuse 8.2
On Thu, 2003-06-19 at 23:30, Thorsten Körner wrote: Hi Am Donnerstag, 19. Juni 2003 23:21 schrieb Ruprecht Helms: Hi, in the meantime I set the value of register_globals = off the next to on. I get the same result. The following script I use for testing the formfieldvalues ? echo $begriff ? As I said before, this the wrong way. You should leave register_globals=off and acces your data this way: ?php echo $_POST['begriff']; ? Ok here the copy of my script in original ? echo $begriff; ? That is all Your second mistake was to forget the ; and the end of the echo-line ?php echo $_POST['begriff']; ? Your second mistake was to forget the ; and the end of the echo-line The value I take from a normal formfield by the default transfermethod. What the heck do you mean with default. You should always set: html head title/title meta http-equiv=Content-Type content=text/html; charset=ISO-8859-15 meta name=GENERATOR content=Quanta Plus /head body form action=formtest.php method=POST input type=text name=begriffbr input type=submit value=senden /form /body /html After switching to the php-script I get a blank page without the value I inserted into the textfield. This problem I have first by upgrading to 8.2. Attached my php.ini Regards, Ruprecht [PHP] ;;; ; WARNING ; ;;; ; This is the default settings file for new PHP installations. ; By default, PHP installs itself with a configuration suitable for ; development purposes, and *NOT* for production purposes. ; For several security-oriented considerations that should be taken ; before going online with your site, please consult php.ini-recommended ; and http://php.net/manual/en/security.php. ;;; ; About this file ; ;;; ; This file controls many aspects of PHP's behavior. In order for PHP to ; read it, it must be named 'php.ini'. PHP looks for it in the current ; working directory, in the path designated by the environment variable ; PHPRC, and in the path that was defined in compile time (in that order). ; Under Windows, the compile-time path is the Windows directory. The ; path in which the php.ini file is looked for can be overridden using ; the -c argument in command line mode. ; ; The syntax of the file is extremely simple. Whitespace and Lines ; beginning with a semicolon are silently ignored (as you probably guessed). ; Section headers (e.g. [Foo]) are also silently ignored, even though ; they might mean something in the future. ; ; Directives are specified using the following syntax: ; directive = value ; Directive names are *case sensitive* - foo=bar is different from FOO=bar. ; ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression ; (e.g. E_ALL ~E_NOTICE), or a quoted string (foo). ; ; Expressions in the INI file are limited to bitwise operators and parentheses: ; |bitwise OR ; bitwise AND ; ~bitwise NOT ; !boolean NOT ; ; Boolean flags can be turned on using the values 1, On, True or Yes. ; They can be turned off using the values 0, Off, False or No. ; ; An empty string can be denoted by simply not writing anything after the equal ; sign, or by using the None keyword: ; ; foo = ; sets foo to an empty string ; foo = none; sets foo to an empty string ; foo = none ; sets foo to the string 'none' ; ; If you use constants in your value, and these constants belong to a ; dynamically loaded extension (either a PHP extension or a Zend extension), ; you may only use these constants *after* the line that loads the extension. ; ; All the values in the php.ini-dist file correspond to the builtin ; defaults (that is, if no php.ini is used, or if you delete these lines, ; the builtin defaults will be identical). ; Language Options ; ; Enable the PHP scripting language engine under Apache. engine = On ; Allow the ? tag. Otherwise, only ?php and script tags are recognized. ; NOTE: Using short tags should be avoided when developing applications or ; libraries that are meant for redistribution, or deployment on PHP ; servers which are not under your control, because short tags may not ; be supported on the target server. For portable, redistributable code, ; be sure not to use short tags. short_open_tag = On ; Allow ASP-style % % tags. asp_tags = Off ; The number of significant digits displayed in floating point numbers. precision= 12 ; Enforce year 2000 compliance (will cause problems with non-compliant browsers) y2k_compliance = On ; Output buffering allows you to send header lines (including cookies) even ; after you send body content, at the price of slowing PHP's output layer a ; bit. You can enable output buffering during runtime by calling the output ; buffering functions. You
Re: [PHP-DB] actualy result of problem with formfieldvalues under Suse 8.2
HI Am Donnerstag, 19. Juni 2003 23:54 schrieb Ruprecht Helms: On Thu, 2003-06-19 at 23:30, Thorsten Körner wrote: Hi Am Donnerstag, 19. Juni 2003 23:21 schrieb Ruprecht Helms: Hi, in the meantime I set the value of register_globals = off the next to on. I get the same result. The following script I use for testing the formfieldvalues ? echo $begriff ? As I said before, this the wrong way. You should leave register_globals=off and acces your data this way: ?php echo $_POST['begriff']; ? Ok here the copy of my script in original ? echo $begriff; ? That is all Your second mistake was to forget the ; and the end of the echo-line ?php echo $_POST['begriff']; ? Your second mistake was to forget the ; and the end of the echo-line The value I take from a normal formfield by the default transfermethod. What the heck do you mean with default. You should always set: html head title/title meta http-equiv=Content-Type content=text/html; charset=ISO-8859-15 meta name=GENERATOR content=Quanta Plus /head body form action=formtest.php method=POST ^ Your Form-Method is POST input type=text name=begriffbr ^^^ this is the name of your Formfield. input type=submit value=senden /form /body /html PHP gives all form-data in an array to th script. With method=POST this array is named $_POST You can now access this data in your script the following way: ?php echo $_POST['begriff']; ? You can see the arrays $_GET, $_POST, $_COOKIE and so on as associative arrays with the fieldnames as indizes. After switching to the php-script I get a blank page without the value I inserted into the textfield. This problem I have first by upgrading to 8.2. Attached my php.ini This should be OK. CU Thorsten -- Thorsten Körner http://www.123tkShop.org -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] 4.2.3 session login problem...
I have an application that is currently working fine under 4.1.2, and I am in the process of upgrading to 4.2.3. The problem is that after upgrading PHP the application login no longer works. Additionally, this same application works fine on another machine running 4.2.3. The only difference in the machines is that the working one uses PHP as a static module and the broken one uses PHP as a loadable module. Anyone run into this problem before? Yes, I have. Your problem is on line 325. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] I have a problem to add a new line to the body of my email when I am using 'a href=mailto: ... function
I never knew that Body was supported. I had tried in years ago before it worked, and never looked back. If you look at the source code for this page (http://developer.netscape.com/viewsource/husted_mailto/mailto.html) you'll see that they use the javascript function escape() on the body text. I believe this handles the characters such as spaces and CR/NL. Though it seems you are doing it the same way they are (%0D%0A). If it works on some browsers, but not others, then it's probably a compatibiilty issue, not a scripting issue. You don't indicate which browsers this works/doesn't work on. Or which mail clients you're using. Finally, this is not really a PHP issue, and especially not a PHP-DB issue. --- Martin Rajcok [EMAIL PROTECTED] wrote: I believe the body is supported. I have read everything I could find through Google. People are using it exactly as I am. I can't use '\n' - it is only text in this case and it will be part of the email body. Thanks anyway, Martin -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 June 2003 3:02 p.m. To: 'Martin Rajcok'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] I have a problem to add a new line to the body of my email when I am using 'a href=mailto: ... function I have a problem to add a new line to the body of my email when I am using 'a href=mailto: ... function. This is my code: $details[email] //email of the user from the form $details[contact_name] //name of the user from the form $email_subject = subject text...; $email_form = Welcome .$details[contact_name].,%0D%0A%0D%0A; $email_form .= Thank you for registering with ; a href='mailto:.$details[email].?Body=.$email_form.Subject=.$email_s ub je ct.' class='darkblue'Send the email/a Use \n. email_form = Welcome .$details[contact_name].,\n\n; Are you sure body is even supported? I'll guarantee it's not going to be for every browser/email client. From: http://www.w3.org/TR/WD-html40-970917/htmlweb.html#h-5.1.3.1 -- MAILTO URLs have the following syntax: mailto:email-address User agents may support MAILTO URL extensions that are not yet Internet standards (e.g., appending subject information to a URL with the syntax ?Subject=my%20subject where any space characters are replaced by %20). Some user agents also support ?Cc=email-address. -- ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- 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 = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] I have a problem to add a new line to the body of my email when I am using 'a href=mailto: ... function
I have a problem to add a new line to the body of my email when I am using 'a href=mailto: ... function. This is my code: $details[email] //email of the user from the form $details[contact_name] //name of the user from the form $email_subject = subject text...; $email_form = Welcome .$details[contact_name].,%0D%0A%0D%0A; $email_form .= Thank you for registering with ; a href='mailto:.$details[email].?Body=.$email_form.Subject=.$email_s ub je ct.' class='darkblue'Send the email/a Use \n. email_form = Welcome .$details[contact_name].,\n\n; Are you sure body is even supported? I'll guarantee it's not going to be for every browser/email client. From: http://www.w3.org/TR/WD-html40-970917/htmlweb.html#h-5.1.3.1 -- MAILTO URLs have the following syntax: mailto:email-address User agents may support MAILTO URL extensions that are not yet Internet standards (e.g., appending subject information to a URL with the syntax ?Subject=my%20subject where any space characters are replaced by %20). Some user agents also support ?Cc=email-address. -- ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] I have a problem to add a new line to the body of my email when I am using 'a href=mailto: ... function
I believe the body is supported. I have read everything I could find through Google. People are using it exactly as I am. I can't use '\n' - it is only text in this case and it will be part of the email body. Thanks anyway, Martin -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 June 2003 3:02 p.m. To: 'Martin Rajcok'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] I have a problem to add a new line to the body of my email when I am using 'a href=mailto: ... function I have a problem to add a new line to the body of my email when I am using 'a href=mailto: ... function. This is my code: $details[email] //email of the user from the form $details[contact_name] //name of the user from the form $email_subject = subject text...; $email_form = Welcome .$details[contact_name].,%0D%0A%0D%0A; $email_form .= Thank you for registering with ; a href='mailto:.$details[email].?Body=.$email_form.Subject=.$email_s ub je ct.' class='darkblue'Send the email/a Use \n. email_form = Welcome .$details[contact_name].,\n\n; Are you sure body is even supported? I'll guarantee it's not going to be for every browser/email client. From: http://www.w3.org/TR/WD-html40-970917/htmlweb.html#h-5.1.3.1 -- MAILTO URLs have the following syntax: mailto:email-address User agents may support MAILTO URL extensions that are not yet Internet standards (e.g., appending subject information to a URL with the syntax ?Subject=my%20subject where any space characters are replaced by %20). Some user agents also support ?Cc=email-address. -- ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- 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] MySQL Database connection Problem
Hi, Does mysql user has rights to write in this directory or permissions over this file? Andrey - Original Message - From: conbud [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 03, 2003 11:00 AM Subject: [PHP-DB] MySQL Database connection Problem Hello can someone give me some possible reasons this error happens when I use the mysql client to add a tabe to a database. mysql create table home (id int not null, heading blob not null, - primary key (id), unique id (id)); ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28) Any help would be appreciated Lee -- 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] MySQL Database connection Problem
On Friday 03 January 2003 17:00, conbud wrote: Hello can someone give me some possible reasons this error happens when I use the mysql client to add a tabe to a database. mysql create table home (id int not null, heading blob not null, - primary key (id), unique id (id)); ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28) This is obviously a mysql question. Go to their website and search on the error message. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* sic transit discus mundi (From the System Administrator's Guide, by Lars Wirzenius) */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL Database connection Problem
Jason Wong wrote: On Friday 03 January 2003 17:00, conbud wrote: Hello can someone give me some possible reasons this error happens when I use the mysql client to add a tabe to a database. mysql create table home (id int not null, heading blob not null, - primary key (id), unique id (id)); ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28) This is obviously a mysql question. Go to their website and search on the error message. Jason that seems to be your answer to everything, that and RTFM. Well I have already done both and cant seem to find anything on it, so thats why I would ask here. Makes sense huh ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL Database connection Problem
http://www.alt-php-faq.org/local/74/ Question : I am trying to create a database and keep getting an error :- (Errcode: 28) Answer : errcode: 28 No space left on device This means that you are out of disk space. Try du to see how much space is free/used Best regards Andrey Hristov - Original Message - From: conbud [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, January 03, 2003 11:11 AM Subject: Re: [PHP-DB] MySQL Database connection Problem Jason Wong wrote: On Friday 03 January 2003 17:00, conbud wrote: Hello can someone give me some possible reasons this error happens when I use the mysql client to add a tabe to a database. mysql create table home (id int not null, heading blob not null, - primary key (id), unique id (id)); ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28) This is obviously a mysql question. Go to their website and search on the error message. Jason that seems to be your answer to everything, that and RTFM. Well I have already done both and cant seem to find anything on it, so thats why I would ask here. Makes sense huh ? -- 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] MySQL Database connection Problem
Andrey thanks, but I seen that already and theres over 80 gig left on the server and about 17 gig of that is still alloted to the database. Andrey Hristov [EMAIL PROTECTED] wrote in message 010c01c2b309$8d8d7210$1601a8c0@andreywin">news:010c01c2b309$8d8d7210$1601a8c0@andreywin... http://www.alt-php-faq.org/local/74/ Question : I am trying to create a database and keep getting an error :- (Errcode: 28) Answer : errcode: 28 No space left on device This means that you are out of disk space. Try du to see how much space is free/used Best regards Andrey Hristov - Original Message - From: conbud [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, January 03, 2003 11:11 AM Subject: Re: [PHP-DB] MySQL Database connection Problem Jason Wong wrote: On Friday 03 January 2003 17:00, conbud wrote: Hello can someone give me some possible reasons this error happens when I use the mysql client to add a tabe to a database. mysql create table home (id int not null, heading blob not null, - primary key (id), unique id (id)); ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28) This is obviously a mysql question. Go to their website and search on the error message. Jason that seems to be your answer to everything, that and RTFM. Well I have already done both and cant seem to find anything on it, so thats why I would ask here. Makes sense huh ? -- 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] MySQL Database connection Problem
what about the permissions? are they ok? Andrey - Original Message - From: conbud [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 03, 2003 11:30 AM Subject: Re: [PHP-DB] MySQL Database connection Problem Andrey thanks, but I seen that already and theres over 80 gig left on the server and about 17 gig of that is still alloted to the database. Andrey Hristov [EMAIL PROTECTED] wrote in message 010c01c2b309$8d8d7210$1601a8c0@andreywin">news:010c01c2b309$8d8d7210$1601a8c0@andreywin... http://www.alt-php-faq.org/local/74/ Question : I am trying to create a database and keep getting an error :- (Errcode: 28) Answer : errcode: 28 No space left on device This means that you are out of disk space. Try du to see how much space is free/used Best regards Andrey Hristov - Original Message - From: conbud [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, January 03, 2003 11:11 AM Subject: Re: [PHP-DB] MySQL Database connection Problem Jason Wong wrote: On Friday 03 January 2003 17:00, conbud wrote: Hello can someone give me some possible reasons this error happens when I use the mysql client to add a tabe to a database. mysql create table home (id int not null, heading blob not null, - primary key (id), unique id (id)); ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28) This is obviously a mysql question. Go to their website and search on the error message. Jason that seems to be your answer to everything, that and RTFM. Well I have already done both and cant seem to find anything on it, so thats why I would ask here. Makes sense huh ? -- 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] MySQL Database connection Problem
On Friday 03 January 2003 17:11, conbud wrote: Jason Wong wrote: On Friday 03 January 2003 17:00, conbud wrote: Hello can someone give me some possible reasons this error happens when I use the mysql client to add a tabe to a database. mysql create table home (id int not null, heading blob not null, - primary key (id), unique id (id)); ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28) This is obviously a mysql question. Go to their website and search on the error message. Jason that seems to be your answer to everything, that and RTFM. I try to answer questions appropriately. Well I have already done both and cant seem to find anything on it, so thats why I would ask here. Makes sense huh ? No, it would make more sense to ask on the mysql mailing list. One would hope that the people there would know more about mysql than the people here. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The ultimate game show will be the one where somebody gets killed at the end. -- Chuck Barris, creator of The Gong Show */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] file upload array problem
On Saturday 21 December 2002 05:25, Seabird wrote: Hi everyone, every time I try to upload a picture I get the same problem in return. First of all, it's not being uploaded (but this is for later concern I'm afraid). Trying to display the info of the (not)uploaded file should be done with: $_FILES['picture']['name'] but every time I run this the return is a error like this: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in c:\apache\htdocs\seabird.jmtech.ca\otf.com\submit.php on line 69 Which is line 69? If I leave out the qoutes it runs fine but my output (echo) is Array['name'] Running a FILES list gives correct names and everything. Where did this go wrong?? Here's my code aswell please help me, don't point me to another website or manual (have read a dozen, and I'm still stuck). if ($_POST[submit]) { If you have error reporting set high enough you would have seen a warning about Use of undefined constant submit You should use: if ($_POST['submit']) { $link = mysql_pconnect(localhost,myuser,mypass); $db = test; mysql_select_db($db,$link); $query = INSERT INTO inventory (registration,type,total_time,price,description,picture_name) VALUES ('$_POST[registration]','$_POST[type]','$_POST[total_time]','$_POST[price]' , '$_POST[description]','$_FILES[picture]'); If you're referring to array variables inside a double-quoted string you should enclose it within {}. Thus: $query = INSERT INTO inventory (registration,type,total_time,price,description,picture_name) VALUES ('{$_POST['registration']}','{$_POST['type']}',...); -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The keyboard isn't plugged in */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] default-character-set problem
You have to put the same under [server] Nikos wrote: Hello there... I have a problem with sort order. I use greek and english characters. The manual says to put the following lines to my.cnf: [client] character-sets-dir=/usr/local/mysql/share/mysql/charsets default-character-set=greek i restart the demon but the problem still exist. I have 3.23.49 ver on Red Hat Linux 7.2 Thanx list -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] mssql select db problem
i'd get rid of the space as well, or use brackets around the db name to account for the space. John W. Holmes holmes072000@ch To: 'Kadir Leblebici' [EMAIL PROTECTED], [EMAIL PROTECTED] arter.net cc: Subject: RE: [PHP-DB] mssql select db problem 10/14/2002 11:30 AM Please respond to holmes072000 Rename your database. Either PHP or MSSQL doesn't like the '-' in the name. ---John Holmes... -Original Message- From: Kadir Leblebici [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:36 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] mssql select db problem Hi friends I have big problem I connect to mssql server I connected succesful but i select_db samples code is here $hostname = 192.168.100.4; $username = sa; $password = ; $dbName =WIN-PAK 2; MSSQL_CONNECT($hostname,$username,$password) or DIE(DATABASE FAILED TO RESPOND.); mssql_select_db($dbName) or DIE(DATABASE BULUNAMADI); message Warning: MS SQL message: Line 1: Incorrect syntax near '-'. (severity 15) in C:\apache\htdocs\ornek\mssql.php on line 9 Warning: MS SQL: Unable to select database: WIN-PAK 2 in C:\apache\htdocs\ornek\mssql.php on line 9 DATABASE BULUNAMADI where is the problem Thanks -- 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] mssql select db problem
sorry i mis spoke, the brackets will help you in queries with tables and columns that have spaces, not in the connect with actual dbs(at least i don't think so). - Forwarded by Jeffrey N Dyke/CORP/Keane on 10/14/2002 11:40 AM - Jeffrey N Dyke To: [EMAIL PROTECTED] 10/14/2002 cc: 'Kadir Leblebici' [EMAIL PROTECTED], [EMAIL PROTECTED] 11:32 AM Subject: RE: [PHP-DB] mssql select db problem(Document link: Jeff Dyke) i'd get rid of the space as well, or use brackets around the db name to account for the space. John W. Holmes holmes072000@ch To: 'Kadir Leblebici' [EMAIL PROTECTED], [EMAIL PROTECTED] arter.net cc: Subject: RE: [PHP-DB] mssql select db problem 10/14/2002 11:30 AM Please respond to holmes072000 Rename your database. Either PHP or MSSQL doesn't like the '-' in the name. ---John Holmes... -Original Message- From: Kadir Leblebici [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:36 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] mssql select db problem Hi friends I have big problem I connect to mssql server I connected succesful but i select_db samples code is here $hostname = 192.168.100.4; $username = sa; $password = ; $dbName =WIN-PAK 2; MSSQL_CONNECT($hostname,$username,$password) or DIE(DATABASE FAILED TO RESPOND.); mssql_select_db($dbName) or DIE(DATABASE BULUNAMADI); message Warning: MS SQL message: Line 1: Incorrect syntax near '-'. (severity 15) in C:\apache\htdocs\ornek\mssql.php on line 9 Warning: MS SQL: Unable to select database: WIN-PAK 2 in C:\apache\htdocs\ornek\mssql.php on line 9 DATABASE BULUNAMADI where is the problem Thanks -- 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] Global variables, $_GET problem
- Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 24, 2002 6:45 AM Subject: Re: [PHP-DB] Global variables, $_GET problem On Wednesday 24 July 2002 11:38, Ruth Zhai wrote: We just upgraded our PHP to version 4.2.1. I realized that $var is no longer available from www.url.com/myphp.php?var=3 . As instructed in the document, we have tried two things: Good, someone who reads the docs :) 1. I tried to use $_GET('var'), however, I got Fatal error: Call to undefined function: array() in /home/httpd/... message. I have no clue what this means, and what I have done wrong. It should be $GET['var']. It should be $_GET['var'] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Global variables, $_GET problem
Ruth, your reference to $_GET('var') is close, but as you have seen - no cigar :) using the () after GET makes it refer to a function, but it is actually an array which is automatically created, so you need to use $_GET['var'] (note the square brackets as for point 2 (register_globals) did you restart the apache service after changing it? because registering globals should make $var available again (but won't help with problem 1 :) HTH Beau // -Original Message- // From: Ruth Zhai [mailto:[EMAIL PROTECTED]] // Sent: Wednesday, 24 July 2002 11:39 AM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] Global variables, $_GET problem // // // Hello php friends, // We just upgraded our PHP to version 4.2.1. I realized that // $var is no // longer available from www.url.com/myphp.php?var=3 . As // instructed in the // document, we have tried two things: // 1. I tried to use $_GET('var'), however, I got Fatal error: Call to // undefined function: array() in /home/httpd/... message. I // have no clue // what this means, and what I have done wrong. // 2. Set register_globals = on in the configuration file. // This did not make // any difference. // // I don's know what to do now. Your help is highly appreciated. // // Ruth // // // // -- // 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] Global variables, $_GET problem
On Wednesday 24 July 2002 11:38, Ruth Zhai wrote: We just upgraded our PHP to version 4.2.1. I realized that $var is no longer available from www.url.com/myphp.php?var=3 . As instructed in the document, we have tried two things: Good, someone who reads the docs :) 1. I tried to use $_GET('var'), however, I got Fatal error: Call to undefined function: array() in /home/httpd/... message. I have no clue what this means, and what I have done wrong. It should be $GET['var']. 2. Set register_globals = on in the configuration file. This did not make any difference. Did you restart the webserver? Did you make sure you're editing the correct php.ini? Check using phpinfo(). -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Serocki's Stricture: Marriage is always a bachelor's last option. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Form select field problem
Beau Cheers for that. Option one worked as a way of referring to the field. I made a couple of other 'take-down and rebuilds' but it is now working one hundred percent, and wouldn't without your input. Thanks a whole tonne! :) Keiran -Original Message- From: Beau Lebens [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 09, 2002 2:50 AM To: 'Keiran Wynyard'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Form select field problem Keiran, A couple possibilities for you; 1. Try referring to the field (in JavaScript) as something like; (might have to play around with this) document.existing[groupchoice[]].selectedIndex 2. Make it so that each selection on the select tag is mirrored into another hidden input field (onSelect=) and then you actually check the hidden field for what values are present and what aren't, throwing an error based on it, rather than on the actual select HTH Beau // -Original Message- // From: Keiran Wynyard [mailto:[EMAIL PROTECTED]] // Sent: Monday, 8 July 2002 5:22 PM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] Form select field problem // // // Hi // // I may be posting this to the wrong place, and if so I // apologise. If someone knows of a // better place to post my query please tell me, and I will. :) // // This problem is about 50% PHP and 50% Javascript, really to // do with how the two interface // with each other. // // Anyhoo, down to the problem. // // I have a Select form item with 'multiple' set. It sends an // array of values to be dissected // and applied to database tables, hence it's name value is // 'groupchoice[]'. This all works // well and good when some value(s) are selected, but obviously // gives an error if the form is // sent with no value selected. What I need to do is come up // with an elegant way of stopping // the form if no entries have been selected (or indeed if all // entries have been deselected). // I have successfully used a Javascript function to do this, // but it only works if the field // is named 'groupchoice'. The part of the function that is // causing the problem is listed // below: // // if (!document.existing.groupchoice.selectedIndex != ) //this works // // if (!document.existing.groupchoice[].selectedIndex != ) // //this gives a syntax error // // Obviously if I call the field 'groupchoice' the information // sent is no longer an array, // and therefore I cannot have multiple selections, which is // imperative. I have thought of // other ways of doing the job, such as having an alert pop-up // if there is an error and then // return them to the form, as opposed to before the form is // sent, but didn't feel that this // was very elegant. // // Have any of you PHP gurus out there experienced this kind of // problem and found a solution? // // I would be greatly appreciative if someone would share their // expertise. // // TIA // Keiran // [EMAIL PROTECTED] // // // // -- // 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] Form select field problem
Keiran, A couple possibilities for you; 1. Try referring to the field (in JavaScript) as something like; (might have to play around with this) document.existing[groupchoice[]].selectedIndex 2. Make it so that each selection on the select tag is mirrored into another hidden input field (onSelect=) and then you actually check the hidden field for what values are present and what aren't, throwing an error based on it, rather than on the actual select HTH Beau // -Original Message- // From: Keiran Wynyard [mailto:[EMAIL PROTECTED]] // Sent: Monday, 8 July 2002 5:22 PM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] Form select field problem // // // Hi // // I may be posting this to the wrong place, and if so I // apologise. If someone knows of a // better place to post my query please tell me, and I will. :) // // This problem is about 50% PHP and 50% Javascript, really to // do with how the two interface // with each other. // // Anyhoo, down to the problem. // // I have a Select form item with 'multiple' set. It sends an // array of values to be dissected // and applied to database tables, hence it's name value is // 'groupchoice[]'. This all works // well and good when some value(s) are selected, but obviously // gives an error if the form is // sent with no value selected. What I need to do is come up // with an elegant way of stopping // the form if no entries have been selected (or indeed if all // entries have been deselected). // I have successfully used a Javascript function to do this, // but it only works if the field // is named 'groupchoice'. The part of the function that is // causing the problem is listed // below: // // if (!document.existing.groupchoice.selectedIndex != ) //this works // // if (!document.existing.groupchoice[].selectedIndex != ) // //this gives a syntax error // // Obviously if I call the field 'groupchoice' the information // sent is no longer an array, // and therefore I cannot have multiple selections, which is // imperative. I have thought of // other ways of doing the job, such as having an alert pop-up // if there is an error and then // return them to the form, as opposed to before the form is // sent, but didn't feel that this // was very elegant. // // Have any of you PHP gurus out there experienced this kind of // problem and found a solution? // // I would be greatly appreciative if someone would share their // expertise. // // TIA // Keiran // [EMAIL PROTECTED] // // // // -- // 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] Strange MySQL Query Problem
From your query, it looks as if you are letting the user select the table that they can query with $pop-up1. Is that correct? If so, do all the available choices of tables have the same column names? Other than that I can't see why this query would fail. Martin eat pasta type fasta [EMAIL PROTECTED] 07/03/02 04:27PM I already got some replies for this but it wasn't it, here is the problem: I have a simple form which queries the database based on 2 pop-up menu choices and keywords entered by the user, it passes on the variables as follows: pop-up1=choice1, pop-up2=choice2, textfield=user specified data the query is as follows $result = mysql_query(SELECT some_id, some_description, some_feature FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND some_feature LIKE '%$pop-up2'); it tells me that column which equals to the $texfield does not exists, meaning that the query seems to be fed wrong? No idea here, $texfield and $pop-up2 are not requests for tables but matches in those tables a bit buffled I am, I've these queries before on larger web servers, this is the first time on my workstation and it does just that, simpler queries work fine... thanks in advance, R ps. the form is guarded against empty entries ps2. RedHat 7.3, Mysql 3.23.51, Apache 1.3+ wik PHP 4.2.1 configured for MySQL -- 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] Strange MySQL Query Problem
Could this be as simple as a typo? textfield texfield Jen Swofford [EMAIL PROTECTED] -Original Message- From: eat pasta type fasta [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 3:27 PM To: PHP LIST Subject: [PHP-DB] Strange MySQL Query Problem I already got some replies for this but it wasn't it, here is the problem: I have a simple form which queries the database based on 2 pop-up menu choices and keywords entered by the user, it passes on the variables as follows: pop-up1=choice1, pop-up2=choice2, textfield=user specified data the query is as follows $result = mysql_query(SELECT some_id, some_description, some_feature FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND some_feature LIKE '%$pop-up2'); it tells me that column which equals to the $texfield does not exists, meaning that the query seems to be fed wrong? No idea here, $texfield and $pop-up2 are not requests for tables but matches in those tables a bit buffled I am, I've these queries before on larger web servers, this is the first time on my workstation and it does just that, simpler queries work fine... thanks in advance, R ps. the form is guarded against empty entries ps2. RedHat 7.3, Mysql 3.23.51, Apache 1.3+ wik PHP 4.2.1 configured for MySQL -- 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] Strange MySQL Query Problem
On Wednesday 03 July 2002 12:42, eat pasta type fasta wrote: I have a simple form which queries the database based on 2 pop-up menu choices and keywords entered by the user, it passes on the variables as follows: pop-up1=choice1, pop-up2=choice2, textfield=user specified data the query is as follows $result = mysql_query(SELECT some_id, some_description, some_feature FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND some_feature LIKE '%$pop-up2'); it tells me that column which equals to the $texfield does not exists, a bit buffled I am, I've these queries before on larger web servers, this is the first time on my workstation and it does just that, simpler queries work fine... Print out $result -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Support your local police force -- steal!! */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PHP/Access problem
Adam, Thanks for the assist. The query works fine without the ( ) arount the conditions. Now on to the next part. George - Original Message - From: Adam Royle [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, March 26, 2002 10:03 PM Subject: [PHP-DB] Re: PHP/Access problem SELECT * FROM 'Documents'WHERE (CourseRef='4712' AND Valid_From=#26/03/2002# AND Valid_Until=#26/03/2002#) Order by Author,Title should be SELECT * FROM Documents WHERE (CourseRef='4712' AND Valid_From=#26/03/2002# AND Valid_Until=#26/03/2002#) Order by Author,Title your table name should not hae single quotes around it... adam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] load data infile problem
You running Windows or *nix? File permissions will play a part in this, but use PHP's exec() function to execute MySQL's load data infile. The manual has a number of well annotated examples. The big problem may be that you'll be executing the command as whatever user the web server is running as. But before you start reinventing the wheel, search for MySQL import csv PHP, or something similar, and check out the script sites referred to in the links part of the manual. This isn't a new problem and has been addressed before. HTH - Miles Thompson At 09:13 PM 1/19/2002 +, rop30999 wrote: I have a called file cats.txt which count data that were solitary of a DB Access. I need to export these data for a table 'cats' inside of a DB done in MySql. In MySql I can execute this procedure in the following way: Load data local infile gatos.txt into table gatos fields terminated by ',' enclosed by '' (Id, Nome, Raça); I need to know how I can accomplish this same operation but using PHP Thank you Paulo -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] php3-php4 mysql problem with nl2br coding
On Fri, 23 Nov 2001 14:04:00 -0600 Terry Romine Terry Romine [EMAIL PROTECTED] wrote: I seem to have run into a strange bug where when I enter text through a form, and use the nl2br call in PHP, instead of getting BR I get BR / and then my parsing fails on the display side (where I use ereg_replace(br,, $string) to clean up the breaks. I believe that is not a bug, but instead is the HTML 4.01 and XHTML 1.0 spec which says that all tags, including empty elements, must be closed. Perhaps you might change your ereg_replace() to look for either/both types of tags? -- Raquel Little progress can be made by merely attempting to repress what is evil; our great hope lies in developing what is good. --Calvin Coolidge -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Re: UPDATE table Problem
[*NOTE* - I sent this yesterday. Since I didn't receive a copy back from the listprocessor, I assumed that it was lost somewhere along the way. --TGN ] Hmm I'd first put a or die clause onto the clause... $updated = mysql_query($update_query); ..like this because I suspect that it's dying before it can execute ... $updated = mysql_query($update_query) or die (Invalid SQL [$update_query]); ... what I would currently suspect to find would be the 'times_visited' column is numeric instead of alphanumeric. When the update happens, it chokes at having the value your setting for 'times_visited' quoted with apostrophes Originally, it looks like this... $update_query = update guestbook set last_access=now(), times_visited='$times' where guest_id='$g_id'; .. if times_visited is numeric, I'd change it to ... $update_query = update guestbook ; $update_query .= set last_access=now(), ; $update_query .= times_visited = $times ; $update query .= where guest_id='$g_id'; As another note, if the column last_accessed is of a timestamp data type, then you can do the following update to cause it to automagically update with a now() value being put into it as well. $update_query = update guestbook ; $update_query .= set times_visited = $times ; $update query .= where guest_id='$g_id'; This works because timestamp column types that aren't mentioned directly in the update/insert query types are automatically set to the current system time (which would be a now()). -- __ _Tyler Nally / /__ _(_)___ _ _ [EMAIL PROTECTED] / / _ \/ __ `/ / __ \/ __ \ / __ \/ ___/ __ `/ 317-860-3016 / / __/ /_/ / / /_/ / / / // /_/ / / / /_/ / American Legion Website /_/\___/\__, /_/\/_/ /_(_)/_/ \__, /http://www.legion.org // // -Original Message- From: Thomas omega Henning [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 17, 2001 12:13 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: UPDATE table Problem Dear Sir George Liomis, But there is still the update command issue why didn't my update command work when i tryed it in my php source it didn;t work but in the mysql shell it updated it for me. Is it a bug in php 4.0.5? that it doesn;t send it 2 the server? Sir Thomas omega Henning George Lioumis [EMAIL PROTECTED] wrote in message news:003f01c156d7$f218e640$[EMAIL PROTECTED]... Dear Sirs!! I've ended up with a conclusion after MANY hours in front of my PC. The problem was not the query but the $guest_id. In a first query, I was getting the guest_id from the DB with the following statement: $get_guest_id_query = select guest_id from guestbook where username='$username' and password='$password'; $result = mysql_query($get_guest_id_query) or die (mysql_error()); The problem was that $result was not in fact what I wanted (ie: guest_id). So the following query refused to do its job! $update_query = update guestbook set last_access = now() where guest_id='$result'; $udated = mysql_query($update_query) or die (mysql_error()); Below, you can see the correct code: if ( ($submit== Login) and ($username != ) and ($password != ) ) { $guest_id = mysql_query(select guest_id from guestbook where username='$username' and password='$password') or die(mysql_error()); while ($row = mysql_fetch_array($guest_id)) { $g_id = $row[guest_id]; ///set $g_id as global (inter-page!!) variable. session_register('g_id'); } mysql_free_result($guest_id); if ($g_id = 1) ///user authenticated... { ///Find user's last access time... $prev_access_query = select name, mail, times_visited, last_access from guestbook where guest_id='$g_id'; $result=mysql_query($prev_access_query); while ($row=mysql_fetch_array($result)) -The correct way to get geust_id from the $results!!! { echo BGuest: /B; echo $row[name]; echo with mail: ; echo $row[mail]; echo BRentered this site in: ; echo $row[last_access]; echo .BRThis Guest has visited ; $times = $row[times_visited] + 1; echo $times; echo times this site.BRBR; } ///while $update_query = update guestbook set last_access=now(), times_visited='$times' where guest_id='$g_id'; $updated = mysql_query($update_query); if ($updated) { ? FONT SIZE=5BA HREF=main.phpENTER/A/B/FONTBRBR ?php } ///if($updated) } ///if($g_id) } ///if ($submit) Hope this helps a bit!! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] RE: bizarre ocilogon problem
On Wed, Sep 05, 2001 at 10:24:28AM -0500, Brian Mauter wrote: Are you running out of logons? You should only need the client libraries on the machine with the PHP pages. You do not need them anywhere else. (That's the beauty of the web!) Make sure you have ocilogoff in your PHP page when you're done. Even better (for performance reasons) create a session. Then ONLY the first time that any of your pages load, run your ocilogon. After that just reuse the logon. From then on, just make a new statement everytime you need to query the database. Lastly, when I used PHP/Apache/Linux to talk to Oracle/NT4, I was getting stray defunct oracle processes hanging around on my Linux box. The effect was that pages would work from one client PC, but not from another. I think everytime I created a connection, it created the process. The only way I could find to get around that was to recompile PHP with --enable-sigchild. This is PHP's own signal handler and it will clean up the stray oracle processes. Good luck, Brian -Original Message- From: Galvin, Max [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 04, 2001 10:07 AM To: '[EMAIL PROTECTED]' Subject: bizarre ocilogon problem Hi, I have a page that retrieves info from an Oracle database and which works fine when I view it. When I switch to another PC with the same OS/browser (NT/IE5) I get an error: call to unsupported or undefined function ocilogon() We have the client libs installed but it's only on one or two machines that this fails. Any ideas why? you donÄt have oracle-oci support in you php! please configure php using --with-oci8. re, tc -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] simple odbc insert problem
On Mon, 20 Aug 2001, LondonVibe wrote: new to php so be nice :) win2k iis5.ms access.. what is the order for adding var's to a access DB ?? code i tried... with data from form don't work... // connect to system dsn odbc name login and password or die $connect = odbc_connect(DB,name,pword) or die ( not connected); $sql=INSERT INTO basket (Item,Amount,Price) Values ('$id','$amount','$price'); Don't put single ticks around a field which holds numerical data... unless you defined your primary ID as a text field (hope not) that's probably why the query is bombing out. // prepare SQL statement //$sql_prepare = odbc_prepare($connect,$sql) or die(Couldn't prepare query.); // prepare SQL statement $sql_result = odbc_prepare($connect,$sql) or die(Couldn't prepare query.); Okay, I've never written PHP to ODBC but making the same call twice and assigning the values to different variables? One of us is confused... // execute SQL statement and get results odbc_execute($sql_result) or die(Couldn't execute statement1.); odbc_free_result($sql_result); odbc_close($connect); Justin Buist Trident Technology, Inc. 4700 60th St. SW, Suite 102 Grand Rapids, MI 49512 Ph. 616.554.2700 Fx. 616.554.3331 Mo. 616.291.2612 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Re: Group By problem
Thanks for your reply You don't show your SQL, but I assume it's something like SELECT grp,svc,mach FROM table ORDER BY grp,svc,mach Thats right. But its displaying the same as my code: --- Group:Desktop Service:BACKUP AITSBKUP Service:E-Mail AITSMAIL Service:E-Mail JEEVES Group:Unix Service:Database APOLLO Service:FIREWALL Console - I want it like this. Sorry if my previous email wasnt clear enough. Group:Desktop Service:BACKUP AITSBKUP Service:E-Mail AITSMAIL JEEVES Group:Unix Service:Database APOLLO Service:FIREWALL Console then $grp=; $svc=; $firstmach = true; while ($row=mysql_fetch_array($result)) { if ($grp != $row[grp]) { $grp = $row[grp]; PrintNewGroup($grp); $svc = ;// force new-svc when switching groups } if($svc != $row[svc]) { $svc = $row[svc]; PrintNewService($svc); $firstmach = true; } PrintMach($row[mach], $firstmach); $firstmach = false; } Hope this helps... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Sql result loop problem !
On Fri, May 18, 2001 at 04:32:51PM +0200, Keith Whyman wrote: while ($p = mysql_fetch_array($result1)) { $msg .= $p[s_bereich_name]; $msg .= $p[s_news_text]; $msg .= $p[s_users_real_name]; I'm not sure if this is what you want, but something like this maybe?? ?php while($p = mysql_fetch_array($result)) { if($p[s_bereich_name] != $oldBereichName) { echo $p[s_bereich_name].br\n; $oldBereichName = $p[s_bereich_name]; } echo $p[s_news_text]. - .$p[s_users_real_name].br\n; } ? -- Jason Stechschulte [EMAIL PROTECTED] -- If I allowed next $label then I'd also have to allow goto $label, and I don't think you really want that... :-) -- Larry Wall in [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] urgent postgresql date problem ...
fixed it. code is below: (output 1 is screen output 2 is csv). it seemed to like fetch_row better than fetch_array .. if anyone could explain i would be really grateful. there's nothing worse than fixing something and not knowing how you did it !;-) for ($x=0; $x$numcdbs; $x++) { $cdbarr = pg_fetch_array($cdbs,$x); // get last visit from appointments table //$now = gmmktime(Y-m-d); $date = gmdate(Y-m-d h:m:s,time()); $lastv = pg_Exec($conn,select max(start_date) from appointments where cdb=.$cdbarr[cdb]. and start_date '.$date.'); //print select max(start_date) from appointments where cdb=.$cdbarr[cdb]. and start_date '.$date.'br; $numlastv=pg_numrows($lastv); //print $numlastv. last visit returnedbr; if ($numlastv 0) { $lastvdets = pg_fetch_row($lastv,0); //$lastvisit = gmdate(d/m/y,strtotime($lastvdets[0])); if ($output==1) { if (!pg_fieldisnull($lastv,0,0)){$lastvisit = gmdate(d/m/y, strtotime($lastvdets[0]));}else{$instdate=nbsp;} } if ($output==2) { if (!pg_fieldisnull($lastv,0,0)){$lastvisit = gmdate(d/m/y, strtotime($lastvdets[0]));}else{$instdate=;} } } } Steve -Original Message- From: Steve Brett [mailto:[EMAIL PROTECTED]] Sent: 09 May 2001 09:39 To: php-db@lists. php. net (E-mail) Subject: [PHP-DB] urgent postgresql date problem ... hi, i've got a really annoying problem with php. i need to generate a report that is quite complex and have done 99% of the work but am stuck on the final leg. what i need to do is extract the last visit of training staff from an appointments table. simple you might think. the sql selelect max(start_date) from appointments where cdb=2044 and start_date now() works fine in pgsql. (cdbs are customers.) but does not work in php. start_date is stored in postgresql as a timestamp. the current query on the page looks like this: for ($x=0; $x$numcdbs; $x++) { $cdbarr = pg_fetch_array($cdbs,$x); // get last visit from appointments table //$now = gmmktime(Y-m-d); $date = gmdate(Y-m-d h:m:s,time()); $lastv = pg_Exec($conn,select max(start_date) from appointments where cdb=.$cdbarr[cdb]. and start_date '.$date.'); print select max(start_date) from appointments where cdb=.$cdbarr[cdb]. and start_date '.$date.'br; $numlastv=pg_numrows($lastv); if ($numlastv 0) { $lastvdets = pg_fetch_array($lastv,0); $lastvisit = gmdate(d/m/y,strtotime($lastvdets[start_date])); } } the code is returning $lastvisit at 08-05-01 in all cells ... Steve Brett Internal Development tel: 4251 EMIS Ltd. Privileged and /or Confidential information may be contained in this message. If you are not the original addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, please delete this message, and notify us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my firm or employer unless otherwise indicated by an authorised representative independently of this message. Egton Medical Information Systems Limited. Registered in England. No 2117205. Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth, Leeds, LS18 4RF -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP4 to PHP3 problem
On 10 Apr 2001, at 13:49, Rob Griffiths wrote: **50** print "tr bgcolor=#66td{$A["fname"]}/td" . "td{$A["lname"]}/td" . " td{$A["dept"]}/td" . " td{$A["manager"]}/td" . "td{$A["extension"]}/td/tr\n"; Notation with "{" parenthesis is not used in PHP3. Use the string concatenation operator "." instead: print "some string".$array["element"]."some other string\n"; you could also use printf(), but AFAIK, this is the most safe way from the "sintactical" point of view. HTH, bye /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Fabrizio Ermini Alternate E-mail: C.so Umberto, 7 [EMAIL PROTECTED] loc. Meleto Valdarno Mail on GSM: (keep it short!) 52020 Cavriglia (AR) [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] A Real PHP problem for a change...
That said, (Now on to actual PHP) I've noticed (in my own scripting) and a few other problems posted here quite a bit of confusion with PHP's single ' and double " quotes. Reading the material I was led to believe that ' ' outputs exactly what is in the quotes and " " outputs variables and strings (etc..) Thus I become radically confused by this recent comment to use '"$uname"'. And furthermore the solutions to one of my MySql query problems being adding single quotes ' ' to all the variables. Now by my understanding, thats not supposed to work. However, being PHP what it is.. I wasn't suprised. (There's some open-source commentary for ya'.) Perhaps I am now thinking, these quotes have diffrent meanings when applied in MySql queries, and perhaps other DB types. (I haven't really been paying attention to any other database tytpe fodder.) And furthermore, does thje function of the ' and " change in other commands? I could really use a complete description on this. Perhaps a link to some long overdue resource I should have read months ago before I designed my current project? You are confusing PHP stuff and database stuff. '...' prints ... literally regardless of what ... is So, whoever suggested to use '"$uname"' was on drugs However, if you have something like this: mysql_query("insert into blah values ('$uname',$age)"); It is still quite consistent. Variables get expanded inside double quotes in PHP. single quotes inside a double-quoted string are just like any other character to PHP. MySQL expects strings to be surrounded by single quotes in all queries. This has nothing to do with PHP. -Rasmus -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP + interbase connection problem
Looks like your PHP installation is not compiled with interbase support. Can you guve us some more details ? What is the OS you're using and the code the caused you problems. Meir Kriheli MKsoft computer systems 'There's someone in my head but it's not me" - Pink Floyd - Original Message - From: "Duky" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 23, 2001 7:53 PM Subject: [PHP-DB] PHP + interbase connection problem Can somebody help me out? I have some problems with connecting my gdb file with PHP. it is giving me this error: Fatal error: Call to undefined function: () in /home/sites/site156/web/columbus/ibconnect.php on line 9 What can I do now? Thnx, Duky -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] CONNECT BY PHP problem
With HORA, it is no problem to display the hierarchic structure via the CONNECT BY clause. I tried the same statement in PHP3 and it I'm using php4pl1 with Oracle 8.1.6 and this works: select c.cvsn_id, c.parent_cvsn_id, level from cvsn c where start with c.cvsn_id = :cvsn_id connect by prior c.cvsn_id = c.parent_cvsn_id David -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Apache, PHP4, access problem to MS SQL 7.0
Can anybody help me about my serious problem to connect to MS SQL 7.0. I tried to use the freetds-driver but i'm not able to connect with it. They said that I must define the Serverconnection in the interfaces-file. I found one in the freetds-directory but i don't know how to write it correct. I've got a Linux-webserver and MS SQL runs on a WinNT4.0-Server. There should be a file called 'interfaces' in whatever directory you installed FreeTDS (our is in /usr/local/freetds). That file lists all the Sybase/MSSQL servers you can connect to. Ours looks like this: server1 query tcp tds4.2 128.233.x.y 1433 server2 query tcp tds7.0 128.233.x.y 1433 (substitute 128.233.x.y for the real IP numbers of your server). For a 'standard' install of MSSQL server the port number is 1433. Took me a while to find that. If you're using FreeTDS, the third parameter of the interfaces file can be the version of TDS protocol to use when talking to that server. Also, make sure you have the SYBASE environment variable set to the directory where FreeTDS is installed. I'd recommend trying sqsh (SQL command line shell for Sybase servers -- works with MSSQL as well) to test the connection. It assumes a full Sybase install, so the Makefile took a little tweaking in order to get it to compile, but once installed it will help you debug the connection problem, test your queries etc. Not sure of a download site, but if you search Google you're bound to find it. Hope that helps. - Darryl -- Darryl Friesen, B.Sc., Programmer/Analyst[EMAIL PROTECTED] Education Research Technology Services, http://gollum.usask.ca/ Department of Computing Services, University of Saskatchewan -- "Go not to the Elves for counsel, for they will say both no and yes" -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]