Re: [PHP-DB] newbie having problem
Jason, Having tried your suggestion, I see that I can connect to the server but cannot select the db. Where do I go from here? George - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 03, 2001 4:39 PM Subject: Re: [PHP-DB] newbie having problem - Original Message - From: George Pitcher [EMAIL PROTECTED] To: Torgil Zechel [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, September 03, 2001 11:19 PM Subject: Re: [PHP-DB] newbie having problem if( $result == FALSE ) { echo mysql_error(); } Yes - progress - its telling me that no database was selected. My code again: ?php mysql_connect ('pingu','root@localhost',''); mysql_select_db ('Bizplanes'); if ($Serial == ) {$Serial = '%';} if ($Type == ) {$Type = '%';} if ($Con == ) {$Con = '%';} $result=mysql_query (SELECT * FROM biz WHERE ID LIKE '%$Serial%' AND Type LIKE '%$Type%' Con LIKE '%$Con%' ORDER BY ID); ? You haven't specified a password when connecting to the server -- does it require one? Have you tried the code as per manual: $link = mysql_connect(mysql_host, mysql_login, mysql_password) or die (Could not connect); print (Connected successfully); mysql_select_db (my_database) or die (Could not select database); to ensure that you *are* able to connect to the server and also *select* the database? hth -- 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] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.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]
Re: [PHP-DB] newbie having problem
Oops, I forgot to say that I can handle this db as a client on the command line and it shows up under mysqlshow. George - Original Message - From: George Pitcher [EMAIL PROTECTED] To: Jason Wong [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, September 05, 2001 7:46 AM Subject: Re: [PHP-DB] newbie having problem Jason, Having tried your suggestion, I see that I can connect to the server but cannot select the db. Where do I go from here? George - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 03, 2001 4:39 PM Subject: Re: [PHP-DB] newbie having problem - Original Message - From: George Pitcher [EMAIL PROTECTED] To: Torgil Zechel [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, September 03, 2001 11:19 PM Subject: Re: [PHP-DB] newbie having problem if( $result == FALSE ) { echo mysql_error(); } Yes - progress - its telling me that no database was selected. My code again: ?php mysql_connect ('pingu','root@localhost',''); mysql_select_db ('Bizplanes'); if ($Serial == ) {$Serial = '%';} if ($Type == ) {$Type = '%';} if ($Con == ) {$Con = '%';} $result=mysql_query (SELECT * FROM biz WHERE ID LIKE '%$Serial%' AND Type LIKE '%$Type%' Con LIKE '%$Con%' ORDER BY ID); ? You haven't specified a password when connecting to the server -- does it require one? Have you tried the code as per manual: $link = mysql_connect(mysql_host, mysql_login, mysql_password) or die (Could not connect); print (Connected successfully); mysql_select_db (my_database) or die (Could not select database); to ensure that you *are* able to connect to the server and also *select* the database? hth -- 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] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.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] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.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]
RE: [PHP-DB] How can you hide database login passwd in your script?
$0 option: Put your user ID and password in a config file, then give only the webserver user access to it. Read the config file to make it work. This also allows easy switching between test and production environments. You can't change the group owner of a file unless you have root. That does not stop another php user fopen'ing your config file. -- 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 - Linux and Sql Anywhere 5.5
Is it possible to have Sybase Sql Anywhere 5.5 database server on windows nt and client on Linux and how? Thanks Boris -- 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 can you hide database login passwd in yourscript?
At 6:22 PM +1000 9/5/01, speedboy wrote: $0 option: Put your user ID and password in a config file, then give only the webserver user access to it. Read the config file to make it work. This also allows easy switching between test and production environments. You can't change the group owner of a file unless you have root. That does not stop another php user fopen'ing your config file. If your creating a config file, first always include .php or .php3 as part of the name, this means that if someone tries to directly access the file using a web browser the file compiles and prints as blank. Secondly, references to the config file should be placed after the html and before the head tags so even if the page breaks the path to file is never shown to the user. Additionally, if you like and your host is set-up for it, you can store config files and other includes in the (data) folder of your website. Many ISPs offer set-ups that include an (html), (data), (scripts), and (log) folder. The benefit of using a data folder is that it is inaccessible to anyone trying to access it without root permission. Files located in the (data) folder generally must be specified using the path_to_file method ( /myISP/theirHostArea/myUserName/data/) Generally speaking, the first two methods are secure enough. If a PHP user does guess the correct path to you config file, they generally can not access it using the http://www.yoursite.com/include/config.inc.php method, since the file pre-compiles as blank or empty. This means that they would need to gain root privileges to read the file as text. The data folder provides a nice extra layer of security, pretty much insuring that the file can't be called using the http:// method at all since its outside of your web root. Alnisa -- . Alnisa Allgood Executive Director Nonprofit Tech (ph) 415.337.7412 (fx) 415.337.7927 (url) http://www.nonprofit-techworld.org (url) http://www.nonprofit-tech.org (url) http://www.tech-library.org . Nonprofit Tech E-Update mailto:[EMAIL PROTECTED] . applying technology to transform . -- 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: Searching a table
Hi Devon! Take a look in the function reference to mysql functions of PHP. There are functions to connect to the mysql database and requesting datas with SQL queries. You need knowlege on SQL to use it. There are example too. bye Marcus Devon [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a database in mysql that only has one table, that table has approx 25 fields . I need to be able to search for data under each of these fields. Field examples: Company, TechContact, AdminContact, Mobile etc etc I need I guess a pull down menu that would select a field (c above) then be able to search under each field, as in search for company name, or mobile number etc etc. As of yet I cant get my search working ... does any one have any sample code or any suggestion? Any help would be amazing . if you have an answer post on here or write to me at work [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
Hi I'm trying to insert a text into a MYSQL DB, and here is the problem. If the text looks like this x xx x x xxx 'xxx xxx then PHP interprets the text following the ' as an sql statement. Does anyone know how to overcome this problem. Thank you Shimon -- 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 mysql
Hi I'm trying to insert a text into a MYSQL DB, and here is the problem. If the text looks like this x xx x x xxx 'xxx xxx then PHP interprets the text following the ' as an sql statement. Does anyone know how to overcome this problem. Thank you Shimon -- 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
Have a look at addslashes http://www.php.net/manual/en/function.addslashes.php Miles At 01:20 PM 9/5/01 +0200, shi wrote: Hi I'm trying to insert a text into a MYSQL DB, and here is the problem. If the text looks like this x xx x x xxx 'xxx xxx then PHP interprets the text following the ' as an sql statement. Does anyone know how to overcome this problem. Thank you Shimon -- 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] 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? -- 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: postgresql groups and users
Michiel Lange [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 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) ^^^ 1 to many. 1 n. That works, but how do I let php find out if a user is a member of a certain group? do a select . i'm assuming that you post the user id into the groups tables. select * from goups where group_id=7 and user_id=1; if the query returns any results then you have a match. so : $numrows=pg_numrows($query); if ($numrows0){printYou have a matchbr;} Steve -- 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] webpage counters
Hi: I have two types of counters in my web site and I would like to know which one is better. a) the first one using a field in mysql table and updating it each time a visitor hits the page. b) the second one using a plaint text file using code like this: ? $counter_file = counterfile.txt; $linecounter = file($counter_file); $linecounter[0]++; $cf = fopen($counter_file, w); fputs($cf, $linecounter[0]); fclose($cf); echo $linecounter[0]; ? in this case i had to change the permission of the file to: chmod 666 counterfile.txt My questions are: 1. Which is more efficient in terms of time, i.e. accessing a database or accessing a text file? 2. is the second counter secure? is there a possibility that the file counterfile.txt (with those permissions) can be used as a insecure door to my web server? Thanks in advance for your help. _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.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]
Re: [PHP-DB] How can you hide database login passwd in yourscript?
That does not stop another php user fopen'ing your config file. This is a point that needs to be stressed. The other posts about keeping db connection info outside of the web tree and naming the files .php are good ones, but even with them, there can be major security problems on a shared virtual host, which many / most hosting providers provide. For example, a malicious user gets an account on a shared host with PHP (probably Perl, too) installed. They then do an fopen on the /etc/passwd file to see which users are on the machine and where their directories are. If shadow passwords aren't used, they also get the encrypted password. With that knowledge they can use the standard PHP directory commands like dir to get a listing of all the files in a user's home directory and then they can fopen whichever one they'd like. In these setups, the same user (nobody, www, etc.) has read access to all of these files. If it didn't, you script wouldn't work. Once a user finds a password for a mysql database, they can just: DROP database_name or DELETE FROM table_name Possible solutions: 1) Run your own server (not possible in many cases) 2) Run php in safe mode (something a hosting provider must do, will break some/many apps) 3) Make sure that your mysql users have only the necessary permissions, i.e., don't give the user insert/update/delete privs if they only need to SELECT. 4) Don't store sensitive data in databases on shared servers. 5) Backup everything from databases regularly and hope you never really need to use them. Hope that helps. Sincerely, Paul Burney ++ Paul Burney Webmaster Open Source Developer UCLA - GSEIS - ETU (310) 825-8365 [EMAIL PROTECTED] http://www.gseis.ucla.edu/ ++ -- 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 can you hide database login passwd in your script?
Another solution is DO NOT store passwords and usernames in the database file. Rather, store a hash of the password and username using the php MD5() function. Something like: $username = $HTTP_POST_VARS['user']; # from FORM page $password = $HTTP_POST_VARS['pw']; # from FORM page $hash = md5($username.$password); $query = SELECT * FROM usertable WHERE hash=$hash; $result = mysql_query($query) or die(Error); if( mysql_num_rows($result) != 1 ) { die(Error - User does not exist); exit }; Previously, when setting up the user account, you did the following: $username = $HTTP_POST_VARS['user']; # from FORM page $password = $HTTP_POST_VARS['pw']; # from FORM page $hash = md5($username.$password); $query = INSERT INTO usertable (hash) VALUES($hash); mysql_query($query); rick -Original Message- From: Paul Burney [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 05, 2001 8:56 AM To: PHP Database List Subject: Re: [PHP-DB] How can you hide database login passwd in your script? That does not stop another php user fopen'ing your config file. This is a point that needs to be stressed. The other posts about keeping db connection info outside of the web tree and naming the files .php are good ones, but even with them, there can be major security problems on a shared virtual host, which many / most hosting providers provide. For example, a malicious user gets an account on a shared host with PHP (probably Perl, too) installed. They then do an fopen on the /etc/passwd file to see which users are on the machine and where their directories are. If shadow passwords aren't used, they also get the encrypted password. With that knowledge they can use the standard PHP directory commands like dir to get a listing of all the files in a user's home directory and then they can fopen whichever one they'd like. In these setups, the same user (nobody, www, etc.) has read access to all of these files. If it didn't, you script wouldn't work. Once a user finds a password for a mysql database, they can just: DROP database_name or DELETE FROM table_name Possible solutions: 1) Run your own server (not possible in many cases) 2) Run php in safe mode (something a hosting provider must do, will break some/many apps) 3) Make sure that your mysql users have only the necessary permissions, i.e., don't give the user insert/update/delete privs if they only need to SELECT. 4) Don't store sensitive data in databases on shared servers. 5) Backup everything from databases regularly and hope you never really need to use them. Hope that helps. Sincerely, Paul Burney ++ Paul Burney Webmaster Open Source Developer UCLA - GSEIS - ETU (310) 825-8365 [EMAIL PROTECTED] http://www.gseis.ucla.edu/ ++ -- 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] RE: bizarre ocilogon problem
Are you running out of logons? You should only need the client libraries on the machine with the PHP pages. You do not need them anywhere else. (That's the beauty of the web!) Make sure you have ocilogoff in your PHP page when you're done. Even better (for performance reasons) create a session. Then ONLY the first time that any of your pages load, run your ocilogon. After that just reuse the logon. From then on, just make a new statement everytime you need to query the database. Lastly, when I used PHP/Apache/Linux to talk to Oracle/NT4, I was getting stray defunct oracle processes hanging around on my Linux box. The effect was that pages would work from one client PC, but not from another. I think everytime I created a connection, it created the process. The only way I could find to get around that was to recompile PHP with --enable-sigchild. This is PHP's own signal handler and it will clean up the stray oracle processes. Good luck, Brian -Original Message- From: Galvin, Max [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 04, 2001 10:07 AM To: '[EMAIL PROTECTED]' Subject: bizarre ocilogon problem Hi, I have a page that retrieves info from an Oracle database and which works fine when I view it. When I switch to another PC with the same OS/browser (NT/IE5) I get an error: call to unsupported or undefined function ocilogon() We have the client libs installed but it's only on one or two machines that this fails. Any ideas why? Cheers Max -- 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: PHP and Fox Pro (ADODB) question
Hello, You need to configure an ODBC DSN that accesses the foxpro database. Assume the DSN is called foxy. Then download from http://php.weblogs.com/adodb the library. Sample code: include('adodb.inc.php'); include('tohtml.inc.php'); $conn = ADONewConnection('vfp'); $conn-PConnect('foxy'); $rs = $conn-Execute('select * from table'); rs2html($rs); /* recordset to html table */ John Lim PS: This only works on Windows. Er GalvãO Abbott [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Greetings I'm a newbie but I've been doing very nice thing with PHP. Now a challenge appeared and I'm kinda lost and in need of some help. I have a project that I have to make search and display routines in a Fox Pro database. Everything was wonderful because almost all data I've needed was stored in DBF files and PHP Dbase functions were handling this very well. Now I've found that a piece of data that is extremely important to the application is in a FPT file. I saw a thread here that recommends the use of the ADODB library for PHP that can be found at http://php.weblogs.com/ADODB Well, what I need, hoping that I'm not asking too much is if there is anyone hre that can give me a practical example - maybe a code snip - on how to achieve this. Any help will be gratefully appreciated. Thanks in advance, -- 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: insert problem mysql
Use $s = addslashes($s); Shi [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi I'm trying to insert a text into a MYSQL DB, and here is the problem. If the text looks like this x xx x x xxx 'xxx xxx then PHP interprets the text following the ' as an sql statement. Does anyone know how to overcome this problem. Thank you Shimon -- 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: insert problem mysql
Thanks Shimon John Lim [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Use $s = addslashes($s); Shi [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi I'm trying to insert a text into a MYSQL DB, and here is the problem. If the text looks like this x xx x x xxx 'xxx xxx then PHP interprets the text following the ' as an sql statement. Does anyone know how to overcome this problem. Thank you Shimon -- 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: PHP and Fox Pro (ADODB) question
Is it possible to do it on Linux servers? On Wed, 5 Sep 2001 23:39:09 +0800, [EMAIL PROTECTED] (John Lim) wrote: Hello, You need to configure an ODBC DSN that accesses the foxpro database. Assume the DSN is called foxy. Then download from http://php.weblogs.com/adodb the library. Sample code: include('adodb.inc.php'); include('tohtml.inc.php'); $conn = ADONewConnection('vfp'); $conn-PConnect('foxy'); $rs = $conn-Execute('select * from table'); rs2html($rs); /* recordset to html table */ John Lim PS: This only works on Windows. Er GalvãO Abbott [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Greetings I'm a newbie but I've been doing very nice thing with PHP. Now a challenge appeared and I'm kinda lost and in need of some help. I have a project that I have to make search and display routines in a Fox Pro database. Everything was wonderful because almost all data I've needed was stored in DBF files and PHP Dbase functions were handling this very well. Now I've found that a piece of data that is extremely important to the application is in a FPT file. I saw a thread here that recommends the use of the ADODB library for PHP that can be found at http://php.weblogs.com/ADODB Well, what I need, hoping that I'm not asking too much is if there is anyone hre that can give me a practical example - maybe a code snip - on how to achieve this. Any help will be gratefully appreciated. Thanks in advance, -- 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: PHP and Fox Pro (ADODB) question
Best is to port the database to mysql then. Regards, John Er GalvãO Abbott [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is it possible to do it on Linux servers? On Wed, 5 Sep 2001 23:39:09 +0800, [EMAIL PROTECTED] (John Lim) wrote: Hello, You need to configure an ODBC DSN that accesses the foxpro database. Assume the DSN is called foxy. Then download from http://php.weblogs.com/adodb the library. Sample code: include('adodb.inc.php'); include('tohtml.inc.php'); $conn = ADONewConnection('vfp'); $conn-PConnect('foxy'); $rs = $conn-Execute('select * from table'); rs2html($rs); /* recordset to html table */ John Lim PS: This only works on Windows. Er GalvãO Abbott [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Greetings I'm a newbie but I've been doing very nice thing with PHP. Now a challenge appeared and I'm kinda lost and in need of some help. I have a project that I have to make search and display routines in a Fox Pro database. Everything was wonderful because almost all data I've needed was stored in DBF files and PHP Dbase functions were handling this very well. Now I've found that a piece of data that is extremely important to the application is in a FPT file. I saw a thread here that recommends the use of the ADODB library for PHP that can be found at http://php.weblogs.com/ADODB Well, what I need, hoping that I'm not asking too much is if there is anyone hre that can give me a practical example - maybe a code snip - on how to achieve this. Any help will be gratefully appreciated. Thanks in advance, -- 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] implementing php with IBM branded apache
We are using the IBM branded apache on an rs6k. I would like to add php functionality. Is there some way to add the php module? As I understand it, I can still use php it just won;t be compiled into apache ??? marc grober -- 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] implementing php with IBM branded apache
What OS are you running on it? I've used php on an rs6000 while at IBM. worked fine, I didn't install it tho, but I don't think they had any problems. HTH, Tom - Original Message - From: Marc Grober [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, September 05, 2001 6:09 PM Subject: [PHP-DB] implementing php with IBM branded apache We are using the IBM branded apache on an rs6k. I would like to add php functionality. Is there some way to add the php module? As I understand it, I can still use php it just won;t be compiled into apache ??? marc grober -- 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] ODBC and SQL Server
I am trying to setup an ODBC connect to SQL Server. My DSN is Acct32_ODBC. I am using NT Authentication, so that could be my problem. odbc_connect(Acct32_ODBC, , ); Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'PENTIUM3\IUSR_PENTIUM3'., SQL state 28000 in SQLConnect in C:\Webroot\testodbc.php on line 33 Any suggestions on how I can resolve this? Many thanks. Todd -- Todd Cary Ariste Software [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] Re: PHP and Fox Pro (ADODB) question
I'd *mildly* disagree with that suggestion - is this a VFP database or 2.x? Are sub-selects used extensively? Do you need stored procedures? If so, PostgreSQL may be a better choice. If it's 2.x, simple joins, sure, MySQL is fine. Miles Thompson At 12:53 AM 9/6/01 +0800, John Lim wrote: Best is to port the database to mysql then. Regards, John Er GalvãO Abbott [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is it possible to do it on Linux servers? On Wed, 5 Sep 2001 23:39:09 +0800, [EMAIL PROTECTED] (John Lim) wrote: Hello, You need to configure an ODBC DSN that accesses the foxpro database. Assume the DSN is called foxy. Then download from http://php.weblogs.com/adodb the library. Sample code: include('adodb.inc.php'); include('tohtml.inc.php'); $conn = ADONewConnection('vfp'); $conn-PConnect('foxy'); $rs = $conn-Execute('select * from table'); rs2html($rs); /* recordset to html table */ John Lim PS: This only works on Windows. Er GalvãO Abbott [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Greetings I'm a newbie but I've been doing very nice thing with PHP. Now a challenge appeared and I'm kinda lost and in need of some help. I have a project that I have to make search and display routines in a Fox Pro database. Everything was wonderful because almost all data I've needed was stored in DBF files and PHP Dbase functions were handling this very well. Now I've found that a piece of data that is extremely important to the application is in a FPT file. I saw a thread here that recommends the use of the ADODB library for PHP that can be found at http://php.weblogs.com/ADODB Well, what I need, hoping that I'm not asking too much is if there is anyone hre that can give me a practical example - maybe a code snip - on how to achieve this. Any help will be gratefully appreciated. Thanks in advance, -- 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] ODBC and SQL Server
Well, does the Test button on your ODBC Admininstrator shed any light? :) If it works there, and doesn't work in your PHP, create an ODBC Trace in the Administrator so you can see the exact parameters of the connect. HTH Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 05, 2001 2:49 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] ODBC and SQL Server I am trying to setup an ODBC connect to SQL Server. My DSN is Acct32_ODBC. I am using NT Authentication, so that could be my problem. odbc_connect(Acct32_ODBC, , ); Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'PENTIUM3\IUSR_PENTIUM3'., SQL state 28000 in SQLConnect in C:\Webroot\testodbc.php on line 33 Any suggestions on how I can resolve this? Many thanks. Todd -- Todd Cary Ariste Software [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] Parsing Error
I keep getting a Parsing Error on line 1 error with the following page. What am I doing wrong? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd; html head titlexxx/title /head body ?php $hostName=xxx; $userName=xxx; $password=xxx; $databaseName=xxx; $tableName=xxx; // connnect to the database if (!($link=mysql_pconnect($hostName, $userName, $password))) { DisplayErrMsg(sprintf(error connecting to host %s by user %s, $hostName, $userName)); exit(); } // select the database if (!mysql_select_db($databaseName, $link)) { DisplayErrMsg(sprintf(Error in selecting %s database, $databaseName)); DisplayErrMsg(sprintf(error:%d %s, mysql_errno($link), mysql_error($link))); exit(); } $result=mysql_query(SELECT * FROM listings ORDER BY store, $link); echo TABLE BORDER WIDTH=\100%%\\n; echo TR TDBStore/B/TD TDBJob Desc/B/TD TDBModify/Delete/B/TD /TR\n; while (($row = mysql_fetch_array($result))) { $store=$row[store]; $jobdesc=$row[jobdesc]; $rowid=$row[rowid]; echo TR TD$store/TD TD$jobdesc/TD TDA HREF=\modify.php?rowid=$rowid\IModify/I/A/ A HREF=\delete.php?rowid=$rowid\IDelete/I/A /TD /TR\n; } echo /TABLE; mysql_free_result($result); ? BRBR A HREF=internal.htmlReturn To Main Menu/ABR A HREF=add.phpAdd An Item/A /body /html -- Jeff Grossman ([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] Parsing Error
Maybe rename your page to loose.php -- 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/PHP what is the difference between unset() and mysql_free_result() ?
Hello, Maybe someone can tell me, the difference b.e. $result = mysql_query ($query); unset($result); #or better mysql_free_result($result); tnx, Bas Jobsen -- 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] ODBC and SQL Server
Andrew - Thank you for getting back to me... Well, does the Test button on your ODBC Admininstrator shed any light? :) If it works there, and doesn't work in your PHP, create an ODBC Trace in the Administrator so you can see the exact parameters of the connect. The test does give me an OK. Here are the results of a trace. First, I tried the odbc_connect; then I did the Test. Unfortunately, most of my C/S experience is with Interbase, so I am not sure what the trace is telling me. Are you able to get a hint as to what I am not doing correctly? Todd inetinfo49c-7fc ENTER SQLAllocEnv HENV * 00ADCD90 inetinfo49c-7fc EXIT SQLAllocEnv with return code 0 (SQL_SUCCESS) HENV * 0x00ADCD90 ( 0x01812708) inetinfo49c-7fc ENTER SQLAllocConnect HENV01812708 HDBC * 00ADCD94 inetinfo49c-7fc EXIT SQLAllocConnect with return code 0 (SQL_SUCCESS) HENV01812708 HDBC * 0x00ADCD94 ( 0x01811688) inetinfo49c-7fc ENTER SQLConnectW HDBC01811688 WCHAR * 0x018121E8 [ -3] Acct32_ODBC\ 0 SWORD -3 WCHAR * 0x1F7F8B88 [ -3] **\ 0 SWORD -3 WCHAR * 0x1F7F8B88 [ -3] **\ 0 SWORD -3 inetinfo49c-7fc EXIT SQLConnectW with return code -1 (SQL_ERROR) HDBC01811688 WCHAR * 0x018121E8 [ -3] Acct32_ODBC\ 0 SWORD -3 WCHAR * 0x1F7F8B88 [ -3] **\ 0 SWORD -3 WCHAR * 0x1F7F8B88 [ -3] **\ 0 SWORD -3 DIAG [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'PENTIUM3\IUSR_PENTIUM3'. (18456) DIAG [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'PENTIUM3\IUSR_PENTIUM3'. (18456) inetinfo49c-7fc ENTER SQLErrorW HENV01812708 HDBC01811688 HSTMT WCHAR * 0x0226E798 (NYI) SDWORD *0x0226E7E0 WCHAR * 0x0226E398 SWORD 511 SWORD * 0x0226E7DE inetinfo49c-7fc EXIT SQLErrorW with return code 0 (SQL_SUCCESS) HENV01812708 HDBC01811688 HSTMT WCHAR * 0x0226E798 (NYI) SDWORD *0x0226E7E0 (18456) WCHAR * 0x0226E398 [ 94] [Microsoft][ODBC SQL Server Driver][SQL Server] SWORD 511 SWORD * 0x0226E7DE (94) inetinfo49c-7fc ENTER SQLFreeConnect HDBC01811688 inetinfo49c-7fc EXIT SQLFreeConnect with return code 0 (SQL_SUCCESS) HDBC01811688 -- Todd Cary Ariste Software [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] MYSQL/PHP what is the difference between unset() and mysql_free_result() ?
unset() simply deletes the pointer to the data without releasing the space held by the data. mysql_free_result() releases the data storage pointed-to by the $result pointer. This is important because $result could be pointing-to a dataspace containing a large number or rows returned by the mysql_query(). You WANT to recover this dataspace. -Original Message- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 05, 2001 4:00 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] MYSQL/PHP what is the difference between unset() and mysql_free_result() ? Hello, Maybe someone can tell me, the difference b.e. $result = mysql_query ($query); unset($result); #or better mysql_free_result($result); tnx, Bas Jobsen -- 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] Forms Question
Hello, Here is the code I have: while ($row=mysql_fetch_array($result)) { $store=$row[store]; $jobdesc=$row[jobdesc]; echo FORM METHOD=post ACTION=update.php; echo PStore: Select NAME=\$store\ option VALUE=\Signal Hill\Signal Hill option VALUE=\Reseda\Reseda option VALUE=\Orange\Orange option VALUE=\West Covina\West Covina option VALUE=\Riverside\Riverside option VALUE=\Norwalk\Norwalk option VALUE=\Fountain Valley\Fountain Valley option VALUE=\Pasadena\Pasadena option VALUE=\Redondo Beach\Redondo Beach option VALUE=\San Bernardino\San Bernardino option VALUE=\Kearny Mesa\Kearny Mesa option VALUE=\San Marcos\San Marcos option VALUE=\Chino\Chino option VALUE=\Coporate Office\Corporate Office /select/P; echo PINPUT TYPE=text SIZE=35 NAME=\Jobdesc\ VALUE=\$jobdesc\/P; echo pINPUT TYPE=submit VALUE=\submit\ LABEL=\Save Changes\/P; } Is want I am trying to do possible? I want the value which is stored in $store to automatically fill in on the drop down list. But, for some reason it is defaulting to the first option, and not using the value that is in the database. Can I use a drop down menu, or should I just go to radio buttons? Thanks, Jeff -- Jeff Grossman ([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] Forms Question
Hello, Here is the code I have: sure, your query is something like: select ..., store, jobdesc .. FROM .. why using: $store=$row[store]; $jobdesc=$row[jobdesc]; echodhdhdh.$row[store].blabla would also work i should use: while (LIST($store,$jobdesc)=mysql_fetch_row($result)) { . - Original Message - From: Jeff Grossman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 05, 2001 11:50 PM Subject: [PHP-DB] Forms Question Hello, Here is the code I have: while ($row=mysql_fetch_array($result)) { $store=$row[store]; $jobdesc=$row[jobdesc]; echo FORM METHOD=post ACTION=update.php; echo PStore: Select NAME=\$store\ option VALUE=\Signal Hill\Signal Hill option VALUE=\Reseda\Reseda option VALUE=\Orange\Orange option VALUE=\West Covina\West Covina option VALUE=\Riverside\Riverside option VALUE=\Norwalk\Norwalk option VALUE=\Fountain Valley\Fountain Valley option VALUE=\Pasadena\Pasadena option VALUE=\Redondo Beach\Redondo Beach option VALUE=\San Bernardino\San Bernardino option VALUE=\Kearny Mesa\Kearny Mesa option VALUE=\San Marcos\San Marcos option VALUE=\Chino\Chino option VALUE=\Coporate Office\Corporate Office /select/P; echo PINPUT TYPE=text SIZE=35 NAME=\Jobdesc\ VALUE=\$jobdesc\/P; echo pINPUT TYPE=submit VALUE=\submit\ LABEL=\Save Changes\/P; } Is want I am trying to do possible? I want the value which is stored in $store to automatically fill in on the drop down list. But, for some reason it is defaulting to the first option, and not using the value that is in the database. Can I use a drop down menu, or should I just go to radio buttons? Thanks, Jeff -- Jeff Grossman ([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] MYSQL/PHP what is the difference between unset() and mysql_free_result() ?
Hello, unset() simply deletes the pointer to the data without releasing the space held by the data. mysql_free_result() releases the data storage pointed-to by the $result pointer. This is important because $result could be pointing-to a dataspace containing a large number or rows returned by the mysql_query(). You WANT to recover this dataspace. Well, oke, tnx. But if unset() doesn't releas the data-space, what then is it's functionality? only voor tests like: if(isset($var)) ;? And how can i free the data-space from a string or somting like that? b.e. $string=a very long string; free($string);#? #could i use mysql_free_result($string); Tnx, Bas -- 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] ODBC and SQL Server
Todd, I don't believe so. Try passing in user and pass variables into your odbc_connect - I'm not sure that is happening. I've about reached my usefulness with regards to debugging a driver connection in someone else's ODBC drivers. At the risk of a plug, I can certainly get our working :) much better logging, etc if you have a problem. If you want to try ours it should be fairly straightfoward :) You can use either Lite or MT. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 05, 2001 5:42 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] ODBC and SQL Server Andrew - Could it be that the string, Acct32_ODBC\ 0, should be Acct32_ODBC? If so, how do I get rid of the terminating \0 in PHP? Todd -- Todd Cary Ariste Software [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] ODBC and SQL Server
Andrew - What I am trying to do is to find out if I can use PHP with my client's MS SQL Server DB. Anything that can help me obtain that information would be greatly appreciated. OS: Win 2K (SP 2) DBMS: MS SQl Server 7 Todd -- Todd Cary Ariste Software [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] ODBC and SQL Server
Todd, Download and install the Lite (Single Tier) driver from our site (Product Availability link) to your Win box. Configure and test a DSN in the ODBC Administrator (The Test button shows up in the Create New Datasource dialog - be sure to hit Apply before the Test button, or it will not find the DSN you created :). Try the same PHP code. The trial Lite will expire in 30 days. Multi-Tier is more powerful, faster, and has a free 2-user connection, but for purposes of testing Lite will be easier to configure for proof-of-concept. Free support is available for any of our products at http://www.openlinksw.com/support/suppindx.htm. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 05, 2001 6:16 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] ODBC and SQL Server Andrew - What I am trying to do is to find out if I can use PHP with my client's MS SQL Server DB. Anything that can help me obtain that information would be greatly appreciated. OS: Win 2K (SP 2) DBMS: MS SQl Server 7 Todd -- Todd Cary Ariste Software [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] Forms Question
On Wednesday, September 5, 2001, at 04:50 PM, Jeff Grossman wrote: Hello, Here is the code I have: while ($row=mysql_fetch_array($result)) { $store=$row[store]; $jobdesc=$row[jobdesc]; echo FORM METHOD=post ACTION=update.php; echo PStore: Select NAME=\$store\ option VALUE=\Signal Hill\Signal Hill option VALUE=\Reseda\Reseda option VALUE=\Orange\Orange option VALUE=\West Covina\West Covina option VALUE=\Riverside\Riverside option VALUE=\Norwalk\Norwalk option VALUE=\Fountain Valley\Fountain Valley option VALUE=\Pasadena\Pasadena option VALUE=\Redondo Beach\Redondo Beach option VALUE=\San Bernardino\San Bernardino option VALUE=\Kearny Mesa\Kearny Mesa option VALUE=\San Marcos\San Marcos option VALUE=\Chino\Chino option VALUE=\Coporate Office\Corporate Office /select/P; echo PINPUT TYPE=text SIZE=35 NAME=\Jobdesc\ VALUE=\$jobdesc\/P; echo pINPUT TYPE=submit VALUE=\submit\ LABEL=\Save Changes\/P; } Is want I am trying to do possible? I want the value which is stored in $store to automatically fill in on the drop down list. But, for some reason it is defaulting to the first option, and not using the value that is in the database. Can I use a drop down menu, or should I just go to radio buttons? Thanks, Jeff If I understand your question... In order to have your value preset in the drop down list you need indicate that with option value=\blahblah\ selectedblahblah What I've been using for this is a hash like this: while ($row=mysql_fetch_array($result)) { $selected = array(); $selected[$row[store]] = selected; $store=$row[store]; $jobdesc=$row[jobdesc]; echo FORM METHOD=post ACTION=update.php; echo PStore:; echo Select NAME=NameOfVariableToBePosted echo option VALUE=\Signal Hill\ . $selected[Signal Hill] . Signal Hill; echo option VALUE=\Reseda\ . $selected[Reseda] . Reseda; ...etc, etc., etc. something along those lines, anyway. So, if $row[store] == Signal Hill, then $selected[Signal Hill] will be set to selected, while $selected[Reseda] and all the others will be blank. This is a very keen thing about php. -Steve -- 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] best solution with db..?
Hello, I am newbie, so, please give me advice. Ok, I have PHP webpage, where I give information from MYSQL database (Info in english). I'd like to have website in german. Should I recreate (double) tables (those, where is text which is needed to be translated), or there is some clever solution? I have no idea. 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] Forms Question
The solution is easier than you think. You'll need to insert an if statement in your option html tag that says echo option VALUE=\Signal Hill\Signal Hill\n; should become: echo option VALUE=\Signal Hill\; if ($store == 'Signal Hill') { print selected; } echo Signal Hill/option\n; Jeff Grossman wrote: Hello, Here is the code I have: while ($row=mysql_fetch_array($result)) { $store=$row[store]; $jobdesc=$row[jobdesc]; echo FORM METHOD=post ACTION=update.php; echo PStore: Select NAME=\$store\ option VALUE=\Signal Hill\Signal Hill option VALUE=\Reseda\Reseda option VALUE=\Orange\Orange option VALUE=\West Covina\West Covina option VALUE=\Riverside\Riverside option VALUE=\Norwalk\Norwalk option VALUE=\Fountain Valley\Fountain Valley option VALUE=\Pasadena\Pasadena option VALUE=\Redondo Beach\Redondo Beach option VALUE=\San Bernardino\San Bernardino option VALUE=\Kearny Mesa\Kearny Mesa option VALUE=\San Marcos\San Marcos option VALUE=\Chino\Chino option VALUE=\Coporate Office\Corporate Office /select/P; echo PINPUT TYPE=text SIZE=35 NAME=\Jobdesc\ VALUE=\$jobdesc\/P; echo pINPUT TYPE=submit VALUE=\submit\ LABEL=\Save Changes\/P; } Is want I am trying to do possible? I want the value which is stored in $store to automatically fill in on the drop down list. But, for some reason it is defaulting to the first option, and not using the value that is in the database. Can I use a drop down menu, or should I just go to radio buttons? Thanks, Jeff -- 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: PhP_dbm.dll
Please Can anyone help pn this matter I recently installed PHP4 but with it didn't get the php_dbm.dll file. Yousuf A Vasanwala Durban Hi, I recently installed PHP4 but with it didn't get the php_dbm.dll file. Basically what i need is the support for Berkeley DB db2 handler.. though php4 is equipped with db3 handler which i don't need I am looking for db2 handler for dab_open()... Please help.. if some one can forward the php_dbm.dll file would be glad.. Yousuf Vasanwala -- 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] ODBC and SQL Server
Andrew - Since I installed the OpenLink ODBC, the MS SQL Server Enterprise Manager has just about become useless as well as MS SQL Server itself. It take many minutes to do just about anything - even after I uninstalled OL. Do you have any suggestions? Todd -- Todd Cary Ariste Software [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] Newbie Help: Searching
have a form with something like input type=text name=TechContact value= then submit it to a page that might do something like $Query = SELECT * FROM enet WHERE TechContact LIKE '%$TechContact%' AND AdminContact LIKE '%'; which will locate anything CONTAINING what the user enters in the text field HTH Beau // -Original Message- // From: Devon [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 6 September 2001 10:08 AM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] Newbie Help: Searching // // // $Query = SELECT * FROM enet WHERE TechContact LIKE '%' AND // AdminContact // LIKE '%'; // // This query simply prints out my entire tables, is there a // way using PHP so I // can make the '%' a user input so they can search the table // under those // fields. // // Cheers // // // // -- // 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] Installing SQL Server
Has anybody succeeded in running PHP, using ODBC and the MS SQL Server ODBC driver? If so, I can use some guidance. Many thanks Todd -- Todd Cary Ariste Software [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] Installing SQL Server
Yes, I have. I think I got the ODBC driver from MDAC 2.6 (available from www.microsoft.com/data), but you will also get it by installing other Microsoft products (Access or Office). Depending on the version of SQL Server you use you can get improved performence by ysing the native MSSQL extension. It works with version 6.x, 7.x and 2000 but it does not support all features of 7.0 and 2000. - Frank Has anybody succeeded in running PHP, using ODBC and the MS SQL Server ODBC driver? If so, I can use some guidance. Many thanks Todd -- Todd Cary Ariste Software [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] newbie needs to format time field
thanks so much, I've gotten a lot from that page of the mySQL documentation... but I'm still needing little more help. I am currently using the following PHP to generate my page (with results displayed in standard mySQL date and time formats): $db = mysql_connect(localhost, username, password); $result = mysql_query(SELECT * FROM table order by date,$db); $myrow = mysql_fetch_array($result)); printf(%s,$myrow[date]); printf(%s,$myrow[time]); printf(%s,$myrow[description]); Should I change my query to something like this: $result = mysql_query(SELECT *,DATE_FORMAT(date,'%m/%d/%y')) FROM tableorder by date,$db); I tried using that query, but then I didn't know how to get the formatted date out of the array field in my PRINTF lines (what goes in the [ ]?) Should I use two different queries, so that I have $result1 and $result2, then $myrow1 and $myrow2, like this: $result1 = mysql_query(SELECT * FROM table order by date,$db); $result2 = mysql_query(SELECT DATE_FORMAT(date,'%m/%d/%y')) FROM table order by date,$db); $myrow1 = mysql_fetch_array($result1)); $myrow2 = mysql_fetch_array($result2)); Thanks for everyone's time if not for newsgroups, I don't how I'd learn anything! Eric Schwinder eric.AT.bergencomputing.DOT.com Torgil Zechel [EMAIL PROTECTED] wrote: Checkout: http://www.mysql.com/doc/D/a/Date_and_time_functions.html the function DATE_FORMAT(date,format) does what you want... I have a mySQL database that I am using PHP to interface with. I have fields in the database that are DATE and TIME types. Can I format these values so that the user sees September 15, 2001 or 2:00 PM instead of 2001-09-15 and 14:00:00 when I show the values on the web page? -- 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] newbie needs to format time field
on 9/5/01 9:22 PM, Eric J Schwinder at [EMAIL PROTECTED] wrote: thanks so much, I've gotten a lot from that page of the mySQL documentation... Here's another one for you: http://www.mysql.com/doc/S/E/SELECT.html quote A SELECT expression may be given an alias using AS. /quote So instead of: SELECT DATE_FORMAT(date,'%m/%d/%y') FROM ... You could do this: SELECT DATE_FORMAT(date,'%m/%d/%y') AS mydate FROM ... I tried using that query, but then I didn't know how to get the formatted date out of the array field in my PRINTF lines (what goes in the [ ]?) Using the above code, the value you're looking for is mydate, i.e., echo $myrow['mydate']; HTH. Sincerely, Paul Burney ++ Paul Burney Webmaster Open Source Developer UCLA - GSEIS - ETU (310) 825-8365 [EMAIL PROTECTED] http://www.gseis.ucla.edu/ ++ -- 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] html generated web pages
still, you have to make a way for your website to store the preferences of each user/web visitor, right? you can save the info in text file, somewhere not in the WEB DOCS path. that way, hackers cant break your webserver and browse outside the normal web pages path. (hacker can break into the machine itself and peek around, but that's a diff subject) so now that that preferences are saved, all the user have to do is log in and when the web page is generated for them, the variables for the color settings, etc. is set. now, like what rick e. said, this will take hour(s) of coding. i cant even begin to give psuedo-code. 1. login 2. once logged in, setup script will read settings from somewhere, either a simple teext file or a database. 3. set web page color tags, images, etc. in variables. 4. generate HTML page from php scripts using said variables from #3 5. user is happy... you make millions... ;-) RSalomo wrote: i'm sorry but i don't quite understand here. yes, i'm looking for a theoritical (logical) answers or quick and dirty solutions. since i'm a newbie here. i guess i'll do more reading and searching. thank you very much rick, joe, olinux o and others for replying. rudy - Original Message - From: Rick Emery [EMAIL PROTECTED] Sent: Wednesday, September 05, 2001 19:55 Now...I understand. To accomplish what you want requires that you store user preferences in a database of some sorts. Then extract those preferences and insert them as HTML attributes to various tags. First, I would recommend that you use Cascading Style Sheets to set-up CLASSes and IDs for each user. Store those CSS elements in the user database and use them to generate your HTML. I don't know what database engine you have access to (MySQL, MSSQL, SYBASE,, etc), so you must learn the intricacies of the engine. I'm assuming PHP will be your server-side script engine. If you're looking for a quick and dirty solution from this list, I don't believe you'll get it. Rather, what you propose will take many hours of coding and testing. We can offer specific solutions to problems you encounter during design and development, though. Feel free to post those questions. -Original Message- From: RSalomo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 05, 2001 12:24 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] html generated web pages what i'm trying to do is how to control images and page format, color, fonts. so if i go to page a.html have image a.jpg and bgcolor red, if page b.html i have image b.jpg and bgcolor blue. and i can give to some users privileges, so they can change the image and the color easily through a userfriendly admin form. about the html generated web pages, i mean how php generates html-extension web pages (with image, contents and page format)? sorry my english is not very good. rudy -- Leo G. Divinagracia III [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] webpage counters
mysql will always have overhead. plus, IMO, mysql is overkill for just simple page counters. if i were you, keeping the text files outside the WEB DOC path would be better. they would have to crack into the machine itself... not just the web server... Eduardo Vela wrote: Hi: I have two types of counters in my web site and I would like to know which one is better. a) the first one using a field in mysql table and updating it each time a visitor hits the page. b) the second one using a plaint text file using code like this: ? $counter_file = counterfile.txt; $linecounter = file($counter_file); $linecounter[0]++; $cf = fopen($counter_file, w); fputs($cf, $linecounter[0]); fclose($cf); echo $linecounter[0]; ? in this case i had to change the permission of the file to: chmod 666 counterfile.txt My questions are: 1. Which is more efficient in terms of time, i.e. accessing a database or accessing a text file? 2. is the second counter secure? is there a possibility that the file counterfile.txt (with those permissions) can be used as a insecure door to my web server? -- Leo G. Divinagracia III [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]