Re: [PHP-DB] connection to Oracle 7.3 with ora_logon()
Thanks to Randall Barber, I've just to uncomment php_oci8.dll or php_oracle.dll in the php.ini file. It works now. I hadn't read enough the docs! Regards, Philippe -- 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-DB] session.save_path
Hi, in my php.ini file, there is [session] save_path = /tmp When I try to start a session, I have an error : Warning: open(/tmp\sess_62626e8e61a06b3f22c4c1bb82a6c92d, O_RDWR) failed: m (2) in {pathofmyphpfile} on line 31 and Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) where is the tmp folder? do I have to create it? Thanks in advance, Best regards, Philippe -- 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-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."'"; $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]
Re: [PHP-DB] session.save_path
save_path = c://temp (with two /) does the trick ""Philippe Saladin"" <[EMAIL PROTECTED]> a écrit dans le message news: 9davss$vl6$[EMAIL PROTECTED] > Hi, > in my php.ini file, there is > [session] > save_path = /tmp > > When I try to start a session, I have an error : > Warning: open(/tmp\sess_62626e8e61a06b3f22c4c1bb82a6c92d, O_RDWR) failed: m > (2) in {pathofmyphpfile} on line 31 > and > Warning: Failed to write session data (files). Please verify that the > current setting of session.save_path is correct (/tmp) > > where is the tmp folder? do I have to create it? > > Thanks in advance, > Best regards, > > Philippe > > > > > -- > 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] session.save_path
if you are using c: (win32 box) it should actually be c:\\ :) HTH Beau // -Original Message- // From: Philippe Saladin [mailto:[EMAIL PROTECTED]] // Sent: Wednesday, 9 May 2001 4:55 PM // To: [EMAIL PROTECTED] // Subject: Re: [PHP-DB] session.save_path // // // save_path = c://temp (with two /) does the trick // // // ""Philippe Saladin"" <[EMAIL PROTECTED]> a écrit dans // le message // news: 9davss$vl6$[EMAIL PROTECTED] // > Hi, // > in my php.ini file, there is // > [session] // > save_path = /tmp // > // > When I try to start a session, I have an error : // > Warning: open(/tmp\sess_62626e8e61a06b3f22c4c1bb82a6c92d, // O_RDWR) failed: // m // > (2) in {pathofmyphpfile} on line 31 // > and // > Warning: Failed to write session data (files). Please verify that the // > current setting of session.save_path is correct (/tmp) // > // > where is the tmp folder? do I have to create it? // > // > Thanks in advance, // > Best regards, // > // > Philippe // > // > // > // > // > -- // > 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] // -- 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."'"; $numlastv=pg_numrows($lastv); //print $numlastv." last visit returned"; 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=" ";} } 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."'"; > > $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] *.xls
HI, We are trying to do some functions to export data from database to Excel format. We have specyfication of the excel file format, and we are trying to generate binary file bite by bite, but we have problems with borders and frames. Maybe someone hes experienced similar problems? best regards Jarry Steve Brett wrote: > > i'd also be interested in this ... i have some code that will create .csv > files for download, whihc is the way i normally do it. > > Steve > > > -Original Message- > > From: Aivar Annamaa [mailto:[EMAIL PROTECTED]] > > Sent: 08 May 2001 13:02 > > To: [EMAIL PROTECTED] > > Subject: [PHP-DB] *.xls > > > > > > Hi > > Does anyone know some lib for generating excel files. > > I ask it here because database people could use such thing. > > > > Aivar Annamaa > > > > > > > > -- > > 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] -- 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] *.xls
could you send me the specs for the excel format ? Steve > -Original Message- > From: jarek [mailto:[EMAIL PROTECTED]] > Sent: 09 May 2001 10:41 > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] *.xls > > > HI, > > We are trying to do some functions to export data from database to > Excel format. We have specyfication of the excel file format, > and we are > trying > to generate binary file bite by bite, but we have problems > with borders > and frames. > Maybe someone hes experienced similar problems? > > best regards > > Jarry > > Steve Brett wrote: > > > > i'd also be interested in this ... i have some code that > will create .csv > > files for download, whihc is the way i normally do it. > > > > Steve > > > > > -Original Message- > > > From: Aivar Annamaa [mailto:[EMAIL PROTECTED]] > > > Sent: 08 May 2001 13:02 > > > To: [EMAIL PROTECTED] > > > Subject: [PHP-DB] *.xls > > > > > > > > > Hi > > > Does anyone know some lib for generating excel files. > > > I ask it here because database people could use such thing. > > > > > > Aivar Annamaa > > > > > > > > > > > > -- > > > 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] > > -- > 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[2]: [PHP-DB] *.xls
Hi Steve Brett, Wednesday, May 09, 2001, 12:24:02 PM, you wrote: Steve> could you send me the specs for the excel format ? Steve> Steve Best thing would be to post it here, or a link at least. I think many people could use this! --- EnjoY, Adaran ([EMAIL PROTECTED]) check http://www.adaran.net -- 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-DB] Help with mysql and php 4.03
Hi I'm trying to put up some php files I have created that is working normaly at php local server with php 4.04 and mysql 3.23.36 but it won´t work at the servr where the client will have it with php 4.03 and mysql 3.22.32 the thing that won´t work is when I got a sql query that contains a inner join statement that wont work with 3.22.32 is there any one that knows if it can´t handle inner join statemaents or are the loking diffrentlie the inner join statement that I have is below $result = mysql_query("SELECT * From city inner join state_prov on state_prov.state_id = city.state_id inner join area_phone on area_phone.city_id = city.city_id inner join phone_nr on phone_nr.phone_id= area_phone.phone_id inner join netwrk on netwrk.net_id = area_phone.net_id inner join country on country.country_id = state_prov.country_id inner join areacode on areacode.area_id = area_phone.area_id ORDER BY '$sSort'"); Thanks / Tobbe -- 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] *.xls
Hi, ...write to an XLS file without DLL's or Excel automation... visit: http://www.planet-source-code.com/xq/ASP/txtCodeId.11898/lngWId.1/qx/vb/scripts/ShowCode.htm "Adaran (Marc E. Brinkmann)" wrote: > > Hi Steve Brett, > > Wednesday, May 09, 2001, 12:24:02 PM, you wrote: > > Steve> could you send me the specs for the excel format ? > Steve> Steve > > Best thing would be to post it here, or a link at least. I think many people > could use this! > > --- > EnjoY, > Adaran ([EMAIL PROTECTED]) >check http://www.adaran.net > ...snipp... -- Hans-Werner Guth S http://www.qits.de QITS GmbH T mailto:[EMAIL PROTECTED] Formerstr 53 I fon +49-2102-852-145 40878 Ratingen Q fax +49-2102-852-202 -- 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] *.xls
it's VB ? > -Original Message- > From: Hans-Werner Guth [mailto:[EMAIL PROTECTED]] > Sent: 09 May 2001 14:32 > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] *.xls > > > Hi, > > ...write to an XLS file without DLL's or Excel automation... > > visit: > > http://www.planet-source-code.com/xq/ASP/txtCodeId.11898/lngWI d.1/qx/vb/scripts/ShowCode.htm "Adaran (Marc E. Brinkmann)" wrote: > > Hi Steve Brett, > > Wednesday, May 09, 2001, 12:24:02 PM, you wrote: > > Steve> could you send me the specs for the excel format ? > Steve> Steve > > Best thing would be to post it here, or a link at least. I think many people > could use this! > > --- > EnjoY, > Adaran ([EMAIL PROTECTED]) >check http://www.adaran.net > ...snipp... -- Hans-Werner Guth S http://www.qits.de QITS GmbH T mailto:[EMAIL PROTECTED] Formerstr 53 I fon +49-2102-852-145 40878 Ratingen Q fax +49-2102-852-202 -- 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] *.xls
Inside the downloadable ZIP file there "Excel Clas17881432001.zip" http://www.planet-source-code.com/xq/ASP/txtCodeId.11898/lngWId.1/qx/vb/scripts/ShowCode.htm you find a file called excel.txt containing a description of the MS-Excel File format: the first few lines: MICROSOFT EXCEL BINARY FILE FORMAT -- Mark O'Brien Microsoft Corporation 18-Feb-1988 Table of Contents - Introduction General BIFF Record Format Rows and Columns Within BIFF Cell Table - Concepts Cell Records Record Types Cell Attributes Order of Records Finding Values From BIFF Files Excel Formulas Expression Evaluation Unary Operators Binary Operators Operand Tokens - Constant Operand Tokens - Classes Operand Tokens - Base Control Tokens Function Operators Reserved Ptg's Scanning a Parsed Expression Excel Function Table Command Equivalent Function Table List of Ptg's Steve Brett wrote: > > it's VB ? > > > -Original Message- > > From: Hans-Werner Guth [mailto:[EMAIL PROTECTED]] > > Sent: 09 May 2001 14:32 > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP-DB] *.xls > > > > > > Hi, > > > > ...write to an XLS file without DLL's or Excel automation... > > > > visit: > > > > http://www.planet-source-code.com/xq/ASP/txtCodeId.11898/lngWI > d.1/qx/vb/scripts/ShowCode.htm > >...snipp... -- Hans-Werner Guth S http://www.qits.de QITS GmbH T mailto:[EMAIL PROTECTED] Formerstr 53 I fon +49-2102-852-145 40878 Ratingen Q fax +49-2102-852-202 -- 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] *.xls
a. many thanks :-) Steve > -Original Message- > From: Hans-Werner Guth [mailto:[EMAIL PROTECTED]] > Sent: 09 May 2001 15:09 > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] *.xls > > > Inside the downloadable ZIP file there > >"Excel Clas17881432001.zip" > > > http://www.planet-source-code.com/xq/ASP/txtCodeId.11898/lngWI > d.1/qx/vb/scripts/ShowCode.htm > > you find a file called excel.txt > containing a description of the MS-Excel File format: > > the first few lines: > > MICROSOFT EXCEL BINARY FILE FORMAT > -- > >Mark O'Brien >Microsoft Corporation >18-Feb-1988 > > Table of Contents > - > Introduction > General BIFF Record Format > Rows and Columns Within BIFF > Cell Table - Concepts > Cell Records > Record Types > Cell Attributes > Order of Records > Finding Values From BIFF Files > Excel Formulas > Expression Evaluation > Unary Operators > Binary Operators > Operand Tokens - Constant > Operand Tokens - Classes > Operand Tokens - Base > Control Tokens > Function Operators > Reserved Ptg's > Scanning a Parsed Expression > Excel Function Table > Command Equivalent Function Table > List of Ptg's > > Steve Brett wrote: > > > > it's VB ? > > > > > -Original Message- > > > From: Hans-Werner Guth [mailto:[EMAIL PROTECTED]] > > > Sent: 09 May 2001 14:32 > > > To: [EMAIL PROTECTED] > > > Subject: Re: [PHP-DB] *.xls > > > > > > > > > Hi, > > > > > > ...write to an XLS file without DLL's or Excel automation... > > > > > > visit: > > > > > > http://www.planet-source-code.com/xq/ASP/txtCodeId.11898/lngWI > > d.1/qx/vb/scripts/ShowCode.htm > > > >...snipp... > > -- > Hans-Werner Guth S http://www.qits.de > QITS GmbH T mailto:[EMAIL PROTECTED] > Formerstr 53 I fon +49-2102-852-145 > 40878 Ratingen Q fax +49-2102-852-202 > > -- > 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]
[PHP-DB] Call php function from javascript
How to call a php function from javascript and pass some parameters? Thanks, Marko. -- 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] Call php function from javascript
Well about the only thing i think you can do since the page has been sent(javascript is client side) is call a window open js functin then write the variables in the url to open ie ?id=32&blah=blahblah -Original Message- From: Marko Lesnik [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 09, 2001 9:14 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Call php function from javascript How to call a php function from javascript and pass some parameters? Thanks, Marko. -- 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]
[PHP-DB] INSERT Problem
This is driving me nuts. I can't insert anything into a mysql database using PHP. I can insert from the command line when logged in with Telnet. Using PHP I can connect and retrieve data from the database, just can't INSERT anything. This is what doesn't work: $sql = "INSERT INTO $table_name (First_Name, Last_Name) VALUES (\"Jeff\", \"Oien\")"; $result = mysql_query($sql,$connection) or die("Failed"); or $sql = "INSERT INTO $table_name (First_Name, Last_Name) VALUES (\"$First_Name\", \"$Last_Name\")"; $result = mysql_query($sql,$connection) or die("Failed"); yet this will work from the command line: INSERT INTO TheTable (First_Name, Last_Name) VALUES ("Jeff", "Oien"); Am I missing something? Thanks for any help. Jeff Oien -- 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] INSERT Problem
OK, did that and it's just printing the INSERT command back to me. INSERT INTO OVEvents (First_Name, Last_Name) VALUES("Jeff", "Oien") Any help from here? Thanks. Jeff Oien > > echo $sql; > > > always helpful, then paste that into the command line client and check the > error > > > Cameron > > Jeff Oien wrote: > > > This is driving me nuts. I can't insert anything into a mysql database > > using PHP. I can insert from the command line when logged in with Telnet. > > Using PHP I can connect and retrieve data from the database, just can't > > INSERT anything. > > > > This is what doesn't work: > > $sql = "INSERT INTO $table_name (First_Name, Last_Name) > > VALUES (\"Jeff\", \"Oien\")"; > > $result = mysql_query($sql,$connection) or die("Failed"); > > > > or > > > > $sql = "INSERT INTO $table_name (First_Name, Last_Name) > > VALUES (\"$First_Name\", \"$Last_Name\")"; > > $result = mysql_query($sql,$connection) or die("Failed"); > > > > yet this will work from the command line: > > INSERT INTO TheTable (First_Name, Last_Name) > > VALUES ("Jeff", "Oien"); > > > > Am I missing something? Thanks for any help. > > Jeff Oien > > > > -- > > 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] INSERT Problem
That told me my problem. Thank you! I hadn't selected the database in my connect include but had it in other scripts and not this one. Long story but thanks for the help. I can stop banging my head now. Jeff Oien > on 5/9/01 12:29 PM, Jeff Oien at [EMAIL PROTECTED] wrote: > > > Am I missing something? > > yes. you aren't giving yourself any feedback about what happened when the > insert failed. > > instead of: > > $sql = "INSERT INTO $table_name (First_Name, Last_Name) > VALUES (\"Jeff\", \"Oien\")"; > $result = mysql_query($sql,$connection) or die("Failed"); > > try: > > $sql = "INSERT INTO $table_name (First_Name, Last_Name) > VALUES (\"Jeff\", \"Oien\")"; > if(! $result = mysql_query($sql,$connection)) { > > print("ERROR ".mysql_errno().": ".mysql_error()."\n$sql\n"); > > } > > also- i don't see your code for mysql_connect(). make sure you have a valid > connection to mysql. > > > > have a great day > andy > > -- > *** > Andrew Rush :: Lead Systems Developer :: MaineToday.com > *** > > "A friend of the devil is a friend of mine" - R. Hunter > > > > -- 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] Help with mysql and php 4.03
>Hi I'm trying to put up some php files I have created that is working >normaly at php local server with php 4.04 and mysql 3.23.36 > >but it won¥t work at the servr where the client will have it >with php 4.03 and mysql 3.22.32 > >the thing that won¥t work is when I got a sql query that contains a inner >join statement >that wont work with 3.22.32 is there any one that knows if it can¥t handle >inner join statemaents or are the loking diffrentlie > >the inner join statement that I have is below > >$result = mysql_query("SELECT * From city >inner join state_prov on state_prov.state_id = city.state_id >inner join area_phone on area_phone.city_id = city.city_id >inner join phone_nr on phone_nr.phone_id= area_phone.phone_id >inner join netwrk on netwrk.net_id = area_phone.net_id >inner join country on country.country_id = state_prov.country_id >inner join areacode on areacode.area_id = area_phone.area_id >ORDER BY '$sSort'"); > >Thanks / Tobbe Sir, earlier versions of MySQL didn't support the INNER JOIN keywords. For 3.22.x, replace the INNER JOINs with commas and move the ON conditions to the WHERE clause. FROM city, state_prov, area_phone, ... WHERE state_prov.state_id = city.state_id AND area_phone.city_id = city.city_id AND ... Bob Hall Know thyself? Absurd direction! Bubbles bear no introspection. -Khushhal Khan Khatak MySQL list magic words: sql query database -- 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-DB] PHP and Oracle
Hi, I just wanted to know if there are any known issues with PHP working with Oracle database. We are currently configuring Oracle to make PHP work with Oracle. Let me know. Thanks Lokesh -- 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-DB] Error with connection to Oracle 7.3 with ora_logon()
Hi, I have the follow error when i try to connect to Oracle 7.3.3. Warning: Oracle: Connection Failed: ORA-12154: TNS:no se ha podido resolver el nombre del servicio in C:\Inetpub\wwwroot\websuperII\pruebas\ConexionOracle.php on line 7 Error conectando a la base de datos. Please help me - Original Message - From: "Wayne Bastow" <[EMAIL PROTECTED]> To: "Philippe Saladin" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, May 07, 2001 7:20 PM Subject: Re: [PHP-DB] connection to Oracle 7.3 with ora_logon() > On Sat, 5 May 2001 01:26, Philippe Saladin wrote: > > Hello, > > > > Newbie to PHP, I try to connect to an Oracle 7.3 database. > > Is there something special to do to use the oracle functions, as > > ora_logon?? I obtain a message "fatal error : Call to undefined function: > > ora_logon()" SqlNet Client is installed > > > > Best regards > > > > Philippe > > Did you compile oracle support into PHP? > > Wayne > -- > Wayne Bastow - DBA - Central Coast Health Phone: 61 2 43203231 > Email: wbastowATccahsDOThealthDOTnswDOTgovDOTau > > Linux, the choice of a GNU generation Kernel 2.2.16-22 on a i686 > > Running Windows on a Pentium is like having a brand new Porsche but only > be able to drive backwards with the handbrake on. (Unknown source) > > == > This message is intended for the addressee named and may contain > confidential information. If you are not the intended recipient, please > delete it and notify the sender. Views expressed in this message are > those of the individual sender, and are not necessarily the views of > the NSW Department of Health. > == > > -- > 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]
[PHP-DB] True and Flase in mysql !!
hi all .. What is the best way to create True\Flase field in mysql ?? - http://deslcub.com/phpLinkat/ DesClub.com
Re: [PHP-DB] True and Flase in mysql !!
Use an enum field. --zak - Original Message - From: "DesClub.com" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, May 10, 2001 2:43 AM Subject: [PHP-DB] True and Flase in mysql !! hi all .. What is the best way to create True\Flase field in mysql ?? - http://deslcub.com/phpLinkat/ DesClub.com -- 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-DB] MySq lType and PHP??
Hi, I'm trying to get MySql type of a field (as string) into a php script. Can anyone help me ??? Thanks ! -- 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] The Dreaded Oracle 8 TNS:ORA-12154 Connection Error
Hi Folks, Well, thanks to a posting by Benoit Noss on 2001-01-04 I solved my problem. Benoit's solution was to strip carriarge returns from Tnsnames.ora (remember we are talking Windows/DOS text files here - I would dearly love to change to a Unix box but our web site uses an ActiveX library that isn't available on unix). Since we use a name server we mainly depend on Sqlnet.ora. I stripped the CR's from Sqlnet.ora by ftp'ing it to a unix host in ascii mode then retrieving it binary mode (didn't have an alternative tool at hand), re-started Apache/CGI and all was well. I tested with php4 as both a module and CGI and everything now works well. You might like to strip the CR's from Tnsnames.ora as well as most Sqlnet.ora's fall back to Tnsnames.ora if they can't locate the service on an Oracle name server. I tested, Oci8 connect, odbc connect and ADO. This may be of interest to Unix users having similar problems...many Oracle installs have two copies of Sqlnet.ora and Tnsnames.ora, in my case Oci8 uses the ones under ORACLE_HOME\Net80\Admin\ and odbc connects uses those under ORACLE_HOME\Network\Admin. This may be why stripping CR's from Tnsnames.ora has failed to work for some people. On our production web server Oci AND odbc uses ORACLE_HOME\Net80\Admin\ but ADO (COM) uses ORACLE_HOME\Network\Admin even though the specified driver is {Oracle ODBC Driver} (go figure). So a general rule of thumb on Windows servers would be to strip CR's from ALL copies of Sqlnet.ora and Tnsnames.ora. On unix boxes when you set the TNS_ADMIN environment variable before attempting an Orcale connect, ensure that it is pointing to the directory that actually contains Sqlnet.ora/Tnsnames.ora that your oracle client will be using (& make sure ORACLE_HOME is set of course). I haven't yet figured why without stripping the CR's from the .ora files that oracle connects succeed when php4 is loaded as a module but fails when it is run as CGI...but I have noticed that some environment variables dumped using phpinfo() are different (such as USERPROFILE)...maybe ??? Anyway, haven't got time to delve further now, it can wait until I have some spare time. Thanks to all, especially Benoit. Paul Shortis The following message was sent by "John Edward Molano" <[EMAIL PROTECTED]> on Wed, 9 May 2001 15:32:54 -0500. > Hi > > I have the even error but in oracle 7.3.3, this is: > > Warning: Oracle: Connection Failed: ORA-12154: TNS:no se ha podido resolver > el nombre del servicio in > C:\Inetpub\wwwroot\websuperII\pruebas\ConexionOracle.php on line 7 > Error conectando a la base de datos. > > Do you already have the solution? if yes, please send me it. > > Thanks > > John Molano > > > > > - Original Message - > From: "Paul" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, May 07, 2001 10:30 PM > Subject: [PHP-DB] The Dreaded Oracle 8 TNS:ORA-12154 Connection Error > > > > I am running PHP 4.0.4pl1 in CGI mode on Windows NT4 SP6, using Apache or > IIS Web Server's. > > > > I am concentrating on Apache for this problem as it is identical > irrespective of the Web Server. > > > > I'm using one of the simplest possible connection mechanisms ... > > > > if ($conn=Ora_Logon("user@mydatabase","pass")) > > { > > echo "SUCCESS ! Connected to database\n"; > > Ora_Logoff($conn); > > } > > else > > { > > echo "Failed :-( Could not connect to database\n"; > > } > > > > This works fine if PHP is run as an apache module but fails with the > message > > > > "Warning: Oracle: Connection Failed: ORA-12154: TNS:could not resolve > service name in c:\program files\apache group\apache\htdocs\ora.php on line > 10" > > > > When Apache is re-configured to run PHP as CGI (other html on the same > page suce as phpinfo() shows up just fine). > > > > At first I thought the Apache user may have been affecting privileges but > the Apache "User" option doesn't work under Windows & I even tried running > Apache as a service using the Administrator > > account - no change. Have tried environment paths to ORACLE_HOME, TNS_PATH > etc. etc. etc. all to no avail. We use sqlnet.ora with an oracle name > server. > > > > I have to use CGI as PHP4 isn't to production level for use as a Filter > with IIS & corporate policy dictates that I must prove PHP against ASP on > the existing IIS server before I can even attempt using > > Apache. > > > > I would greatly appreciate any construction :-) advise anyone can offer. > > > > Regards, Paul Shortis > > > > > > -- > > 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] Call php function from javascript
you can't.. but you cant use some tricks something like this... in js var ep= new Image; ep.src=".php?id=a greetings - Original Message - From: "Marko Lesnik" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 09, 2001 12:14 PM Subject: [PHP-DB] Call php function from javascript > How to call a php function from javascript and pass some parameters? > > Thanks, > Marko. > > > > -- > 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]
[PHP-DB] mysql newbie
Hello php-db, a allready install mysql on apache and idont create any user yet one question from me, when i enter mysql, i can enter it without being asking any password(i'm not root). how to set mysql to ask password to any user who try to enter ? -- Best regards, andrie mailto:[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]