[PHP-DB] oracle error ORA-12154
Hi, I'm trying to connect to an oracle 9.20 database using: $conn = OCILOGON(dah50,dah50,zed2.aleph0); but I get the error ORA-12154 Searching on google says my listener.ora or tnsnames.ora may have problems, but I think mine are correct. Can someone take a look and see if they are ok? Also, I can connect to the database from the command line: ORACLEsqlplus dah50/[EMAIL PROTECTED] SQL*Plus: Release 9.2.0.3.0 - Production on Fri Jul 16 11:58:49 2004 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.3.0 - Production so I'm not really sure what is going on. below are my tnsnames.ora and listener.ora: tnsnames.ora zed2.aleph0=(description= (address= (protocol=ipc) (key=aleph0)) (address= (protocol=tcp) (host=zed2.mdah.state.ms.us) (port=1521)) (connect_data=(service_name=aleph0)(server=DEDICATED))) listener.ora listener=(description= (address_list= (address = (protocol = ipc) (key = extproc)) (address= (protocol=ipc) (key=aleph0)) (address= (protocol=tcp) (host=zed2.mdah.state.ms.us) (port=1521)) ) ) sid_list_listener=(sid_list= (sid_desc= (global_name=aleph0) (sid_name=aleph0) (oracle_home=/exlibris/app/oracle/product/920) ) (sid_desc = (sid_name = extproc) (oracle_home=/exlibris/app/oracle/product/920) (program = extproc) ) ) startup_wait_time_listener=0 connect_timeout_listener=20 trace_level_listener=off and when I start the listener I get no errors. ORACLElsnrctl stop ; lsnrctl start LSNRCTL for Linux: Version 9.2.0.3.0 - Production on 16-JUL-2004 12:07:11 Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved. Connecting to (DESCRIPTION=(address=(protocol=ipc)(key=extproc))) The command completed successfully LSNRCTL for Linux: Version 9.2.0.3.0 - Production on 16-JUL-2004 12:07:11 Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved. Starting /exlibris/app/oracle/product/920/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 9.2.0.3.0 - Production System parameter file is /exlibris/app/oracle/product/920/network/admin/listener.ora Log messages written to /exlibris/app/oracle/product/920/network/log/listener.log Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=aleph0))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=zed2.mdah.state.ms.us)(PORT=1521))) Connecting to (DESCRIPTION=(address=(protocol=ipc)(key=extproc))) STATUS of the LISTENER Alias LISTENER Version TNSLSNR for Linux: Version 9.2.0.3.0 - Production Start Date16-JUL-2004 12:07:11 Uptime0 days 0 hr. 0 min. 0 sec Trace Level off Security OFF SNMP OFF Listener Parameter File /exlibris/app/oracle/product/920/network/admin/listener.ora Listener Log File /exlibris/app/oracle/product/920/network/log/listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=aleph0))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=zed2.mdah.state.ms.us)(PORT=1521))) Services Summary... Service aleph0 has 1 instance(s). Instance aleph0, status UNKNOWN, has 1 handler(s) for this service... Service extproc has 1 instance(s). Instance extproc, status UNKNOWN, has 1 handler(s) for this service... The command completed successfully -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] oracle error ORA-12154
yeah I got it to work, i had to do putenv() with my oracle home dir and then my scripts started working. thanks Peter Beckman wrote: The biggest problem with oci8 is having these four variables set: $ORACLE_SID=SOMESID $ORACLE_HOME=/home/beckman/oracle $ORACLE_BASE=/home/beckman/oracle $TNS_ADMIN=/home/beckman/oracle/network/admin If those aren't set, then things won't work. Please confirm that those environment variables are set in Apache or whatever web server you are using. If they aren't, oci8 won't work. Beckman On Fri, 16 Jul 2004, Adam Williams wrote: Hi, I'm trying to connect to an oracle 9.20 database using: $conn = OCILOGON(dah50,dah50,zed2.aleph0); but I get the error ORA-12154 Searching on google says my listener.ora or tnsnames.ora may have problems, but I think mine are correct. Can someone take a look and see if they are ok? Also, I can connect to the database from the command line: ORACLEsqlplus dah50/[EMAIL PROTECTED] SQL*Plus: Release 9.2.0.3.0 - Production on Fri Jul 16 11:58:49 2004 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.3.0 - Production so I'm not really sure what is going on. below are my tnsnames.ora and listener.ora: tnsnames.ora zed2.aleph0=(description= (address= (protocol=ipc) (key=aleph0)) (address= (protocol=tcp) (host=zed2.mdah.state.ms.us) (port=1521)) (connect_data=(service_name=aleph0)(server=DEDICATED))) listener.ora listener=(description= (address_list= (address = (protocol = ipc) (key = extproc)) (address= (protocol=ipc) (key=aleph0)) (address= (protocol=tcp) (host=zed2.mdah.state.ms.us) (port=1521)) ) ) sid_list_listener=(sid_list= (sid_desc= (global_name=aleph0) (sid_name=aleph0) (oracle_home=/exlibris/app/oracle/product/920) ) (sid_desc = (sid_name = extproc) (oracle_home=/exlibris/app/oracle/product/920) (program = extproc) ) ) startup_wait_time_listener=0 connect_timeout_listener=20 trace_level_listener=off and when I start the listener I get no errors. ORACLElsnrctl stop ; lsnrctl start LSNRCTL for Linux: Version 9.2.0.3.0 - Production on 16-JUL-2004 12:07:11 Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved. Connecting to (DESCRIPTION=(address=(protocol=ipc)(key=extproc))) The command completed successfully LSNRCTL for Linux: Version 9.2.0.3.0 - Production on 16-JUL-2004 12:07:11 Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved. Starting /exlibris/app/oracle/product/920/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 9.2.0.3.0 - Production System parameter file is /exlibris/app/oracle/product/920/network/admin/listener.ora Log messages written to /exlibris/app/oracle/product/920/network/log/listener.log Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=aleph0))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=zed2.mdah.state.ms.us)(PORT=1521))) Connecting to (DESCRIPTION=(address=(protocol=ipc)(key=extproc))) STATUS of the LISTENER Alias LISTENER Version TNSLSNR for Linux: Version 9.2.0.3.0 - Production Start Date16-JUL-2004 12:07:11 Uptime0 days 0 hr. 0 min. 0 sec Trace Level off Security OFF SNMP OFF Listener Parameter File /exlibris/app/oracle/product/920/network/admin/listener.ora Listener Log File /exlibris/app/oracle/product/920/network/log/listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=aleph0))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=zed2.mdah.state.ms.us)(PORT=1521))) Services Summary... Service aleph0 has 1 instance(s). Instance aleph0, status UNKNOWN, has 1 handler(s) for this service... Service extproc has 1 instance(s). Instance extproc, status UNKNOWN, has 1 handler(s) for this service... The command completed successfully -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http
[PHP-DB] logic problem
I'm using some proprietary software/hardware where when a visitor swipes their entry card, it is recorded in a mssql 2000 server. My boss wants a count of unique vistors for a range of dates. So, I need to have it give a count of unique vistors, meaning that I need to count all vists for a day as one visit (because if they go outside to smoke and come back and swipe their card again to get in, each one is a separate visit, but i need to count all visits by each person as one visit since i just want to know if they came at all each day, not how many times they came in). This is my SQL statement: select distinct count(convert( varchar,eventime, 110)) as count, convert( varchar,eventime,110) as date from events, badge wher events.cardnum = badge.id and devid = '1' and convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate' and type = '1' group by convert( varchar,events.eventime, 110) for reference, devid = '1' is the hardware device, where everytime it triggers, it means someone swiped their card to get in, and type = '1' means patron (because we have a type = 2 that is for staff and we jsut want to know how many patrons visited) When I execute this statement, its returning the result for each date of the total number of card swipes (so if a person comes in twice on a date, its recording it as 2 swipes, but I just need to know that they came to the building at all on this date, so I just need it to register that there was a count of atleast one for this card that was swiped) any suggestions? thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] logic problem
Yes eventtime is a timestamp field (whatever mssql's version of mysql's NOW() is) and the convert( varchar,eventime,110) converts the timestamp to a date MM-DD-. my problem is that with the count, it counts each card swipe, and i only need to count one card swipe from each patron per day. so if they swipe their card multiple times, in my php script when i return the results, it only returns one visit for each patron each day even if they have visited two or more times. On Wed, 21 Apr 2004, Brent Baisley wrote: I think your problem is that you are using time, when you are not interested in time, just the date. I'm assuming your eventime column is a timestamp field. Your goal is to select the badge id and the date, distinct will then eliminate multiple visits and then you can group by date to get the visitor count. The way I see it, the hardest part is converting the eventime to a date or some unique string to represent the date. On Apr 21, 2004, at 1:13 PM, Adam Williams wrote: I'm using some proprietary software/hardware where when a visitor swipes their entry card, it is recorded in a mssql 2000 server. My boss wants a count of unique vistors for a range of dates. So, I need to have it give a count of unique vistors, meaning that I need to count all vists for a day as one visit (because if they go outside to smoke and come back and swipe their card again to get in, each one is a separate visit, but i need to count all visits by each person as one visit since i just want to know if they came at all each day, not how many times they came in). This is my SQL statement: select distinct count(convert( varchar,eventime, 110)) as count, convert( varchar,eventime,110) as date from events, badge wher events.cardnum = badge.id and devid = '1' and convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate' and type = '1' group by convert( varchar,events.eventime, 110) for reference, devid = '1' is the hardware device, where everytime it triggers, it means someone swiped their card to get in, and type = '1' means patron (because we have a type = 2 that is for staff and we jsut want to know how many patrons visited) When I execute this statement, its returning the result for each date of the total number of card swipes (so if a person comes in twice on a date, its recording it as 2 swipes, but I just need to know that they came to the building at all on this date, so I just need it to register that there was a count of atleast one for this card that was swiped) any suggestions? thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] logic problem
Yeah I basically had that with my previous SQL statement, I was grouping by event.cardnum instead of counting the cardnums by date. I think what I'm trying to do is beyond the scope of SQL and I'll have to write some PHP to take the SQL statement results and feed them into an array and count the distinct cardnums for each date and then spit it all into an html table. thanks On Wed, 21 Apr 2004, Daniel Clark wrote: AND: any count =1 shows they came in that day. How about: SELECT convert( varchar,eventime,110) as date from events, badge, count(convert( varchar,eventime, 110)) as count WHERE events.cardnum = badge.id and devid = '1' and convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate' AND type = '1' GROUP BY convert( varchar,events.eventime, 110), badge I'm using some proprietary software/hardware where when a visitor swipes their entry card, it is recorded in a mssql 2000 server. My boss wants a count of unique vistors for a range of dates. So, I need to have it give a count of unique vistors, meaning that I need to count all vists for a day as one visit (because if they go outside to smoke and come back and swipe their card again to get in, each one is a separate visit, but i need to count all visits by each person as one visit since i just want to know if they came at all each day, not how many times they came in). This is my SQL statement: select distinct count(convert( varchar,eventime, 110)) as count, convert( varchar,eventime,110) as date from events, badge wher events.cardnum = badge.id and devid = '1' and convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate' and type = '1' group by convert( varchar,events.eventime, 110) for reference, devid = '1' is the hardware device, where everytime it triggers, it means someone swiped their card to get in, and type = '1' means patron (because we have a type = 2 that is for staff and we jsut want to know how many patrons visited) When I execute this statement, its returning the result for each date of the total number of card swipes (so if a person comes in twice on a date, its recording it as 2 swipes, but I just need to know that they came to the building at all on this date, so I just need it to register that there was a count of atleast one for this card that was swiped) any suggestions? thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] logic problem
Re-read my original email, I'm using mssql and not mysql. I'm sort of close to having it working with the sql statement i posted earlier and using PHP to figure out if the date has changed or not and to count the cardnum if the date hasn't changed. I'm getting a number that is different then the total number multiple visits by patrons, haven't checked with the registration person if the # I am getting is right or not, because for some of the very early dates when we were testing the equipment, it returns a count of 0 visits by type 1 card users, even though they have a count of 15 multiple entries that day, so something weird is still going on. i think i'm going to have to end up using a multidimensional array and having PHP loop through it or something... On Wed, 21 Apr 2004, Brent Baisley wrote: This seems too easy to not be able to do it with SQL. There must be something we're missing in the query. Try this: select distinct badge.id,convert( varchar,eventime,110) as date,count(*) from events, badge where events.cardnum = badge.id and devid = '1' and convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate' and type = '1' group by date In MySQL you don't need to specify a field for count(). And you should have to convert the eventime field twice, you should be able to reference the calc field in the group by. On Apr 21, 2004, at 2:19 PM, Adam Williams wrote: Yeah I basically had that with my previous SQL statement, I was grouping by event.cardnum instead of counting the cardnums by date. I think what I'm trying to do is beyond the scope of SQL and I'll have to write some PHP to take the SQL statement results and feed them into an array and count the distinct cardnums for each date and then spit it all into an html table. thanks On Wed, 21 Apr 2004, Daniel Clark wrote: AND: any count =1 shows they came in that day. How about: SELECT convert( varchar,eventime,110) as date from events, badge, count(convert( varchar,eventime, 110)) as count WHERE events.cardnum = badge.id and devid = '1' and convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate' AND type = '1' GROUP BY convert( varchar,events.eventime, 110), badge I'm using some proprietary software/hardware where when a visitor swipes their entry card, it is recorded in a mssql 2000 server. My boss wants a count of unique vistors for a range of dates. So, I need to have it give a count of unique vistors, meaning that I need to count all vists for a day as one visit (because if they go outside to smoke and come back and swipe their card again to get in, each one is a separate visit, but i need to count all visits by each person as one visit since i just want to know if they came at all each day, not how many times they came in). This is my SQL statement: select distinct count(convert( varchar,eventime, 110)) as count, convert( varchar,eventime,110) as date from events, badge wher events.cardnum = badge.id and devid = '1' and convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate' and type = '1' group by convert( varchar,events.eventime, 110) for reference, devid = '1' is the hardware device, where everytime it triggers, it means someone swiped their card to get in, and type = '1' means patron (because we have a type = 2 that is for staff and we jsut want to know how many patrons visited) When I execute this statement, its returning the result for each date of the total number of card swipes (so if a person comes in twice on a date, its recording it as 2 swipes, but I just need to know that they came to the building at all on this date, so I just need it to register that there was a count of atleast one for this card that was swiped) any suggestions? thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] logic problem
Still doesn't work the way I want it. My boss is taking a look at it, she knows SQL really well, I was trying to do this without her assistance, but its just harder then I was expecting. thanks for the help tho On Wed, 21 Apr 2004, Daniel Clark wrote: How about SELECT distinct badge.id, convert( varchar,eventime,110) as date Shows all the badge numbers IN on that date. If the badge number is not there, they didn't check in at ALL that day. This seems too easy to not be able to do it with SQL. There must be something we're missing in the query. Try this: select distinct badge.id,convert( varchar,eventime,110) as date,count(*) from events, badge where events.cardnum = badge.id and devid = '1' and convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate' and type = '1' group by date In MySQL you don't need to specify a field for count(). And you should have to convert the eventime field twice, you should be able to reference the calc field in the group by. On Apr 21, 2004, at 2:19 PM, Adam Williams wrote: Yeah I basically had that with my previous SQL statement, I was grouping by event.cardnum instead of counting the cardnums by date. I think what I'm trying to do is beyond the scope of SQL and I'll have to write some PHP to take the SQL statement results and feed them into an array and count the distinct cardnums for each date and then spit it all into an html table. thanks On Wed, 21 Apr 2004, Daniel Clark wrote: AND: any count =1 shows they came in that day. How about: SELECT convert( varchar,eventime,110) as date from events, badge, count(convert( varchar,eventime, 110)) as count WHERE events.cardnum = badge.id and devid = '1' and convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate' AND type = '1' GROUP BY convert( varchar,events.eventime, 110), badge I'm using some proprietary software/hardware where when a visitor swipes their entry card, it is recorded in a mssql 2000 server. My boss wants a count of unique vistors for a range of dates. So, I need to have it give a count of unique vistors, meaning that I need to count all vists for a day as one visit (because if they go outside to smoke and come back and swipe their card again to get in, each one is a separate visit, but i need to count all visits by each person as one visit since i just want to know if they came at all each day, not how many times they came in). This is my SQL statement: select distinct count(convert( varchar,eventime, 110)) as count, convert( varchar,eventime,110) as date from events, badge wher events.cardnum = badge.id and devid = '1' and convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate' and type = '1' group by convert( varchar,events.eventime, 110) for reference, devid = '1' is the hardware device, where everytime it triggers, it means someone swiped their card to get in, and type = '1' means patron (because we have a type = 2 that is for staff and we jsut want to know how many patrons visited) When I execute this statement, its returning the result for each date of the total number of card swipes (so if a person comes in twice on a date, its recording it as 2 swipes, but I just need to know that they came to the building at all on this date, so I just need it to register that there was a count of atleast one for this card that was swiped) any suggestions? thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] postgresql
Hi, I know this isn't PHP related but I have a quick question about postgresql. I come from a mysql enviroment so I'm a little clueless, even after reading the postgresql docs. I am moving a postgresql database from one server to another. As the user that owns the database, lculber, I ran pg_dump sroom1 sroom1.database but on the server I'm moving the database to, I can't figure out how to get into psql to create the user lculber so I can do psql sroom1 sroom1.database so how can I create the users lculber in postgresql. I can't even connect to psql. any advice? :) below is my command. I'm not trying to database root, I just want to get the psql prompt so I can create the user lculber. [EMAIL PROTECTED] root]# psql -U root psql: FATAL: Database root does not exist in the system catalog. [EMAIL PROTECTED] root]# createuser lculber Shall the new user be allowed to create databases? (y/n) y Shall the new user be allowed to create more new users? (y/n) y psql: FATAL: user root does not exist createuser: creation of user lculber failed -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] ocilogon error
Hi, I have oracle and PHP working together on a remote server called zed that runs redhat linux. I have another computer called accessserver that runs win2k pro with PHP that I am trying to connect to oracle on zed. Both computers have the oracle client libraries installed. On accessserver I have the code: ?php $conn = ocilogon(user,pw,zed.aleph0) or die .ora_error(); if ($conn) { echo connection to oracle successful; } ? When I run this I get the error: Warning: ocilogon(): OCISessionBegin: ORA-12705: invalid or unknown NLS parameter value specified in C:\htdocs\oracleconnect.php on line 2 I've tried looking on google for the NLS parameter but I'm not having much luck. Anyone able to help? Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mssql query
I've used mysql a little, but now I'm working with a MS SQL SERVER 2000 database. We have a proprietary application/hardware setup where when a person enters the building, the time they enter the building is automatically put into the database in a field called eventtime, and their access card is entered in a field called cardnum. The time entered is like the mysql NOW() function (i dunno what its called in mssql), the format is -MM-DD HH:MM:SS.000 anyway. I need to write an SQL query that will get a unique count of cardnum based on how many times the person enters a building each day. So I need to do some sort of UNIQUE (although in mssql I think its distinct) count on the -MM-DD and ignore the HH:MM:SS.000, but looking at the mssql reference book I have, it doesn't go into great detail on date functions, so I was wondering if anyone knows how to do a unique on the eventtime with the date and ignore the time. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] working with ' in SQL
Hi, I have an SQL statement that is ran when data is submitted through a form. When someone types in a word with an ' such as farmer's the SQL statement fails. I tried $_POST[data] = addslashes($_POST[data]); before executing the SQL statement, but the statement still fails. any suggestions? using words without a ' works fine. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] compiling oracle support
How do I compile PHP on Unix to have oracle 9 support. Looking at ./configure --help and PHP's website, I see no option for oracle 9 support. I see --with-oci8 but that appears to only work for Oracle 8. Any help? Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] informix error
Hi, I was wondering if anyone has seen this informix error before. It has me stumped. Searching on google didn't reveal anything. Running my query in informix returns the proper results, so I'm not sure what the problem is. Warning: ifx_fetch_row(): 4 is not a valid Informix Result resource in /usr/local/apache2/htdocs/alephpub/rg2a.php on line 86 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] keyword searching
This is my SQL query: SELECT seriesno, governor, descr, boxno, year, eyear, docno from rg2 WHERE seriesno = '$_POST[seriesno]' and governor matches '*$searchterm*' or descr matches '*$searchterm*'; So as you can see, its gonna need some work to make it do fulltext searching of the descr field. I'm not really sure how to make it do a keyword search, either since holmes*north*carolina doesn't work because it only searches for those words in that order, if descr field in the database contains north carolina holmes it won't return that result, but I want it to because the person using the db is looking for all the fields that contain holmes, north, and carolina. CPT John W. Holmes wrote: From: Adam Williams [EMAIL PROTECTED] CPT John W. Holmes wrote: From: Adam Williams [EMAIL PROTECTED] I am selecting a field in a database called description for keyword searching. The field contains names of people, states, years, etc. When someone searches for say holmes north carolina the query searches for exactly that, fields which have holmes north carolina, and not fields that contaim holmes, north, and carolina. So I run a str_replace to replace all spaces with *, which turns it into holmes*north*carolina, but say that north carolina is before holmes in the field, it won't return those fields (it only returns fields in which holmes is infront of north carolina). So how can I have it return all fields which contain all the words holmes, north, and carolina in any order, in that field? Are you doing a fulltext search or just matching a word in a lookup column? I'm doing a fulltext search. What is your query? Assuming MySQL, I get a result like this: mysql select * from test where match(t) against ('holmes north carolina'); ++ | t | ++ | my name is john holmes from north carolina | | i'm from the north | | in carolina is my home | | did I mention my last name is holmes? | ++ 4 rows in set (0.01 sec) Isn't that what you want? ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] keyword searching
Hello, I am selecting a field in a database called description for keyword searching. The field contains names of people, states, years, etc. When someone searches for say holmes north carolina the query searches for exactly that, fields which have holmes north carolina, and not fields that contaim holmes, north, and carolina. So I run a str_replace to replace all spaces with *, which turns it into holmes*north*carolina, but say that north carolina is before holmes in the field, it won't return those fields (it only returns fields in which holmes is infront of north carolina). So how can I have it return all fields which contain all the words holmes, north, and carolina in any order, in that field? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Help with FTP
use system() to run /bin/df depending on the OS you might need to add a flag to it like -h (linux) or -k (solaris). www.php.net/system Adam On Fri, 27 Dec 2002, Dankshit wrote: Is there a way to see how much space is left in a ftp server? thanks in advance! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] bulk miorting rows into mysql db
use mysqlimport, its a program that comes with MySQL. go to www.mysql.com and click on documentation to learn more about it. Adam On Fri, 13 Dec 2002, mikek wrote: I have a few hundred rows of data to import into a mysql db. Its currently tab separated. What's the most straight forward way (ie i dont want to enter it line by line) of doing a bulk import? I have full admin rights to my dev server. Is there a method or software app that people can recommend to me. Much appreciated. --- Mike Karthauser - email:[EMAIL PROTECTED] - phone:0117 9426653 brightstorm - curiously online - http://www.brightstorm.co.uk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] passing variables
www.php.net/isset if !isset($var) { echo var is not set to anything; } else { echo var is set to $var; } On Mon, 9 Dec 2002, Edward Peloke wrote: Hello all, I have a login/register screen for my php/mysql db. When the page opens, the user sees the log in screen but I have a button and reloads the same page, hopefully with the register screen. I know I can simply check to see if a variable is set with if ($variable){} . This does not seem to work when I give an image a name and link it to the same page. The image is named register and it links back to the same page, so the page loads, I click on the register image , the page reloads but the variable is not set. Any ideas? Thanks, Eddie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] More Apache Installation problems
can your main workstation ping 192.168.1.1 On Mon, 9 Dec 2002, Alex Francis wrote: At last I have Apache and PHP running on my server. My server IP is 192.168.1.1 and I have set ServerName 192.168.1.1 in my httpd.conf file. I can access my test files from the server using either http://localhost or http://192.168.1.1, however if I try the same on my main workstation I can't find the server. Is there something else I need to do. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] More Apache Installation problems
can you ping your router? is it filtering ICMP? can you ping anything? is your cat 5 cable crimped properly and you have link lights on your switch/hub/router and network card? Adam On Mon, 9 Dec 2002, Alex Francis wrote: It seems like a network problem. I can access the network through windows network neighborhood but can't ping it, any suggestions? Gene Dymarskiy [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... make sure both your server and workstation can see each other. try pinging the server: ping 192.168.1.1 -Original Message- From: Alex Francis [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 1:39 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] More Apache Installation problems At last I have Apache and PHP running on my server. My server IP is 192.168.1.1 and I have set ServerName 192.168.1.1 in my httpd.conf file. I can access my test files from the server using either http://localhost or http://192.168.1.1, however if I try the same on my main workstation I can't find the server. Is there something else I need to do. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] More Apache Installation problems
No I think he has his WS with a real IP from his ISP and then his web server plugged into the same hub as his WS but with 192.168.1.1. He'll either need to get a 2nd NIC and give it an ip like 192.168.1.2 or get a cable modem router. Or change his WS to linux and add eth0:0 with 192.168.1.2 :) Adam On Mon, 9 Dec 2002, Gene Dymarskiy wrote: I am a bit confused. Your WS is connected to cable modem and gets public IP assigned by your ISP. Your WS is also connected to a hub shared with your web server. does it mean you have two network cards, one connected to cable modem, and the other to the hub? -Original Message- From: Alex Francis [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 2:20 PM To: Gene Dymarskiy Subject: RE: [PHP-DB] More Apache Installation problems I need to have a server assigned IP address on my workstation for my cable modem. -Original Message- From: Gene Dymarskiy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 8:06 PM To: Alex Francis; [EMAIL PROTECTED] Subject: RE: [PHP-DB] More Apache Installation problems I'd check IP address of your workstation. make sure both the WS and the server are on the same subnet. Your WS should have 192.168 address, too. good luck -Original Message- From: Alex Francis [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 2:00 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] More Apache Installation problems It seems like a network problem. I can access the network through windows network neighborhood but can't ping it, any suggestions? Gene Dymarskiy [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... make sure both your server and workstation can see each other. try pinging the server: ping 192.168.1.1 -Original Message- From: Alex Francis [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 1:39 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] More Apache Installation problems At last I have Apache and PHP running on my server. My server IP is 192.168.1.1 and I have set ServerName 192.168.1.1 in my httpd.conf file. I can access my test files from the server using either http://localhost or http://192.168.1.1, however if I try the same on my main workstation I can't find the server. Is there something else I need to do. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] More Apache Installation problems
what you need to do is have 1 nic going directly to your cable modem using a cross over cable, and then with the 2nd NIC in your WS plug it into the hub along with the web server box, or ditch the hub and connect the WS to the web server with a cross over cable. Adam On Mon, 9 Dec 2002, Alex Francis wrote: Adam, You are correct. I had two NICs, set up exactly as you describe, but kept getting problems (I would lose my internet connection and have to reboot to get it back. I think I will try againand if that fails, buy a cable modem router. Adam Williams [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... No I think he has his WS with a real IP from his ISP and then his web server plugged into the same hub as his WS but with 192.168.1.1. He'll either need to get a 2nd NIC and give it an ip like 192.168.1.2 or get a cable modem router. Or change his WS to linux and add eth0:0 with 192.168.1.2 :) Adam On Mon, 9 Dec 2002, Gene Dymarskiy wrote: I am a bit confused. Your WS is connected to cable modem and gets public IP assigned by your ISP. Your WS is also connected to a hub shared with your web server. does it mean you have two network cards, one connected to cable modem, and the other to the hub? -Original Message- From: Alex Francis [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 2:20 PM To: Gene Dymarskiy Subject: RE: [PHP-DB] More Apache Installation problems I need to have a server assigned IP address on my workstation for my cable modem. -Original Message- From: Gene Dymarskiy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 8:06 PM To: Alex Francis; [EMAIL PROTECTED] Subject: RE: [PHP-DB] More Apache Installation problems I'd check IP address of your workstation. make sure both the WS and the server are on the same subnet. Your WS should have 192.168 address, too. good luck -Original Message- From: Alex Francis [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 2:00 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] More Apache Installation problems It seems like a network problem. I can access the network through windows network neighborhood but can't ping it, any suggestions? Gene Dymarskiy [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... make sure both your server and workstation can see each other. try pinging the server: ping 192.168.1.1 -Original Message- From: Alex Francis [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 1:39 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] More Apache Installation problems At last I have Apache and PHP running on my server. My server IP is 192.168.1.1 and I have set ServerName 192.168.1.1 in my httpd.conf file. I can access my test files from the server using either http://localhost or http://192.168.1.1, however if I try the same on my main workstation I can't find the server. Is there something else I need to do. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Return 1 instance of each unique record?
use GROUP BY field Adam On Fri, 6 Dec 2002, Doug Coning wrote: Hi everyone: How do I get MySQL to summarize a query so that I receive only 1 instance per similar record. I.E. if you have 10 records with name Smith and 5 records with Barney, etc, that it would return 2 records instead of 15. Thanks! Doug Coning -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] sql select
Have you ran it by hand in MySQL from the command prompt with some test data and gotten an error? Adam On Tue, 12 Nov 2002, Steve Dodkins wrote: if i have a statement $result = mysql_query(SELECT labor_id,labor_ord_no,labor_wkyr,works_orders_part_no,works_orders_qty,works _orders_customer_id,labor_qty,labor_time,labor_qty*parts_time+parts_setup AS timea FROM labor,works_orders,parts WHERE labor_ord_no=works_orders_ord_no AND works_orders_part_no=parts_no AND time2 = labor_wkyr ORDER BY labor_wkyr,works_orders_ord_no,$link); This works fine but if i add AND timea labor_time it fails Regards Steve Dodkins IMPORTANT NOTICE The information in this e-mail is confidential and should only be read by those persons to whom it is addressed and is not intended to be relied upon by any person without subsequent written confirmation of its contents. ebm-ZIEHL (UK) Ltd. cannot accept any responsibility for the accuracy or completeness of this message as it has been transmitted over a public network. Furthermore, the content of this e-mail is the personal view of the sender and does not represent the advice, views or opinion of our company. Accordingly, our company disclaim all responsibility and accept no liability (including in negligence) for the consequences of any person acting, or refraining from acting, on such information prior to the receipt by those persons of subsequent written confirmation. In particular (but not by way of limitation) our company disclaims all responsibility and accepts no liability for any e-mails which are defamatory, offensive, racist or in any other way are in breach of any third party's rights, including breach of confidence, privacy or other rights. If you have received this e-mail message in error, please notify me immediately by telephone. Please also destroy and delete the message from your computer. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message is strictly prohibited. If you have received this E-mail in error, or suspect that the message may have been intercepted or amended, please notify ebm-ZIEHL (UK) Ltd on +44(0)1245 468555. ebm-ZIEHL (UK) Ltd Chelmsford Business Park, Chelmsford, Essex CM2 5EZ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] problem with informix
I'd go back to apache 1.3.27 and php-4.2.3 if I were you and see if that fixes your problem. I run Informix, PHP, and Apache on a server and have had no problems. Adam On Mon, 21 Oct 2002, Erwin Speybroeck wrote: Hi, I'm struggling with a problem for quite some time. I have a webserver with apache-1.3.22, php 4.0.6 (patched for some security issues), informix ESQL 9.30 and a databaseserver with Informix IDS 7.31. This construction works very fine. As soon as i go to newer versions -- last try : httpd-2.0.43, php-4.2.3, with the same informix configuration the problem appears. Everything went well for about a week -- so it lloks ok, but ... On the databaseserver shared memory gets taken by the php-actions on the webserver and at a certain moment this memory is all used and the server (database) crashes. Is there somebody who has experienced a similar problem or is there somebody who can give some hints in the direction to look for ??? Thanks in advance, Erwin Speybroeck [EMAIL PROTECTED] Neem eens een kijkje op onze website -- www.vrv.be -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Noob questions...
search around for phpmyadmin on google Adam On Wed, 2 Oct 2002, Brett Lathrope wrote: Ok, here's my scenario... My Web Host has all Root Admin control over MySQL and PHP configs (but they are setup well no complaints there)...I simply have access to 1 DB (already created) that I can do what I want with (create/delete/update tables). I'm VERY comfortable in Windows, C/C++, Delphi and SQL. But I'm a noob to Unix/Linux, as well as both MySQL and PHP. I have two books and the online manuals and I'm reading them...unfortunately almost ALL of them assume you have Root Admin (as well as build) privileges. Can someone recommend a MySQL Front End, that a) is free and b) a noob can set up and finally c) allows me to work from a client on MySQL DB on my Web Host? Thanks Brett -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Current row of query
why not if (!($1%2)) { echo even!; } else { echo odd!; } Adam On Thu, 26 Sep 2002, Brad Bonkoski wrote: oops... I meant: (if $i is odd) ... because $i would be the current index in the array. Brad Bonkoski wrote: why not this? $result = mysql_query(Select * from table'); $num_rows = mysql_num_rows($rows); for ($i=0; $i$num_rows, $i++) { $row = mysql_fetch_array($result); if ($num_rows is odd) { print $row with BG color of red; } else { printf $row with BG color of purple; } } HTH -Brad Patrick Lebon wrote: Is there a mysql or array variable for the current row of a query array? I want to alternate background colours for each row of the query output so i need to know the current row number. Thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] to determine how much server space left on the webserver?
?php exec(df -h); ? On Tue, 17 Sep 2002, Bo wrote: Any ideas of how to write a php script to determine the disk space left in my account at my web server? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] to determine how much server space left on the webserver?
actually make that system(df -h); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: onnecting to MSSQL database from Linux?
He's using microsoft sql server, not mysql. try --with-mssql maybe? Adam On Wed, 18 Sep 2002, Jason Morehouse wrote: It means you haven't compiled mysql support into php. Recompile it using --with-mysql -- Jason Morehouse (jm[@]netconcepts[.]com) Auckland, New Zealand Linux: Because rebooting is for adding hardware. On Tue, 17 Sep 2002 15:30:29 +, Avi Schwartz wrote: I have PHP4 and freetds installed and I am trying to connect to a mssql server. The problem I am having is that the mssql_connect() call generates the following error: Fatal error: Call to undefined function: mssql_connect() Is there something I need to require? Thanks, Avi -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] php start-stop howto?
look in /etc/httpd/conf/httpd.conf when you restart apache (/etc/rc.d/init.d/httpd restart) it restarts php because php is called by apache. Adam On Thu, 12 Sep 2002, Warren Massengill wrote: RedHat Linux 7.2 RPM installation included: PostgreSQL 7.1.3 PHP 4.0.6 Had no problem creating a database using pg but can't find the on/off button for php. PHP is installed in /usr/bin/php; /etc/php.ini; /usr/share/php I edited the php.ini file to specify a location for; usr_dir = The manual for PHP 4.2 (I have 4.0) suggested uncommenting extra module lines in http.conf. I don't know if that is an Apache, Linux or PHP file, but I can't find it in any of them. If I just start typing the hello world script linux wants to execute it after the first line. Put the entire script in an executable file and it doesn't like that either. What do I do next? Thanks, Warren _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Apache 2.X and PHP
Yes but support is experimental so you may notice strange behavior. Adam On Sat, 7 Sep 2002 [EMAIL PROTECTED] wrote: Is it possible to run Apache 2.X with PHP? Julio Cuz, Jr. [EMAIL PROTECTED] Information Services Riverside Community College mailto:[EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP Editor?
1: http://quanta.sourceforge.net/ 2: yes Adam On Fri, 6 Sep 2002, Bryan McLemore wrote: First off, What html/php editor do you guys think is better? Secondly, perhaps a little more relevant to the database part of this. I just want to clarify that with mysql_query() I can send any valid sql expression and it will do that? -Bryan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] SQL Query
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY Adam On Sat, 7 Sep 2002, Bryan McLemore wrote: Hi Guys I have written this SQL Query : CREATE TABLE tasks (id INT AUTO_INCREMENT, name VARCHAR(50), desc TEXT, address VARCHAR(50), startDate DATE, lastWork DATE, progress INT(3)) I'm sending it in through php and I can't get it to work correctly. Please help. Also, I would like to make id the primary key/index -Bryan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Script to control mysql users?
read mysql.com's documentation on the GRANT command. Or install phpmyadmin and use that. Adam On Thu, 29 Aug 2002, Leif K-Brooks wrote: I need to add mysql users to some databases, but my dumb control panel (ensim) doesn't seem to have a feature to do that, and I'm nothing in the mysql database. Does anyone have a script to let me add them automaticly if I supply it with the root password? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] This is driving me insane!
restart apache Adam On Thu, 29 Aug 2002, James Hatridge wrote: HI all... I'm at my end, would some kind soul please help? I'm working on a database using SuSE 8.0, mysql, and PHP. All the standard installs. I need to use exec, unlink, etc. BUT the durn PHP is stuck in safe_mode and I can't get it out. I've looked in /etc/php.ini and it shows safe_mode as off, but when I use phpinfo() it is show on. Can anyone help? Thanks JIM -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] how to hide source code??
set you to owner of the script and then chmod 700 it Adam On Thu, 29 Aug 2002, Smita Manohar wrote: hii im using php script with mysql. i want to hide the script from the admin or from the person who has privileges to access all the data. bcos i use ftp to upload the files. and i don't want anyone should be able to view the source. is it possible to do so? thnx and regds, smita. _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to hide source code??
oh yeah duh me, set it 701 Adam On Thu, 29 Aug 2002, Ryan Jameson (USA) wrote: Wouldn't that make php unable to read it as well? Then it is useless as well. Ryan -Original Message- From: Adam Williams [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 1:00 PM To: Smita Manohar Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] how to hide source code?? set you to owner of the script and then chmod 700 it Adam On Thu, 29 Aug 2002, Smita Manohar wrote: hii im using php script with mysql. i want to hide the script from the admin or from the person who has privileges to access all the data. bcos i use ftp to upload the files. and i don't want anyone should be able to view the source. is it possible to do so? thnx and regds, smita. _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to hide source code??
Apache can execute a file without reading it. Don't believe me? Make a file 701 and then open it in apache. Adam On 29 Aug 2002, Mateus Cordeiro Inssa wrote: Em Qui, 2002-08-29 às 16:05, Adam Williams escreveu: oh yeah duh me, set it 701 Adam On Thu, 29 Aug 2002, Ryan Jameson (USA) wrote: Wouldn't that make php unable to read it as well? Then it is useless as well. Oh, please, setting x bit will permit what ? PHP has to READ the file to execute it. And, if the admin has root privileges, what you can do to prevent him to view the file (a plain text php file) ? One simple thing to do is to make the source so difficult to understand that people would consider it unreadable. I think the right term is to obfuscate the code. There is programs to do this to C, Perl, Tcl, etc., but I don't know if there is one for PHP. Encryption is not enough because PHP would need to decrypt it. Hmm, and if you make a PHP module (binary) and use its functions from the PHP plain text file ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to hide source code??
I encourage you to create a file whatever.html and set it 701 and then look at it with a browsing by connecting to your webserver. http://server.com/~user/whatever.html will be displayed even though it is 701. I've done it many times. Adam On 29 Aug 2002, Mateus Cordeiro Inssa wrote: Em Qui, 2002-08-29 às 17:48, Adam Williams escreveu: Apache can execute a file without reading it. Don't believe me? Make a file 701 and then open it in apache. Oh, yes, so can apache bypass the kernel ? I don't think so, unless it is running as root or the file gets owned by the same user apache runs. The x bit means the O.S. will try to execute that file. Your argument it's like to say setting the x bit in .doc documents permit or not its reading. The x could do something usefull to cgi's, they are really executed (by execve system call). -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] AUTO_INCREMENT problemos
Thats how its supposed to work. It won't reuse old numbers even after you delete the entire row. Adam On Tue, 27 Aug 2002, simon wrote: Hi Wondering if anybody can help with this: My table has an INT column named 'member_id' which is set to AUTO_INCREMENT. It works very well but I have inserted and deleted some test rows during the development stage and now my incremented numbers have jumped ahead. The deleted rows (their member_id values) have not been forgotten it seems and the DB is using them still to evaluate the next number. Any ideas? Simon -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Create database
?php $conn = mysql_connect(localhost,username,password) or die(Couldn't connect to mysql); $query = (CREATE DATABASE db_name); if (mysql_query($query)) { echo pThe database was created successfully/p; } else { echo pThe database was not created .mysql_error()./p; } ? If it still gives you the same error, try connecting to mysql from the console with mysql -u user -ppasswd Adam On Tue, 5 Aug 2003, Russell Griechen wrote: Newbie here, With PhpMyAdmin, What is the syntax for create database? I have: $link = mysql_pconnect(hostname, username, password) or exit(Could not connect); if (mysql_create_db(Sportsmen)) { print (Database created successfully\n); } else { printf (Error creating database: %s\n, mysql_error ()); } /*error Error MySQL said: You have an error in your SQL syntax near '$link = mysql_pconnect(\64.177.44.120\, \russgri\, \sportsme\) or' at line 1 Russell Griechen -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] login won't work for Internet Explorer
View the source in mozilla, it might just be suppressing the output for whatever reason. Adam On Wed, 28 Aug 2002 [EMAIL PROTECTED] wrote: Hi there, I am experiencing a peculiar problem. I have recently moved a PHP / MySQL driven website I have been developing from my linux box on to a live host. Everything seemed to go smoothly apart from one peculiar problem. When I access the site using Internet Explorer (so far I have tried 5.0 and 5.5), I am unable to log into the members' section of the site. Instead I receive the following error: Warning: Unable to jump to row 0 on MySQL result index 2 in [pathdir]/member_login_check.php on line 12 Warning: Unable to jump to row 0 on MySQL result index 2 in [pathdir]/member_login_check.php on line 13 Warning: Unable to jump to row 0 on MySQL result index 2 in [pathdir]/member_login_check.php on line 14 The peculiarity is that when I log in using Mozilla, I have no problem. Why should the choice of browser have any effect on a set of processes which are all server-side? Or am I completely wrong about that? All suggestions and help appreciated. Thanks, Ben -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] connectivity problem
look at http://www.php.net/manual/en/function.pg-connect.php do you have postgresql starting with the -i paramater so that it is listening on a TCP port? PHP needs this to be able to connect to postgresql. Adam On Tue, 27 Aug 2002, Brian Noecker wrote: Hey everyone, got a problem here. I'm using php4.2.1, postgres 7.2. I'm trying to do a simple database connect with the following small php script: -- htmlheadtitlePHP Test/title/head body ?php //connect to postgres database $conn=pg_connect(user=bnoecker dbname=brian); //see if our connection was successful if ($conn==false) { //connection failed - exit the page with an error echo pg_errormessage($conn); exit; } else if($conn) { echo I did it; } $sql=SELECT * FROM employee; $sql_result=pg_exec($conn.$sql) or die (Couldn't Execute Query.); I can manually run the SELECT * FROM employee string and get results with user bnoecker. I've granted all to bnoecker and as well added the postgres admin to the user=. In test, no password has been assigned. I do not get a connection failed message, in fact I do the the I did it message. I do however get the following as it tries to do the query: I did it Warning: pg_exec() query failed: ERROR: parser: parse error at or near resource in /home/bnoecker/public_html/hello.php on line 19 Couldn't Execute Query. Now, others use the same postgres instance with other databases from php scripts without issue, mostly using includes. Can someone show me what I may be overlooking. I'm new to php but I found examples where things are basically layed out like what I've got? Thanks, Brian -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] connectivity problem
In your connect statement, you aren't selecting a password and TCP port to connect to. You made need to specify those. Adam On Tue, 27 Aug 2002, Brian Noecker wrote: Hey everyone, got a problem here. I'm using php4.2.1, postgres 7.2. I'm trying to do a simple database connect with the following small php script: -- htmlheadtitlePHP Test/title/head body ?php //connect to postgres database $conn=pg_connect(user=bnoecker dbname=brian); //see if our connection was successful if ($conn==false) { //connection failed - exit the page with an error echo pg_errormessage($conn); exit; } else if($conn) { echo I did it; } $sql=SELECT * FROM employee; $sql_result=pg_exec($conn.$sql) or die (Couldn't Execute Query.); I can manually run the SELECT * FROM employee string and get results with user bnoecker. I've granted all to bnoecker and as well added the postgres admin to the user=. In test, no password has been assigned. I do not get a connection failed message, in fact I do the the I did it message. I do however get the following as it tries to do the query: I did it Warning: pg_exec() query failed: ERROR: parser: parse error at or near resource in /home/bnoecker/public_html/hello.php on line 19 Couldn't Execute Query. Now, others use the same postgres instance with other databases from php scripts without issue, mostly using includes. Can someone show me what I may be overlooking. I'm new to php but I found examples where things are basically layed out like what I've got? Thanks, Brian -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] is the following query legal?
I have an informix database with a table called phptesttable. It has a SERIAL field (for mysql users that can help, its the same as INT NOT NULL PRIMARY KEY AUTO_INCREMENT) and a CHAR field (CHAR in Informix is the same as VARCHAR in mysql). In my PHP script if I submit an array and then insert all the data by looping through with for loop to INSERT all the data from the array my the value it inserts is empty. For example I have: INSERT INTO phptesttable (textname) VALUES ('$statement[$counter]') but when I echo $querya it shows: INSERT INTO phptesttable (textname) VALUES ('') It should show the value of the $statement[$counter] that I am looping through. But as above you can see the value is empty, but when I echo $statement[$counter] and $counter, they are shown correctly: the counter is set to 1 the statement is testing this field So it should echo INSERT INTO phptesttable (textname) VALUES ('testing this field' but obviously it is not. When I change the query to not use an array and only insert one variable: INSERT INTO phptesttable (textname) VALUES ('$statement') it echos and inserts correctly. So my question is, is it legal to loop through an array and insert the array $statement[$counter]? I am at a loss as to what is happening, because if I change the form to submit one variable instead of an array, it works fine. Any idea as to what is happening? Adam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] is the following query legal?
I got it to work. I have to put the statement in ifx_prepare right before I call it in the loop. I think its because when I define the statement at the start of the code, $statement[$counter] has not been asigned yet so it sets its value to nothing. Adam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] How do I submit data AND send user to other page?
use an HTML form. Adam On Mon, 26 Aug 2002, Gerd Ulrich wrote: Hello, I want to build a questionaire where the user is guided through five pages of questions. How can I program PHP that the user gets to the second page after pushing the Submit-Button? My solution printed here doesn't work. Any hints are greatly apreciated! S. Maier ?php if ($submit) { // process form require ('.htmypasswd'); $verbnr = mysql_connect ($dbhost,$dbuser,$dbpasswd); $db = mysql_connect($dbhost,$dbuser,$dbpasswd); mysql_select_db(pretest,$db); $sql = INSERT INTO frage3 (a1,a2,a3,be_fe01,be_fe02) VALUES ('$a1','$a2','$a3','$be_fe01','$be_fe02'); $result = mysql_query($sql); header (Location: http://www.example.com;); exit; } else{ // display form ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] default value for date.
set a default value that isn't possible (like -99-99 99:99:99) and then have an if statement saying if ( $row[date] == '-99-99 99:99:99' ) { $row[date] = '';} Adam On Mon, 19 Aug 2002, Smita Manohar wrote: i'm using php with mysql. some tables in database have date fields for which i have not set any default value. while displaying the values from tables, if any record has null value for date field then it displays 0-00-00. what i need to do to display null value or spaces instead of zeros. suggestions are welcome. thnx and regds, smita. _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Return Results in Categories - like CNET
If your articles are in an SQL database uses the LIMIT clause on your SQL statement. Adam On Fri, 16 Aug 2002, olinux wrote: I would like to allow articles to be searched and returned in grouped categories - similar to cnet.com See example here: http://cnet.search.com/search?timeout=3q=php Grouping is not a problem - but it becomes a problem when there are thousands of results and I only want to display the first few - similar to the way cnet does. Thanks much, olinux __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP File for adding to database
what is the structure of the table that this info will be going into? Paste me the CREATE TABLE command you used to create it. Adam On Thu, 15 Aug 2002, Shoulder to Shoulder Farm wrote: Hi all, How can I make a PHP4 page that will add information to a MySQL database when the person (me) clicks the Submit button. The following fields to be added are: SKU Name About PriceOZ PriceLB Thanks all, Taj -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Connecting Linux (PHP) to MS Access database
See if this message posted earlier helps you out: http://marc.theaimsgroup.com/?l=php-dbm=102938139730405w=2 Adam On 16 Aug 2002, Osman Omar wrote: Hi, Can I connect/access MS access database from linux ? if can, what software/driver that I need? Now I'm using iodbc without any success thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Upgrading PHP
I'd uninstall php first...I believe its rpm -e mod_php (or you can do rpm -e `rpm -qa|grep php` and then I'd upgrade apache and PHP on your box for security reasons. Read the installation section in the php manual at www.php.net for details. Adam On Wed, 14 Aug 2002, Julio Cuz, Jr. wrote: Hi-- I'm currently running 4.0.4pl1 on RedHat 7.0 and I want to upgrade to PHP 4.2.2is there anything special I have to do BEFORE or AFTER the install? Or is it just a straight re-install of PHP on top of the current Version? THANKS! Julio Cuz, Jr. [EMAIL PROTECTED] Information Services Riverside Community College -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Upgrading PHP
I should add if you are going to upgrade apache also, to rpm -e apache first so that You will have a clean install. backup httpd.conf first though! But you might want to save /etc/logrotate.d/httpd because the rpm -e removed this, and it is what rotates the log files for /var/log/httpd/access_log and error_log Adam On Wed, 14 Aug 2002, Julio Cuz, Jr. wrote: Hi-- I'm currently running 4.0.4pl1 on RedHat 7.0 and I want to upgrade to PHP 4.2.2is there anything special I have to do BEFORE or AFTER the install? Or is it just a straight re-install of PHP on top of the current Version? THANKS! Julio Cuz, Jr. [EMAIL PROTECTED] Information Services Riverside Community College -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php