[PHP-DB] posting field_DATE variables
Hello dear all, I have a php-application witch use mysql DB; My db have a field (DATE) like timestamp(8) = 20030110, for lay-out problem i call field_DATE with a query : date_format(field_DATE, '%d-%m-%Y'), and it display the field_DATA; 10-01-2003 well.at this point i need to post this field_DATA on another php script witch let me to make another SELECT on same DB; but now the $field_DATA variable is like 10-01-2003. How i can post $field_DATA variable such as 20030110 again? (the original DB_field). thaks in advance ciao, fabrizio -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] posting field_DATE variables
On Thu, 23 Jan 2003 00:27:26 +0800 Jason Wong [EMAIL PROTECTED] wrote: On Wednesday 22 January 2003 23:53, Fabrizio Tivano wrote: I have a php-application witch use mysql DB; My db have a field (DATE) like timestamp(8) = 20030110, for lay-out problem i call field_DATE with a query : date_format(field_DATE, '%d-%m-%Y'), and it display the field_DATA; 10-01-2003 well.at this point i need to post this field_DATA on another php script witch let me to make another SELECT on same DB; but now the $field_DATA variable is like 10-01-2003. How i can post $field_DATA variable such as 20030110 again? (the original DB_field). There are many ways to do this. One is: $date = explode('-', '10-01-2003'); $newdate = $date[2] . $date[0] . $date[1]; -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * YEP! that's work fine! thanx a lot! fabrizio -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] execute external sql script in php
Hello dear all, i try to execute an external sql-script to the mysql server $query =source /home/mysql/mysql_script ...but allways i get Impossible to execute the query any idea to do a stuff like this? thanks fabrizio -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] execute external sql script in php
Jeff, source command in mysql shell is the same like mysql -u user -p /home/mysql/mysql_script. if i'm in the mysql shell i do: mysql source /home/mysql/mysql_script; ...to execute the script. this look to work like a normal query, but in my php script dont work! what's wrong? regards, fabrizio On Tuesday 18 June 2002 13:22, [EMAIL PROTECTED] wrote: is this from within the browser? if so, you'd need to open the file, read the contents and execute the script. I don't knwo what 'source' does. but i don't claim to know much either. i may not have heard of this. if you just want to do it from a command line then you use a after your login and password args mysql -u user -p /home/mysql/mysql_script Hope this helps Jeff fabrizio fabrizio@sad. To: [EMAIL PROTECTED] it cc: Subject: [PHP-DB] execute external sql script in php 06/18/2002 06:19 AM Please respond to fabrizio Hello dear all, i try to execute an external sql-script to the mysql server $query =source /home/mysql/mysql_script ...but allways i get Impossible to execute the query any idea to do a stuff like this? thanks fabrizio -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] date format display
Hello dear all, in my mysql-db I have a date_tbl with this format: (20020531). how is possible in PHP do display date_tbl's values in a more human-readable format like 05-31-2002 or 31/05/2002 ? thaks in advance, regards fabrizio -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MS-SQL Server on PHP4/Apache/Linux
I currently use PHP4/IIS to access a MS-SQLServer 7.0 with mssql_* functions (php_mssql70.dll extension). I plan to move my website on PHP4/Apache/Linux, and I am wondering if thoses functions will work and how, as I didn't find any explanations on it in documentation. I think the functions could work very well, but they will be totally useless since it does not exist a linux client for Ms-Sql. Porting your app to linux will require also the use of a different backend (I hope you used a DB abstraction layer). If this is not feasible, your only choice to access to MS-Sql from linux is using an ODBC client ported to linux (but you will have to chenage your code as well). You will find them easily on the list archive, I don't remember well the names and I don't want to give you a wrong link. 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] Updating multiple forms
On 18 Apr 2001, at 17:27, Shahmat Dahlan wrote: Yes, this is only applicable if I only have one table. What if I need to update multiple tables? Shamat, it seems we need some more info to understand your needs. What precisely are you trying to do? /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ 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] Concurrent update to database (PostgreSQL or MySQL) ??
On 18 Apr 2001, at 13:47, Nicolas Guilhot wrote: Don't want to start another religion war, but... Hi, How can I avoid two or more users to update the same record at the same time ? Ideally, I would like to lock the record when a user open it for modification. So if another user try to open the same record he'll be warned or get record values as read only. Is this possible and how to do it with PHP ?? How can I know that the user that has locked the record has finished with it, if he never commits his changes ? Is there an FAQ about this ? Rather than a FAQ, you should find some good textbook on cuncurrent programming. The problem of concurrent updates of data is far too large to be tackled with a brief doc (and even less with a mail, I'm afraid). But to be short: Generally, Every DBMS out there can guarantee you that there will be no 2 users trying to update the same data together (i.e. querys are serialized). When it comes to multiple updates, however, or updates that touch different tables the problem gets harder, and the doubt you put in the subject can comport big difference in the way to handle it. In the MySQL paradigm, it's up to the programmer to guarantee data integrity at application level. In PostgreSQL (and in the rest of the DBMS world) paradigm, this work is still left to the DBMS system, thru isolated transactions. It's up to you to decide which way to go... /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ 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] 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] MSSQL and @@identity
On 11 Apr 2001, at 11:40, Daniel Fairs wrote: Hi, I'm trying to insert a row into an MSSQL7 table using the SQL string: INSERT INTO person (birthdate,deathdate,sname,othername,motherid,fatherid) VALUES ('1978-10-06',NULL,'Fairs','Daniel',NULL,NULL) SELECT @@identity AS last_identity The actual PHP code is $oRes = mssql_query("SET NOCOUNT ON " . $sSQL, $this-iConnIndex) ; if ($oRes) echo "yea" ; else echo "nay" ; die() ; ... and 'nay' gets printed I've tried both SET NOCOUNT ON and SET NOCOUNT OFF, and also omitting the SET NOCOUNT completely. Any ideas why I'm not getting the last id back? Maybe the problem is simpler: on some version of mssql API (maybe all?), I've verified that mssql_returns non-zero only for SELECT statements (returns the number of rows selected, to be more precise). All other statements return zero, so you could see that darn "nay" even if the query worked perfectly :-(... 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] MSSQL and @@identity
On 11 Apr 2001, at 13:00, [EMAIL PROTECTED] wrote: (returns the number of rows selected, to be more precise). Ehm... forget this part. I momentaneally disconnected the brain, I'm afraid :-) /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ 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] DOH! Is it so obvious that i cannot figure it out?
Should i do something with MySQL? Should i write a routine in PHP that scan every text returned for the characters and if found - change them before printing them to the browser? This seems like a slow process. There's already a function called HTMLentities() that could give you an help, try that... /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ 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]
[PHP-DB] generating valid JS URL from database field with accents???
Hi all... I'm having a little problem in converting a site to spanish, due to - apparently - IE that doesn't like accented words. I have a db-driven website, of a fairly classical type - texts and image paths are stored in a DB, and pages are generated thru PHP. I'm converting this site to spanish language, and I've discovered that some images link containing accented vowels don't work in IE, if javascript is involved. But here is the code (I'm using PHPlib's astraction library, but I think it's pretty clear): $db-query("select title, path, path_2 from images_family where name_family='$name';"); while($db-next_record()) { $titolo=$db-f("title"); $imagetiny=$db-f("path"); $imagebig=$db-f("path_2"); [...] echo "H5 class=nomeimg$titolo/H5"; $size[0]+=20; $nomeurl=rawurlencode($name); $immagineurl=rawurlencode($imagebig); echo "A class=corpomenu HREF='javascript:openwindow(\"/img/$nomeurl$immagineurl\",".$siz e[1].",".$size[0].");'B".$TAGIMMAGINE."/B/A\n"; --- ("$TAGIMMAGINE" contains the html to display the thumbnail image, and works good). Now the problem is that when I click on the thumbnail, I get a "page not found error". But hovering about it with the mouse, I see the right URL, and if I do a "copy paste" of it, it works! Example: this is what I found in the HTML source I generate (and it's correct, IMHO): A class=corpomenu HREF='javascript:openwindow("/img/Servidor%20de%20Perif%E9ric os19.gif",681,520);' this is what I see when I hover on the image: 'javascript:openwindow("/img/Servidor de Perifricos19.gif",681,520); And this seem correct too, but as I said, if I click on it I get a 404. What can i do to generate a link that IE likes? I've tried not to use rawurlencode, but nothing changed. NS works fine. Thank you in advance for any suggestion... /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ 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] Unix crypt
On 16 Mar 2001, at 10:53, Vanstaen Laurent wrote: Hi all, Do you know if the php "crypt" function really works like the unix one ?? I mean, when I compare my password on my system (crypted with unix crypt) and my password crypted with php crypt, it's not the same. And the php crypt doesn't send twice the same answer. Because if you don't specify the salt, this will be randomly selected each time you call the function, so it will give different results each time. As for the system password, keep in mind that different systems use different crypting algorithms; I guess that the right thing to do is carefully reading of both php's crypt manpage that the system's one. 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: Re2: [PHP-DB] Windows 2000 follow up
Oh god, let's not get started on that.. lol oh well.. hey do you know how to fix up the securit for internet users? Maybe you could be able to configure different virtual directory to run under the right of different users. If this is not possible you have to find Win2000 analogous of "wrapper" programs - not that I know that they exist, however :-( /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ 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] Query qizzle quackarooney! :|
On 13 Feb 2001, at 11:41, Trond Erling Hundal wrote: Hey there fellow querieres I summon your power! (eh..) well.. enough with the nonsense :) I have a littlebit of problem: I am displaying 15 different newsarticles on a page. The articles are displayed in three different tables. First there`s one article (the main-top-story) that is shown in the top of the page. Then there is an ad. And then. Below this ad, there are two columns, each displaying 7 articles each. The articles can be divided into two distinct groups. smallnews, and news, and this is stored in the article table in a field named Kategory! That is: smallnes cannot be shown before 4 "real" newsarticles has been displayed. What do YOU think? Divide your query in two part. Supposing you're ordering them by freshness, something like: "select * from news where Kategory=bignew order by date desc limit 4" and "select * from news where Kategory=smallnew order by date desc limit 3" likewise, do 2 cicles, the first showing major news, the second showing small ones. This way you don't need a single "if" nor complicated flow control structure... I've always liked KISS predicate :-) 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] db2 with php
I've installed db2 and created the default instance at /home/db2inst1/. PHP is compiled with the --with-ibm-db2 option, however when I try to start apache I get the message: "Cannot load /etc/httpd/modules/libphp4.so into server: libdb2.so.1: cannot open shared object file: No such file or directory" when I try to load the php4 module. libdb2.so.1 exists in /home/db2inst1/sqllib/lib/ so I'm not sure why php can't find it. Can anyone help me with this? Default installation of DB2 under redhat failed to properly setup automatically the environment at reboot (at least for me), so that I had to manually set it. There is a script file that does this under the instance dir. Try "source /home/db2inst1/sqllib/db2profile" If after that all works, you can put that in rc.local or wherever you feel it could be its place :-) HTH, bye Fabrizio /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ 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]