Re: [PHP-DB] mysqlimport
Just incase anyone else is looking for the answer, the problem was solved thus: exec("/usr/local/mysql/bin/mysqlimport --replace --fields-terminated-by=\| - -user=testuser --password=testpassword testdb /home/testdomain/www/Admin/test_mysqltable.txt"); It just needed a path to the mysqlimport command... Keith - Original Message - From: "Keith Spiller" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 13, 2001 6:51 PM Subject: [PHP-DB] mysqlimport Hello, I'm trying to use: passthru("mysqlimport --replace --fields-terminated-by=\| --user=testuser -- password=testpassword testdb /home/testdomain/www/Admin/test_mysqltable.txt", $output); The mysqlimport command works perfectly at the telnet command prompt, but never through Php. When I echo $output I get '126' or '127'. But the process does not work. I have also tried using system and exec commands. Any suggestions? Thanks, Keith -- 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] Repost: postgresql / groups and users
for my application in php I connect with a postgresql database. In this database I have made users and groups, where 1 user can be the member of many groups (n on m relation) That works, but how do I let php find out if a user is a member of a certain group? I tried to get the relation out of the database and that worked, as far as that I got a list like { group1, group2, group3 } (it's been a while, and I write this from heart) A solution (I was not happy with) was making users, and create a special table with users and a table with groups and create a table that has both user and group as the primary key, so there was a n on m relation possible. In the group database I put a username and password (which is why I don't like the solution) that should log into the database. The whole reason is that I create buttons, and people who don't have the rights should not even see the buttons... Anyone who can help me out? Yours, Michiel Lange -- 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] ODBC DataBase Paging Solution
Hi ! Do somebody has a paging solution for ODBC connection ? Thanks. Regards, Veniamin
Re: [PHP-DB] Trouble connecting to MSSQL 2k DB
Try put the php dlls on %systemroot%/system. I have IIS 5.0 + PhP 4.0.6 + MSSQL on a W2k server working perfectly. Later, Jorge Giménez - Original Message - From: "Sean Swehla" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 13, 2001 8:10 PM Subject: [PHP-DB] Trouble connecting to MSSQL 2k DB > I'm running Win2k server, with MSSQL 2k, & PHP 4.0.6. Every time I try > to connect to the SQL sesrver within the script I get the following > output: > > X-Powered-By: PHP/4.0.6 > Content-type: text/html > > Warning: MS SQL message: Login failed for user 'tu'. Reason: Not > associated with a trusted SQL Server connection. (severity 14) in [script > path] on line 9 > > Warning: MS SQL: Unable to connect to server: PHP in [script path] on > line 9 > > Warning: MS SQL: Unable to connect to server: (null) in [script path] > on line 10 > > Warning: MS SQL: A link to the server could not be established in > [script path] on line 10 > > Lines 9 & 10 are as follows: > > $link_identifier = mssql_connect($server, $user, $pw); > mssql_select_db($db); > > I have the php_mssql.dll file installed in %systemroot%/system32 and the > appropriate line in php.ini. I've found hundreds of references on various > websites and in the mailing list archives to php_mssql70.dll, but cannot > locate it anywhere. Any help/thoughts/guidance would be appreciated. > > -=-=- > Sean Swehla, MCP > Network Architect > VPN Solutions, LLC > > -- > 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] Not so relative but important...
Hello everyone... This is not a very relative question to DB and php but would mean a lot if someone helped me out.. It involves html headers... What i want to do is when i have a pdf or doc file ... using a special header, when clicking the file the page to download the file and not opening it as usual.. Is tha possible??? Can someone help me out?
[PHP-DB] Sybase CT with/without Sybase ASE
Dear All, In the past I had installed an Apache server with PHP 4.0.6 and Sybase CT extension on Mandrake Linux 8, all ok. On the Mandrake machine, I had installed Sybase ASE 11.9.2, that was only used for test; most of the time the php code used sybase ct lib to refer to another database server (Sybase ASE 12.5 on Solaris), and all worked. But now I tried to update the test Sybase ASE database server on Mandrake from 11.9.2 from 12.5. I was not successful, but I could live without test database, so I didn't worry. But at next reboot, Apache was failing to start with this message: Syntax error on line 205 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/libexec/libphp4.so into server: libinsck.so: cannot load shared object file: No such file or directory /etc/init.d/httpd start: httpd could not be started The file libphp4.so is in place, but file libinschk.so is not on the machine. I thought that PHP and sybase ct didn't need a database server to be installed on the machine; was I wrong? I also tried uninstalling completely 12.5, but still Apache doesn't start. As I said, I can live without that database server, but I need Apache, Php, and Sybase ct, please help. Thanks in advance Carlo Borreo -- 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] oracle 8 database error 12154 using apache server on windows NT
Hi, I'm trying to connect to an oracle 8 database using php 4.0.6 In my php.ini file I deleted the ";" in front of extension php_oci8.dll. I've set the format of tnsnames.ora and sqlnet.ora to the unix format. In the beginning of my php code I type: putenv('ORACLE_HOME = c:\oracle\ora81'); putenv('TNS_ADMIN = c:\oracle\ora81\network\admin'); I also used winnt search to make sure that I changed the format of EVERY version of tnsnames.ora and sqlnet.ora, I even changed the format of every .ora file in c:\oracle\ora81\network\admin' to a unix format, but I still get error 12154. In the forum on www.php.net I read something about setting user and group to the same as oracle's in the apache htppd.conf file, but I don't seem to have any such setting in httpd.conf. The apache I use is the one installed by default by oracle 8, so I don't think that is the problem. If you have any clue, any help would be welcome. Thanks, Kristof. -- 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] eregi and ereg??
Hi, You cannot put multiple variables in ereg(). This is taken from http://www.php.net/manual/en/function.ereg.php i think it will explain it better If matches are found for parenthesized substrings of pattern and the function is called with the third argument regs, the matches will be stored in the elements of the array regs. $regs[1] will contain the substring which starts at the first left parenthesis; $regs[2] will contain the substring starting at the second, and so on. $regs[0] will contain a copy of string. If ereg() finds any matches at all, $regs will be filled with exactly ten elements, even though more or fewer than ten parenthesized substrings may actually have matched. This has no effect on ereg()'s ability to match more substrings. If no matches are found, $regs will not be altered by ereg(). There are some code snippets that ilustrate the use of the $regs array. HTH Dobromir Velev -Original Message- From: Jason Caldwell <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Friday, September 14, 2001 8:15 AM Subject: [PHP-DB] eregi and ereg?? www.php.net shows the proper format for EREG and EREGI is: int ereg (string pattern, string string [, array regs]) My question is this; I want to be able to compare 2 or more strings to the EREG(I) STRING PATTERN... without having to create two separate EREG(I) IF...THEN statements... If I understand the format as displayed above, then I should be able to put multiple variables in the EREG(I) expression... like so; if(eregi("x", $string1 $string2 $string3, $regs) Is this correct? Or, do I have to specify an IF...THEN type of statement for each $STRING ?? Thanks Jason [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] moving uploaded files
Hi, PHP has its own filesystem functions which you can use. If you want to move a file from one location to another you could use something like this The $old_file and the $new_file variables should contain the absolute path e.g. /home/user/filename.txt Check http://www.php.net/manual/en/ref.filesystem.php for a more detailed explanation of the filesystem functions. HTH Dobromir Velev -Original Message- From: Jon Mormino <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Thursday, September 13, 2001 11:10 PM Subject: [PHP-DB] moving uploaded files Does anyone have a solution for the following problem. I use dbwired.com for hosting (great service). They do not, however, for obviously reasons allow the system() command from a php script. So, when I switched to this server I had to switch from a system("mv file1 file2"); command to a move_uploaded_file("path1","path2"); command which is fine...for uploading. But, once a file is uploaded I can't figure out a way to move or delete it as it is no longer considered an "uploaded file" and hence move_uploaded_file() fails. Does anyone know a way around this? Thanks. -Jon Mormino -- 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] Not so relative but important...
Hi, try HTH Dobromir Velev -Original Message- From: Koutsogiannopoulos Karolos <[EMAIL PROTECTED]> To: 'Php-Db (E-mail) <[EMAIL PROTECTED]> Date: Friday, September 14, 2001 1:44 PM Subject: [PHP-DB] Not so relative but important... >Hello everyone... > >This is not a very relative question to DB and php but would mean a lot if >someone helped me out.. > >It involves html headers... > >What i want to do is when i have a pdf or doc file ... using a special >header, when clicking the file >the page to download the file and not opening it as usual.. >Is tha possible??? > >Can someone help me out? > -- 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] Problems inserting large blob
I forgot to say that php.ini file has 8Mb set as the maximum possible upload file size. Thanks for everything ... I really need some help on this! João B. -- Joao Barreto - E-Business and Security Manager Convex - Informática e Sistemas de Comunicações Portugal, Lda Tagus Park, Edf. Ciência II, 2º, 2780-920 Porto Salvo Portugal mailto:[EMAIL PROTECTED] phone:+351 21 4229200 -Original Message- From: Justin Buist [mailto:[EMAIL PROTECTED]] Sent: quinta-feira, 13 de Setembro de 2001 21:38 To: Joao Barreto Cc: php-db@lists. php. net Subject: Re: [PHP-DB] Problems inserting large blob You might want to check php.ini - if memory serves the maximum filesize you can upload over HTTP by default is 2MB. Bump that number up and restart Apache (or whatever webserver you use) and see if that fixes the problem. 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 On Thu, 13 Sep 2001, Joao Barreto wrote: > > Hello all ... > > I'm having a problem uploading large files (3MBytes for examples) > and inserting it onto a MySQL database. No problem with smaller files. > > The code is basically this: > > $data = addslashes(fread(fopen($form_data, "rb"), filesize($form_data))); > $result=MYSQL_QUERY("INSERT INTO file2download > (description,bin_data,filename,filesize,filetype, filecompany) ". > "VALUES > ('$form_description','$data','$form_data_name','$form_data_size','$form_data > _type', '$empresa')"); > if (mysql_errno() != 0) echo mysql_error(); > $id= mysql_insert_id(); > ?> > > When the files are the mentioned size (I checked the whole file got there on > /tmp/something) > I get an error message along these lines: 'MySQL Server moved away' and the > fid is 0. > > Any ideas? > Is there any limitation on the size of the 'insert into' string? If so, how > can I store > such a big data chunk on the database? > > And please, answer directly by email as well to me. Sometimes it is > difficult to find > a message among the ones that we get each day! > > Thanks for your support, > João Barreto - Convex Portugal > > > -- > 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] eregi and ereg??
You cannot specify multiple strings. However, you CAN concatenate strings and perform ereg()/eregi(): if( eregi("x", $string1.$string2.$string3, $regs ) -Original Message- From: Jason Caldwell [mailto:[EMAIL PROTECTED]] Sent: Friday, September 14, 2001 12:14 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] eregi and ereg?? www.php.net shows the proper format for EREG and EREGI is: int ereg (string pattern, string string [, array regs]) My question is this; I want to be able to compare 2 or more strings to the EREG(I) STRING PATTERN... without having to create two separate EREG(I) IF...THEN statements... If I understand the format as displayed above, then I should be able to put multiple variables in the EREG(I) expression... like so; if(eregi("x", $string1 $string2 $string3, $regs) Is this correct? Or, do I have to specify an IF...THEN type of statement for each $STRING ?? Thanks Jason [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] Looking for alternative to phpMyAdmin for data entry
Dear Newsgroup I am looking for an alternative to phpmyAdmin thatwill generate clumsy entry screens that allows you to select data type for each field (makes litle sence to me). Database it - table san_port Field Type Function Value san varchar(20) ASCIICHARSOUNDEXCURDATECURTIMEFROM_DAYSFROM_UNIXTIMENOWPASSWORDPERIOD_ADDPER IOD_DIFFTO_DAYSUSERWEEKDAYRAND port varchar(20) ASCIICHARSOUNDEXCURDATECURTIMEFROM_DAYSFROM_UNIXTIMENOWPASSWORDPERIOD_ADDPER IOD_DIFFTO_DAYSUSERWEEKDAYRAND wwid varchar(16) ASCIICHARSOUNDEXCURDATECURTIMEFROM_DAYSFROM_UNIXTIMENOWPASSWORDPERIOD_ADDPER IOD_DIFFTO_DAYSUSERWEEKDAYRAND Rgds Henrik -- 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] Student Suspended Over Suspected Use of PHP
http://www.bbspot.com/News/2000/6/php_suspend.html -- 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] Looking for alternative to phpMyAdmin for data entry II (Yellow background)
Dear Group Sorry about the missing grafics (is was so nice when I posted it). Now my friend says there was a online demo of a data entry page with YELLOW backgound color doing just this! Any ideas? Rgds Henrik "Henrik Lassen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Dear Newsgroup > > I am looking for an alternative to phpmyAdmin thatwill generate clumsy entry > screens that allows you to select data type for each field (makes litle > sence to me). > Database it - table san_port > > Field Type Function Value > san varchar(20) > ASCIICHARSOUNDEXCURDATECURTIMEFROM_DAYSFROM_UNIXTIMENOWPASSWORDPERIOD_ADDPER > IOD_DIFFTO_DAYSUSERWEEKDAYRAND > port varchar(20) > ASCIICHARSOUNDEXCURDATECURTIMEFROM_DAYSFROM_UNIXTIMENOWPASSWORDPERIOD_ADDPER > IOD_DIFFTO_DAYSUSERWEEKDAYRAND > wwid varchar(16) > ASCIICHARSOUNDEXCURDATECURTIMEFROM_DAYSFROM_UNIXTIMENOWPASSWORDPERIOD_ADDPER > IOD_DIFFTO_DAYSUSERWEEKDAYRAND > > > > > > > > > Rgds > > > Henrik > > -- 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] How to Replace the table data
I don;t know why it's still not working. I tried it with smaller table and it works. but when I tried with my real table, it's not working I use this : UPDATE posts SET post_text='IMG SRC=" > wrote: > > >> its not working because it's not a variable (url) >> it's a text field > >'url' is the name of the field which contains "http://something.com/";. >Replace it with the name of the field in *your* table which contains >"http://something.com/";. > >BTW as Terry pointed out (I misread your question) the update query should >be: > >UPDATE table SET url='http://something.com/target' WHERE >url='http://www.something.com/' > >regards >-- >Jason Wong >Gremlins Associates >www.gremlins.com.hk >Tel: +852-2573-5033 >Fax: +852-2573-5851 _ www.kaskus.com - FREE EMAIL SERVICE -- 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] How to Replace the table data
FYI : POST_TXT = text field & Not null = YES --- Nagasea <[EMAIL PROTECTED]> > wrote: >I don;t know why it's still not working. >I tried it with smaller table and it works. >but when I tried with my real table, it's not working > >I use this : >UPDATE posts SET post_text='IMG SRC=" >FYI : posts_text = text field (NOT NULL=YES) > > > > >--- "Jason Wong" <[EMAIL PROTECTED]> >> wrote: >> >> >>> its not working because it's not a variable (url) >>> it's a text field >> >>'url' is the name of the field which contains "http://something.com/";. >>Replace it with the name of the field in *your* table which contains >>"http://something.com/";. >> >>BTW as Terry pointed out (I misread your question) the update query should >>be: >> >>UPDATE table SET url='http://something.com/target' WHERE >>url='http://www.something.com/' >> >>regards >>-- >>Jason Wong >>Gremlins Associates >>www.gremlins.com.hk >>Tel: +852-2573-5033 >>Fax: +852-2573-5851 > >_ >www.kaskus.com - FREE EMAIL SERVICE > >-- >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] _ www.kaskus.com - FREE EMAIL SERVICE -- 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] Re: Looking for alternative to phpMyAdmin for data entry
Hello Henrik, Friday, September 14, 2001, 9:42:13 AM, you wrote: HL> Dear Newsgroup HL> I am looking for an alternative to phpmyAdmin thatwill generate clumsy entry HL> screens that allows you to select data type for each field (makes litle HL> sence to me). HL> Database it - table san_port HL> Field Type Function Value HL> san varchar(20) HL> ASCIICHARSOUNDEXCURDATECURTIMEFROM_DAYSFROM_UNIXTIMENOWPASSWORDPERIOD_ADDPER HL> IOD_DIFFTO_DAYSUSERWEEKDAYRAND HL> port varchar(20) HL> ASCIICHARSOUNDEXCURDATECURTIMEFROM_DAYSFROM_UNIXTIMENOWPASSWORDPERIOD_ADDPER HL> IOD_DIFFTO_DAYSUSERWEEKDAYRAND HL> wwid varchar(16) HL> ASCIICHARSOUNDEXCURDATECURTIMEFROM_DAYSFROM_UNIXTIMENOWPASSWORDPERIOD_ADDPER HL> IOD_DIFFTO_DAYSUSERWEEKDAYRAND HL> Rgds HL> Henrik mascon 'nuff said http://www.scibit.com best dam prog out there -- Best regards, Jacobmailto:[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] Sybase CT with/without Sybase ASE
You don't need the Sybase dataserver but you still need the Sybase shared libraries that PHP is linked against. So restore all the .so's in $SYBASE/lib, and apache should start. Offhand, I'm not sure if 12.5 came with a different version of the open client libraries than 11.9.2 did, but if it did you may need to keep the 11.9.2 libs around. Dean At 12:49 PM 14/09/01 +0200, Carlo Borreo wrote: >Dear All, >In the past I had installed an Apache server with PHP 4.0.6 and Sybase CT >extension on Mandrake Linux 8, all ok. >On the Mandrake machine, I had installed Sybase ASE 11.9.2, that was only >used for test; most of the time the php code used sybase ct lib to refer to >another database server (Sybase ASE 12.5 on Solaris), and all worked. >But now I tried to update the test Sybase ASE database server on Mandrake >from 11.9.2 from 12.5. I was not successful, but I could live without test >database, so I didn't worry. But at next reboot, Apache was failing to start >with this message: > >Syntax error on line 205 of /usr/local/apache/conf/httpd.conf: >Cannot load /usr/local/apache/libexec/libphp4.so into server: libinsck.so: >cannot load shared object file: No such file or directory >/etc/init.d/httpd start: httpd could not be started > >The file libphp4.so is in place, but file libinschk.so is not on the >machine. >I thought that PHP and sybase ct didn't need a database server to be >installed on the machine; was I wrong? >I also tried uninstalling completely 12.5, but still Apache doesn't start. >As I said, I can live without that database server, but I need Apache, Php, >and Sybase ct, please help. > >Thanks in advance >Carlo Borreo > > > > >-- >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] string problem
scenario: Win.nt 4.0 pach6a Workstation, IE 5.5, Apache/1.3.20, php 4.0.6 wath goes wrong: when I set a string variable containing by example : " hello "jack" " on my html page php convert it to " hello \"jack\" " and I get no errors on another machine with same configuration I get " hello "jack" " without quoting any Ideas? TIA -- 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] Replace into
Hi! In mySql you can do: replace into tbl_name values(value_1, value_2) does it work for Oracle aswell? Can anybody provide me with a link to a GOOD Oracle syntax reference. Oracle needs serious help with their documentation...:-( Regards /Robert -- 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] currency out of postgresql
I am trying to get two currency values from out of the database, add them together and print the to the screen. I am using the following code. $money = $myrow[6] + $myrow[7]; $formatted = sprintf("%01.2f", $money); printf ("%01.2f\n", $formatted); $myrow[] is the array that I load the database records into. I can echo $myrow[6] & $myrow[7], which will show like $4.00 and $4000.00. But when I add them together the come out as 0 every time. The columns in the database are of type money. This is a postgresql database. Does any one see the errors of my ways? thanks, Rick Eicher II www.pbol.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]
Re: [PHP-DB] currency out of postgresql
> $formatted = sprintf("%01.2f", $money); > printf ("%01.2f\n", $formatted); maybe twice, try: $formatted = sprintf("%01.2f", $money); echo "$formatted\n"; - Original Message - From: "Rick Eicher II" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 14, 2001 6:48 PM Subject: [PHP-DB] currency out of postgresql > I am trying to get two currency values from out of the database, add them > together and print the to the screen. I am using the following code. > > $money = $myrow[6] + $myrow[7]; > $formatted = sprintf("%01.2f", $money); > printf ("%01.2f\n", $formatted); > > $myrow[] is the array that I load the database records into. > > I can echo $myrow[6] & $myrow[7], which will show like $4.00 and $4000.00. > But when I add them together the come out as 0 every time. The columns in > the database are of type money. This is a postgresql database. > > Does any one see the errors of my ways? > > thanks, > Rick Eicher II > www.pbol.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 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] string problem
Don't know why you're getting problem. However, you can use stripslashes() to avoid the problem. -Original Message- From: Bruno Franx [mailto:[EMAIL PROTECTED]] Sent: Friday, September 14, 2001 10:04 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] string problem scenario: Win.nt 4.0 pach6a Workstation, IE 5.5, Apache/1.3.20, php 4.0.6 wath goes wrong: when I set a string variable containing by example : " hello "jack" " on my html page php convert it to " hello \"jack\" " and I get no errors on another machine with same configuration I get " hello "jack" " without quoting any Ideas? TIA -- 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] string problem
There's an option in php.ini: magic_quotes_gpc = On/Off; If on, any GET, POST, and Cookie data will come back with \ marks before ' and " marks. Guesing one server has it set to Off, and one set to On. 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 On Fri, 14 Sep 2001, Rick Emery wrote: > Don't know why you're getting problem. However, you can use stripslashes() > to avoid the problem. > > -Original Message- > From: Bruno Franx [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 14, 2001 10:04 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] string problem > > > scenario: Win.nt 4.0 pach6a Workstation, IE 5.5, Apache/1.3.20, php 4.0.6 > wath goes wrong: when I set a string variable containing by example : " > hello "jack" " > on my html page php convert it to " hello \"jack\" " and I get no > errors > on another machine with same configuration I get > " hello "jack" " without quoting > any Ideas? > TIA > > > > -- > 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-DB] Another Image prob
I'm new at this and i'm sure that this has been answered before, but anyway... I am trying to retrieve images from a MySQL database. They are stored as BLOBs with the following table format: Database metonym_metonym - table imgs Field TypeAttributes NullDefault Extra fk_proj_id int(3) No 0 imgname varchar(30) imgtype varchar(20) img blob Keyname Unique Field PRIMARY Yes fk_proj_id Is it possible to do this with a printf/ img src statement? Also, I have heard some talk about header information on retrieval-> how does this relate to retrieving an image? Bear in mind that these images are being uploaded via HTML form Thanks in advance METONYM -- -- 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] Another Image prob
The consensus is that it is best if you DO NOT store the images as blobs in a database. Rather, store the images in separate files and store the names of those files in the database. Then retrieve the file names for the database, open the image files, and then send the images to the client's browser. Storing images as blobs tends to make the database unwieldy. -Original Message- From: Todd Moy [mailto:[EMAIL PROTECTED]] Sent: Friday, September 14, 2001 1:46 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Another Image prob I'm new at this and i'm sure that this has been answered before, but anyway... I am trying to retrieve images from a MySQL database. They are stored as BLOBs with the following table format: Database metonym_metonym - table imgs Field TypeAttributes NullDefault Extra fk_proj_id int(3) No 0 imgname varchar(30) imgtype varchar(20) img blob Keyname Unique Field PRIMARY Yes fk_proj_id Is it possible to do this with a printf/ img src statement? Also, I have heard some talk about header information on retrieval-> how does this relate to retrieving an image? Bear in mind that these images are being uploaded via HTML form Thanks in advance METONYM -- -- 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] currency out of postgresql
After I do the add $money comes out to be 0. The data comes out as $0 and $5,217.00, I need to add these two to get $5,217.00. How do you add money with the dollor sign in the data? rick -Original Message- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Friday, September 14, 2001 7:24 AM To: Rick Eicher II Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] currency out of postgresql > $formatted = sprintf("%01.2f", $money); > printf ("%01.2f\n", $formatted); maybe twice, try: $formatted = sprintf("%01.2f", $money); echo "$formatted\n"; - Original Message - From: "Rick Eicher II" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 14, 2001 6:48 PM Subject: [PHP-DB] currency out of postgresql > I am trying to get two currency values from out of the database, add them > together and print the to the screen. I am using the following code. > > $money = $myrow[6] + $myrow[7]; > $formatted = sprintf("%01.2f", $money); > printf ("%01.2f\n", $formatted); > > $myrow[] is the array that I load the database records into. > > I can echo $myrow[6] & $myrow[7], which will show like $4.00 and $4000.00. > But when I add them together the come out as 0 every time. The columns in > the database are of type money. This is a postgresql database. > > Does any one see the errors of my ways? > > thanks, > Rick Eicher II > www.pbol.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 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] currency out of postgresql
I suppose you could just remove the $ and/or the comma with a regexp... www.php.net/eregi_replace -- David Balatero - Original Message - From: "Rick Eicher II" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 14, 2001 3:00 PM Subject: [PHP-DB] currency out of postgresql > After I do the add $money comes out to be 0. The data comes out as $0 and > $5,217.00, I need to add these two to get $5,217.00. How do you add money > with the dollor sign in the data? > > rick > > -Original Message- > From: Bas Jobsen [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 14, 2001 7:24 AM > To: Rick Eicher II > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] currency out of postgresql > > > > $formatted = sprintf("%01.2f", $money); > > printf ("%01.2f\n", $formatted); > > maybe twice, try: > $formatted = sprintf("%01.2f", $money); > echo "$formatted\n"; > > > - Original Message - > From: "Rick Eicher II" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, September 14, 2001 6:48 PM > Subject: [PHP-DB] currency out of postgresql > > > > I am trying to get two currency values from out of the database, add them > > together and print the to the screen. I am using the following code. > > > > $money = $myrow[6] + $myrow[7]; > > $formatted = sprintf("%01.2f", $money); > > printf ("%01.2f\n", $formatted); > > > > $myrow[] is the array that I load the database records into. > > > > I can echo $myrow[6] & $myrow[7], which will show like $4.00 and $4000.00. > > But when I add them together the come out as 0 every time. The columns in > > the database are of type money. This is a postgresql database. > > > > Does any one see the errors of my ways? > > > > thanks, > > Rick Eicher II > > www.pbol.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 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] currency out of postgresql
While the proposed solution below may very well indeed work for this situation it's a far better practice to strip the variable down to "known to be good" values rather than "known to be bad" ones. Rather than strip $ and , marks from the variable it's far better to strip out anything other than 0-9 and the '.' character. In this given situation it may or may not have any advantage -- just a different paradigm; and one that often improves application security. Rather than think of what's disallowed think only of what is allowed. A "recent" example of this would be to follow the BugTraq postings on the Unicode directory transversal exploits of MS IIS toward the latter end of 2000. The patch was released to prevent certain attacks from coming through but it proved to be patch developed by somebody with rather elementary security skills. They preventyed only -known- attacks from working; workarounds surfaced within a day, if not hours. Eventually they put a competent coder on the job and things were fixed. But, like I said, this probably isn't a security issue here -- just one of robustness. The two are rather similar in practice though. As I said before, the original poster's idea may very well work 100% of the time, but I thought I'd take the opportunity to point out the difference. I posted a private reply to the orignal author that went something like this: Strip out anything except 0-9 characters (after formatting), add them, divide by 100 and reformat. I don't imagine any locale settings that would cause this to error. I don't mean to nit-pick at anybody here, that's my last objective. Just something to think about when coding. Admittedly I've done the exact opposite approach (stripping known bad vs. allowing known good) many times and have been burned because of it. 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 On Fri, 14 Sep 2001, David Balatero wrote: > I suppose you could just remove the $ and/or the comma with a regexp... > www.php.net/eregi_replace -- 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] How to Replace the table data
> I don;t know why it's still not working. > I tried it with smaller table and it works. > but when I tried with my real table, it's not working When you say it's not working do you mean nothing was updated? Or there was an error message? If so what was the error? Have you tried running the same query using the mysql client? > I use this : > UPDATE posts SET post_text='IMG SRC=" > FYI : posts_text = text field (NOT NULL=YES) -- Jason Wong Gremlins Associates www.gremlins.com.hk Tel: +852-2573-5033 Fax: +852-2573-5851 -- 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] How to Replace the table data
no it's working (successed), but nothing was updated. I tried to make a fake table. when i tried to make a fake table its working. i tried to change "ABC" from the table to "XXX" but if i got data called ABCD , it didnt change to XXXD why ? --- "Jason Wong" <[EMAIL PROTECTED]> > wrote: > > >> I don;t know why it's still not working. >> I tried it with smaller table and it works. >> but when I tried with my real table, it's not working > >When you say it's not working do you mean nothing was updated? Or there was >an error message? If so what was the error? Have you tried running the same >query using the mysql client? > >> I use this : >> UPDATE posts SET post_text='IMG SRC="SRC="/serv2/big/forum/images/smiles' WHERE post_text='SRC="/gmns/BB/images/smiles' >> >> FYI : posts_text = text field (NOT NULL=YES) > >-- >Jason Wong >Gremlins Associates >www.gremlins.com.hk >Tel: +852-2573-5033 >Fax: +852-2573-5851 > > > > >-- >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] _ www.kaskus.com - FREE EMAIL SERVICE -- 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] Another Image prob
Don't think that was the answer he was looking for =]. Here's how I retrieve images stored as blobs. $query = "select File, Type from Pictures_Data where id=$id"; $result = mysql_query($query); $data = mysql_result($result, 0, "File"); $type = mysql_result($result, 0, "Type"); Header( "Content-type: image/$type"); echo "$data"; Btw, if you are going to be storing a large number of pictures or other binary files as blobs, try to put them in their own table. I original had one table with miscellanous information in it as well as the blobs, and it did get slow on certain queries. Creating two tables with the records linked via id solved the problem. Regarding the post about storing blobs in databases. I agree that in days past that it was not a good idea to do such because it does have a serious impact on database performance. However, has anyone been paying attention to the cost of hardware these days? Anyone with a serious project should have plenty of money to throw hardware at the problem. Perhaps not elegant, but I think performance and ease will beat elegant any day of the week. My personal preference for storing images as blobs is that it makes the syncing of my servers much easier. Rather than using MySQL replication and rsync to keep the same content on my servers, I can simply use MySQL replication and not have to worry about my image data and the image being out of sync. Course perhaps a dedicated machine to store the images served to multiple frontend servers via NFS might work better, but again, performance has been sufficient so far in my experience that I'm not worried about it. I would be interested in other's thoughts on how to best tackle the problem in a multiple server situation. HTH -- Barry Jeung Team Lynx, Inc. Senior System Engineer 1217 Montgomery Avenue http://www.TeamLynx.com Second Floor E-Mail: [EMAIL PROTECTED] San Bruno, CA 94066-1521 Phone: 650.589.3200 Fax: 650.589.2555 > -Original Message- > From: Rick Emery [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 14, 2001 10:58 AM > To: [EMAIL PROTECTED] > Subject: RE: [PHP-DB] Another Image prob > > > The consensus is that it is best if you DO NOT store the > images as blobs in > a database. Rather, store the images in separate files and > store the names > of those files in the database. Then retrieve the file names for the > database, open the image files, and then send the images to > the client's > browser. Storing images as blobs tends to make the database unwieldy. > > -Original Message- > From: Todd Moy [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 14, 2001 1:46 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Another Image prob > > > I'm new at this and i'm sure that this has been answered before, but > anyway... > I am trying to retrieve images from a MySQL database. They > are stored as > BLOBs with the following table format: > > Database metonym_metonym - table imgs > Field TypeAttributes NullDefault Extra > fk_proj_idint(3) No 0 > imgname varchar(30) > imgtype varchar(20) > img blob > > Keyname Unique Field > PRIMARY Yes fk_proj_id > > Is it possible to do this with a printf/ img src statement? > Also, I have heard some talk about header information on > retrieval-> how > does this relate to retrieving an image? > > Bear in mind that these images are being uploaded via HTML form > Thanks in advance > METONYM > > -- > > -- > 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] How to Replace the table data
> no it's working (successed), but nothing was updated. > I tried to make a fake table. > when i tried to make a fake table its working. > i tried to change "ABC" from the table to "XXX" > but if i got data called ABCD , it didnt change to XXXD > why ? *Now* I know what you're trying to do. The UPDATE query given previously: UPDATE table set field='XXX' WHERE field='YYY' competely replaces the *whole* field. What you want is something that replaces *part* of the field. Off hand I can't think of a way to use a single SQL query to do what you want. You may want to look at the string functions of MySql to see whether they will help: http://www.mysql.com/doc/S/t/String_functions.html regards -- Jason Wong Gremlins Associates www.gremlins.com.hk Tel: +852-2573-5033 Fax: +852-2573-5851 -- 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] Persistent Links and Temporary Tables
Hi, Is anyone able to briefly explain to me how the use of temporary tables by MySQL is affected by PHPs persistent connections? From my reading of MySQL temp tables are deleted when the current connection is closed, but that might not be for quite a long time with a persistent connection... also, how does this affect concurrency of temp table creation? Robert Robert Gormley [EMAIL PROTECTED] http://seabreeze.asn.au/ -- 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]