[PHP-DB] RE: [PHP] Problems w/ goto
On Fri, 2010-12-17 at 10:50 -0600, Jay Blanchard wrote: [snip] Thank you with your excellent help in the past. Here is another puzzler I am trying to write a program that can have two(2) independent forms in one PHP file. When I run the code below [from PHP - A Beginner's Guide], to which I have added a second form, it freezes. Without the goto statements, it runs. When it does run, it displays both forms on one Web screen. What I desire is for the first form to be displayed, the data entered and then the second form displayed. In an actual, not test program like this one, the data in the second form would be dependent on the first form. What did I do wrong? [/snip] You used GOTO. In this case I would recommend using something like jQuery to 'hide' one form until the other form is complete. PHP has sent the output to the browser already, both forms are there and display when you remove the GOTO. GOTO should never be used like this. GOTO should never be used. Wow... that brought me back to 1990... using basic and batch files... I honestly didn't even know that the GOTO was still in existence, especially within PHP. I had to show the people in my office, and we all got a chuckle from teh XKCD comic in the PHP documentation for GOTO http://ca2.php.net/goto Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Problems w/ goto
On Fri, 2010-12-17 at 12:22 -0500, Robert Cummings wrote: On 10-12-17 12:08 PM, Steve Staples wrote: On Fri, 2010-12-17 at 10:50 -0600, Jay Blanchard wrote: [snip] Thank you with your excellent help in the past. Here is another puzzler I am trying to write a program that can have two(2) independent forms in one PHP file. When I run the code below [from PHP - A Beginner's Guide], to which I have added a second form, it freezes. Without the goto statements, it runs. When it does run, it displays both forms on one Web screen. What I desire is for the first form to be displayed, the data entered and then the second form displayed. In an actual, not test program like this one, the data in the second form would be dependent on the first form. What did I do wrong? [/snip] You used GOTO. In this case I would recommend using something like jQuery to 'hide' one form until the other form is complete. PHP has sent the output to the browser already, both forms are there and display when you remove the GOTO. GOTO should never be used like this. GOTO should never be used. Wow... that brought me back to 1990... using basic and batch files... I honestly didn't even know that the GOTO was still in existence, especially within PHP. I had to show the people in my office, and we all got a chuckle from teh XKCD comic in the PHP documentation for GOTO http://ca2.php.net/goto Steve I was one of the people that argued in favour of GOTO on the Internals list a few years ago. GOTO has a use, and a very good one at that. It is by far the most efficient construct when creating parsers or other similar types of logic flow. The demonized GOTO of the 80s was primarily due to jumping to arbitrary points in the code, or in the case of basic to arbitrary line numbers in the code which had little meaning for future readers. When used properly within a well defined scope and with well named labels, GOTO can be a superior choice. If you think GOTO doesn't exist in many types of software, you need only grep for it in the C source code for PHP, MySQL, and Apache. Cheers, Rob. Oh, i can see where it would be useful, i just hadn't realized it was still in existence... and the cartoon, was blown up, and put in my cubical :) RAWR!! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] EZPDO Replacement
One of our programmers had done a fair amount of coding using the EZPDO ORM library and it is no longer supported, Does anyone have any experience migrating from EZPDO to another ORM library. Any recommendations?, Thanks in advance for your help. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP won't return any records
Everyone, I have never used the PHP mssql functions before, I am versed in MySql instead, I cannot get the following code to return any records. The variables $dbserver, $dbuser, $dbpasswd are defined in a config file and are being read and the connection is being made because I can change any one of the variables to a incorrect value and mssql_connect fails. When I use TDS Version 8.0 I get back the Resource ID # only. ?php $linkID = mssql_connect($dbserver, $dbuser, $dbpasswd); if(!$linkID) { die('There was an error while attempting to connect to the MSSQL Server'); } if(!$linkID || !mssql_select_db($database, $linkID)) { die('Unable to connect or select database!'); } //The following is for debugging $query = SELECT * FROM pohdr WHERE ponum = '136025'; echo $query; print BR; print BR; $data = mssql_query($query, $linkID) or die ('Query failed: '.$query); $result = array(); echo $data; do { while ($row = mssql_fetch_row($data)){ $result[] = $row; } }while ( mssql_next_result($data) ); // Clean up mssql_free_result($data); mssql_close($linkID); include ('common/footer.php'); ? My environment: Server #1 - 100% CentOS RPM installed CentOS 5.3 Apache 2.2.3 PHP 5.1.6 FreeTDS 0.64 Server #2 Microsoft Server 2003 Enterprise Edition SQL Server 2005 SQL Server 2000 Compatibility Tools installed Server #3 - Compiled from Source CentOS 5.3 Apache 2.2.11 PHP 5.2.10 (also tried 5.2.5, 5.1.6 and 4.4.7) FreeTDS 0.82 By setting the TDS Version to 8.0 on either Server #1 or Server #2 I can make a connection to the SQL Server using tsql -S {servername} -U {username} and execute the SQL Query above and the records are returned. If I set the TDS Version to 9.0 I can make a connection to the SQL server but from 0.64 or 0.82 I get this error Msg 4004, Level 16, State 1, Server {servername}, Line 1 Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. when I use the SQL Query above. Any assistance would be greatly appreciated. Best, Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Value of $_POST['submit']
When I'm developing a number of pages and don't keep track of every variable or form name (etc), I plant a print_r($_POST); at the top of the page, so there's no guessing what gets sent to the page . . . If you have an empty $_POST array, then the form isn't using action=post, or you didn't code your button as type=submit (?) Just suggestions - since I can't see the code. Steve - Original Message - From: Ron Piggott [EMAIL PROTECTED] To: PHP DB php-db@lists.php.net Sent: Thursday, November 27, 2008 7:02 PM Subject: [PHP-DB] Value of $_POST['submit'] I am working on the following web page tonight: http://www.actsministrieschristianevangelism.org/verseoftheday/ I am trying to program the Load Previous Issue Random Issue and Load Next Issue buttons. I am using Ajax to pass the date the user is requesting to the PHP script for processing. I am wondering how my PHP script may access the value of value of $_POST['submit']. At present echo $_POST['submit']; doesn't give me a value. Consequently all queries to the mySQL database fail. Ron -- 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-DB] Oracle TNS no listener
Hi All I've a bit code that connects to a remote Oracle DB, does a simple query and returns the result. Running from a Windows command prompt as php oratest.php the script runs fine and returns the results I'm expecting. If I run it through a browser I get oci_connect() [function.oci-connect]: ORA-12541: TNS:no listener in ... Webserver is IIS on my local box. PHP is running on my local box. I've got TNS_ADMIN set as an env variable Any help gratefully received :-) Cheers Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Is there any I can do to copy data from a mysql database to access database?
I have a mysql database and would like to be able to copy the data from that to my access database. If there something that is freeware to do this? Or maybe someone has some code that might do this for me? Thanks in advanced. Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Searching many-to-many map tables
Thanks Chris, By the way do you have problems with spammers getting your gmail address from usenet? The user_id is actually what I'm searching for dynamically, so my initial query was relatively correct as it returns one row with user 1. However, I wasn't familiar with the concept of self-joining, so many thanks for that. Still damn ugly so I see. Strange as I would have thought my problem isn't unique. Best practice seems to recommend using many-to-many tables instead of flat-tables yet I've yet to find an explanation of how to convert the flat-table query select * from users where group_id_1=1 and group_id_2=2 into a map-table query in a better way than I've done already. Steve Chris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Steve McGill wrote: Hello, I am trying to find out how to search a many-to-many map table efficiently. I have an example table: user,user_group 1,1 1,2 2,1 3,2 I want to find out all the users who are a member of BOTH groups 1 AND 2. In this example, this would just be the user with id 1. Until now, I can either do this with multiple queries and using PHP array_intersect, or one really ugly MySQL query: select user, count(user_group) as num_groups_found from users_groups where group IN (1,2) GROUP BY user HAVING num_groups_found=2 Where's your userid check? You should be able to add that in as well. select user, count(user_group) as num_groups_found from users_groups where user='1' and group IN (1,2) GROUP BY user HAVING num_groups_found=2 i.e. narrows down the groups I'm looking for and makes sure that they are all found for a user It works quite reliably I think but it's such a rubbish query that I was hoping that somebody could teach me some syntax that is better. The problem is you want two values from the same table (group is '1' or '2'), so either you need to do the above or a self-join (as far as I know anyway!) :/ -- Postgresql php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Searching many-to-many map tables
Hello, I am trying to find out how to search a many-to-many map table efficiently. I have an example table: user,user_group 1,1 1,2 2,1 3,2 I want to find out all the users who are a member of BOTH groups 1 AND 2. In this example, this would just be the user with id 1. Until now, I can either do this with multiple queries and using PHP array_intersect, or one really ugly MySQL query: select user, count(user_group) as num_groups_found from users_groups where group IN (1,2) GROUP BY user HAVING num_groups_found=2 i.e. narrows down the groups I'm looking for and makes sure that they are all found for a user It works quite reliably I think but it's such a rubbish query that I was hoping that somebody could teach me some syntax that is better. Many thanks in advance, Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Undefined pg_prepare() in 5.6.1
Hello, The following code: ?php // Connect to a database named mary $dbconn = pg_connect(host=localhost port=5432 dbname=test user=test password=test); if(!$dbconn) { echo Unable to connect to test database\n; echo pg_last_errror($dbconn); exit; } $result = pg_prepare($dbconn, my_query, 'SELECT * FROM users WHERE username = $1'); ... ? gives me this in the apache log: [Tue Oct 31 15:11:42 2006] [error] [client xx.xxx.xxx.x] PHP Fatal error: Call to undefined function pg_prepare() in /usr/local/apache/htdocs/php/dbtest.php on line 10 Other than this, PHP and non-prepare related pg_* functions work fine. php_info() reports that it sees version 8.0.3 of libpq. I've done a fresh compile and install of apache and PHP. Versions are: Apache: 2.2.3 PHP: 5.6.1 Postgres: 8.0.3 My configure line for PHP was: ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-pgsql=/usr/local/pgsql --with-mysql=/usr/local/mysql --enable-force-cgi-redirect --disable-cgi --with-zlib --with-gettext I've not been able to find any help on this in the FAQ or by searching the archives. It seems like this must be something really stupid, but I'm stumped. Any help/pointers would be greatly appreciated. -Steve -- ( Stephen L. Mathias, Ph.D. ( s m a t h i a s ( ) Division of Biocomputing) @ p o b l a n o ) ( UNM School of Medicine ( . h e a l t h . ( ) ) u n m . e d u ) ( http://poblano.health.unm.edu/( -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Copying a set of database records
A sort of similar question to my last one: I have a table with about 100 records all related to one product. I want to create a new product, based on the details from the old product. So in PHP, I would fetch the 100 records, alter the productID, and then insert it 100 in 100 separate SQL queries. Is there any way I can do this in one SQL query, somehow using a combination of insert and select? Thanks in advance! Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Problem with mysql_fetch_array after first loop...
Jeffrey Baumgartner [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] I've made a little programme that deletes expired records from database tables. The troublesome bit looks like this... $query = SELECT ic FROM ic_ic WHERE date = CURDATE(); $result = mysql_query($query) or die(Unable to get old campaigns because . mysql_error()); while ($row = mysql_fetch_array($result)){ extract($row); ...delete records from tables where ic = ic } It works fine for the fitst value of $ic, but on the second time around I get an error message saying that line [starting with while...] is not a valid MySQL resource. This really puzzles me because it works one time around, but not after that. $ic, incidentally, is a string originally generated from the timestamp (ie. getdate[0]) - could this be causing a problem? Why don't you try it without using extract($row), and use $row[variable1] $row[variable2] instead in your loops. extract() pulls all the variables into the global namespace and can be quite dangerous as it might overwrite other variables. (this might be whats happening with the $result variable for example. also, how does extract() behave when trying to convert the [0] [1] [2] variables? you might be better off using mysql_fetch_assoc() Best wishes, Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Updating many records at a time
I have a situation where I am doing lots of complex sorting on records that already exist in a MySQL table. The table has a 'sort_order' field which means I can do a simple ORDER BY sort_order to keep it nice and quick on SELECT, it's only UPDATE which is slow. If I change the order that I want 1 rows to be displayed, I am currently making 1 SQL queries such as: UPDATE products SET sort_order=0 WHERE id='5'; UPDATE products SET sort_order=1 WHERE id='2'; UPDATE products SET sort_order=2 WHERE id='32'; and so on. Obviously I'd love to be able to put all of this into one query. Is there some way I can combine this with IN() ? UPDATE products set sort_order= WHERE id IN('5','2','32'); Many thanks in advance for any help / advice. Best wishes, Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Updating many records at a time
Steve McGill wrote: I have a situation where I am doing lots of complex sorting on records that already exist in a MySQL table. The table has a 'sort_order' field which means I can do a simple ORDER BY sort_order to keep it nice and quick on SELECT, it's only UPDATE which is slow. If I change the order that I want 1 rows to be displayed, I am currently making 1 SQL queries such as: UPDATE products SET sort_order=0 WHERE id='5'; UPDATE products SET sort_order=1 WHERE id='2'; UPDATE products SET sort_order=2 WHERE id='32'; and so on. Obviously I'd love to be able to put all of this into one query. Is there some way I can combine this with IN() ? UPDATE products set sort_order= WHERE id IN('5','2','32'); Many thanks in advance for any help / advice. What is the exact operation you're doing? Is there any possibility you can do UPDATE products SET sort_order=sort_order+1 WHERE sort_order 30 for e.g. - as in you insert an 'item' at spot 30 and want all the rest below it to be bumped up one. That's something I've done in the past, and it works well. But indeed, I am letting the users completely change the order manually, using some javascript, and letting them do it all in one go. You can certainly use IN(), but there is a (quite high) limit on how long the query string can be. It's pretty ridiculously high actually, but something to consider. Could you help me with the syntax for that? I said 10,000 as an example, but it's more like 500. :-) Personally, I'd look at how you're doing things - see if there isn't an alternative way to do it like outlined above. I'm assuming these aren't just some precalculated ordering, they're manually ordered for some reason? If it's not 'we want to manually order them' - In a products database, I would think you could just have an ORDER BY product_group, product_name or some such. They already get a choice between manual ordering, or using mysql to sort using 'order by'. Sometimes they need specific control. Best wishes, Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] replacing dynamic variable in preg_replace
I am working on a script which takes a list of variables form a database. The problem i am currently having is some of the variables have other variables in the content , i.e. $temp=h1$title/h1 (made up example), is something that might come out of the mysql. $query=mysql_query(SELECT `code`,`varname` FROM `k_sys`); while(list($code,$var)=mysql_fetch_array($query)){ $code=str_replace(-user-,USER,$code); $code=preg_replace(/--(\w+)--/,$$1,$code); // PROBLEM $$var=$code; } is the current code, i'm setting off variables with a --, so if variables $title, is in the mysql, the above example would be h1--title--/h1 instead. When i do the above i would just get like $title as an output. I think its due to how mysql is storing the information, but a stripslashes didnt work. If anyone can help it'd be much appreciated. Steve Mo'gan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Please help
What's contained in $sql and $sql_ext ??? Stuart Felenstein wrote: I'm using a product called dbqwiksite pro. PHP generator for PHP - MySQL The code seems to be working fine except in my search page where I receive an invalid query $result = mysql_query($sql . . $sql_ext . limit 0,1) or die(Invalid query); This is the place I where the code is taking the die path. I'm guessing something belongs between the quotation marks , just not sure. Anyone ? Thank you Stuart -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] LAMP
Hi Gav SuSE will work outta the box. Just make sure you've selected the components and Yast will configure more or less everything to work together before installing cheers Steve Gavin Amm wrote: I'd really like to find a Linux distro that is a LAMP system right out of the box. (Linux, Apache, MySQL, PHP) Are there any out there? Cheers, Gav -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] LAMP
Almost all major Linux distros. come with Apache and PHP. I know that redhat 9 even had php/mysql. Fedora core has it too, however none of them have php 5 that i know of. Steve Gavin Amm wrote: I'd really like to find a Linux distro that is a LAMP system right out of the box. (Linux, Apache, MySQL, PHP) Are there any out there? Cheers, Gav -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] oop?
For awhile i didn't touch OOP PHP, classes etc... because people talked about how slow it was, but now i'm working on a site that has to do things the exact same on page to page, but i think that going with classes and funcitons might be better, because we have to carry a lot of data from function to function. Is the speed/performance that much of an issue? the site i'm doing is www.dinowax.com it gets quite a few hits a day (100k-200k). i know a lot of speed things that i've seen are like... 1.4 seconds of php compared to a class doing it in like 5... but all my current scripts, which use classes all go in under 1 second, and thats when the server is under strain. Any explanation would be appreciated. Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] session_start
I have set the session.save_path (in my php.ini-recommended AND php.ini-dist file) to c:\php4\sess\tmp. I have also created those directories accordingly. However, when I try to browse a very simple .php file (see below) that includes session_start(): I am getting the following error messages: Warning: session_start(): open(/tmp\sess_09ecd436e04fa9e49bc155300154ad63, O_RDWR) failed: No such file or directory (2) in c:\program files\apache group\apache\htdocs\practice\movie1.php on line 2 It appears that Apache/PHP still thinks the session.save_path is /tmp, even though I changed this in php.ini-recommended and php.ini-dist. **What am I doing wrong?** Thanks, Steve [EMAIL PROTECTED] --- ?php session_start(); $_SESSION['username']=Joe12345; $_SESSION['authuser']=1; ? html head titleFind My Favorite Movie/title /head body ?php $myfavmovie=urlencode(Long Live Science); echo a href='http://localhost/practice/moviesite.php?favmovie=$myfavmovie'; echo Click here to see info about my favorite movie./a; ? /body /html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Passing the value of a variable from PHP to JavaScript.
Hi Prabu you need to add a few bits: in the function: function tes(){ vtes = theform.vtes.value; #added line document.write('pJavaScript/p'); window.location.replace('http://127.0.0.1/coba/coba.php?vtes=' + vtes); #altered line in the body: form name='theform' and /form before the /html may be a bit ott but should work steve } Prabu Subroto wrote: Dear my friends... I have my code like this : == ?php echo html script language='JavaScript' function tes(){ document.write('pJavaScript/p'); window.location.replace('http://192.168.23.1/coba/coba.php?vtes=$vtes'); } /script body ; echo diforward ke javascript; echo select onchange='tes()' name='vtes' option value=''/option option value='1'1/option option value='2'2/option /select ; ? /body /html == I expect this result on url column of my internet browser: http://192.168.23.1/coba/coba.php?vtes='1' or http://192.168.23.1/coba/coba.php?vtes='1' But I only get this unexpected result: http://192.168.23.1/coba/coba.php?vtes= Lookslike the value of $vtes was not passed to JavaScript interpreter. Anybody of you have a solution for me? Please teach me. Thank you very much. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Bad date external representation
I am running into a Bad date external representation when I try to insert some data from one of my pages. This is the SQL statement: $sql=insert into Vehicle_List (Date_PU,Date_Called,Company,Stock_Number,VIN,Veh_Year,Veh_Make,Veh_Model,Veh_Color, PU_LOC,Recd_Orig_Title,Sent_Title,Recd_Title,Sold_Date,Sale_Date,Sale_Status,VIN_Short) VALUES ('$Date_PU','$Date_Called','$Company','$Stock_Number','$VIN','$Veh_Year','$Veh_Make', '$Veh_Model','$Veh_Color','$PU_LOC','$Recd_Orig_Title','$Sent_Title', '$Recd_Title','$Sold_Date','$Sale_Date','$Sale_Status','$VIN_Short'); I am using Postgres 7.3. The date is being entered as 10/10/2004. Any ideas? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP and php_mssql.dll
Frank M. Kromann wrote: You need to install the MSSQL Client Tools or alt least copy ntwdblib.dll from the SQL Server (this will allow connections but not configuration). - Frank I have the php_mssql.dll in the extension directory but when I execute a PHP page, I am told that the dll does not exist. This is on Windows XP Professional. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ntwdblib.dll is installed on the Server. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Windows XP and PHP
I installed Apache/Perl/PHP onto a Windows XP machine today and ran into this problem when I tried to access the MS SQL Server via PHP: can't load dynamic library php_mssql.dll The dll is in the extensions directory. Apache is running fine. Any ideas, on what might be wrong? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Windows XP and PHP
Duane Lakoduk wrote: I installed Apache/Perl/PHP onto a Windows XP machine today and ran into this problem when I tried to access the MS SQL Server via PHP: can't load dynamic library php_mssql.dll The dll is in the extensions directory. Apache is running fine. Any ideas, on what might be wrong? I think this is in the php documentation but here is an answer from: http://forums.devshed.com/archive/5/2002/11/2/47028 = MSSQL connection using PHP (ERROR) micros_bytes This is happening because you do not have the required MS-SQL client libraries. In addition to having the PHP extension DLL, you have to have the Microsoft DLLs for accessing SQL Server. I don't recall the exact files but you can get them by installing the SQL Server Client Tools from the SQL Server install CD. Once you have that installed, you should be able to connect without errors. = I had this bookmarked too, and I had forgotten about it. Would installing the MDAC Microsoft have on their site install the ntwdblib.dll? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MS SQL date time strangeness
I tried what you had suggested and I still get the same result. Robert Twitty wrote: The date() is for use with the 32-bit C time value returned by functions like time(). Data from fields of type datetime are returned as strings in the form Jan 9 2004 by the mssql extension as the default. To return it using ISO format set mssql.datetimeconvert to On in the php.ini file, or use the following command: ini_set('mssql.datetimeconvert' , 1 ); -- bob On Mon, 26 Jan 2004, Steve wrote: I have Apache 1.3 and PHP 4 running on Windows 98 connecting to a local MS SQL 7.0 server. MS SQL has the date as 2004-01-09 (-MM-DD), when I print the date to a webpage with this PHP code: printf(Date Picked Up: %s\nDate, date(Y/j/n,$row[0]); I get this output: 1969/12/31 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MS SQL date time strangeness
I have Apache 1.3 and PHP 4 running on Windows 98 connecting to a local MS SQL 7.0 server. MS SQL has the date as 2004-01-09 (-MM-DD), when I print the date to a webpage with this PHP code: printf(Date Picked Up: %s\nDate, date(Y/j/n,$row[0]); I get this output: 1969/12/31 What is wrong? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Apache 2
Hello, Ok perhaps this is sort of cross posting, sorry if this annoys anyone. But I want to know please if Apache 2 with PHP and MySQL is stable and good enough for production release. I posted sort of the same message to the apache group, but wanted to check here as well because they would say it's ok! Thanks, Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL Query not working via PHP
remove the comma after cadet.photo, ie select cadet.relation2,cadet.photo FROM HTH steve Matthew Moldvan, Jr. wrote: I would say try single quotes instead of double quotes ... let me know if that works ... Regards, Matt. - Original Message - From: Sean Smitz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 17, 2003 4:32 PM Subject: [PHP-DB] MySQL Query not working via PHP I have a query that works in MySQL but when I try to execute it in PHP I encounter the following error: //Generated by the script Couldn't execute query! // Generated by MySQL MySQL reports: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM cadet, cadet_phone WHERE cadet.ssn = cadet_phone.ssn AND ( //Query outputted by the script Query was: SELECT cadet.rank, cadet.lname, cadet.fname, cadet.mname, cadet.address1, cadet.address2, cadet.city, cadet.state, cadet.zipcode, cadet.email, cadet.guardian1, cadet.relation1, cadet.guardian2, cadet.realtion2, cadet.photo, FROM cadet, cadet_phone WHERE cadet.ssn = cadet_phone.ssn AND (cadet.lname = Smith AND cadet.fname = John AND cadet.mname = Doe) Attached is the entire page. Any help is appreciated. Sean Smitz -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] parse error.
Hi Micella You need to either slash-escape your insert query or use single quotes: $query=insert into dene (day,start_time) values (\2003.09.25\,\22:30\) ; or $query=insert into dene (day,start_time) values ('2003.09.25','22:30') ; steve M|cella Erdem Efe wrote: I am a new programmer of PHP4.3.3 an MySql 3.23 . When below script is executed Parse error: parse error, unexpected T_DNUMBER in c:\program files\apache group\apache\htdocs\ilkdeneme21.php on line 17 is being seen. This may be very simple but I could not solve it.Could you help me for this error? Thanks for your attention [EMAIL PROTECTED] ? $dbname = 'mycmpe'; mysql_connect(localhost,username); if (mysql_select_db($dbname)) { echo connected;} else { echo not connected;} $query=insert into dene (day,start_time) values (2003.09.25,22:30) ; $result=mysql_query($query); if ($result)) { echo data girildi;} else { echo data girilemedi; exit;} ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: How to get PHP to download web contents
Yes I had tried all those below before posting. It sounds like this is the only way to deal with authentication from what I see. In windows it works fine from the browser to include name and pass in url. In Linux it comes back and asks for the pw again. I'd think the only difference would be in headers. Is there any header info todo with authentication which come from the client which are not set by doing the url name and pw? Thanks, Steve --- Ognyan Bankov [EMAIL PROTECTED] wrote: Steve B. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Nadim, It works but not for sites with password window that pops up. I see. That is HTTP Basic Authentication You should use this line: $filename = 'http://someuser:[EMAIL PROTECTED]/'; instead of: $filename = http://somesite.com?user=someuserpwd=somepwd; and source will look like: ?php // get contents of a file into a string $filename = 'http://someuser:[EMAIL PROTECTED]/'; $handle = fopen ($filename, r); $contents = fread ($handle, filesize ($filename)); fclose ($handle); ? nadim's solution will look like this: $html = implode ('', file ('http://someuser:[EMAIL PROTECTED]/')); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] stripping a get variable out of url string
I have an online tutorial build into a web page. It has button next step. If you are on page index.php?abc=123 for instance the code is smart enough to make it index.php?abc=123step=x The problem is how to remove step=x from the old url string so that steps don't pile up. index.php?abc=123step=1step=2 I'm trying ereg but could use a nudge with the wild card aspect of searching and replacing. The code below builds the get string. $stepnum = $_GET[step]; $laststep=$stepnum-1; $nextstep=$stepnum+1; $args = $_SERVER[REQUEST_URI]; if ($_SERVER[argc]0) $args.=; else $args.=?; if ($stepnum1) { echo bra href='$args; echo step=1'step 1/abr; } if ($laststep0) { echo bra href='$args; echo step=$laststep'backup 1 step/abr; } echo bra href='$args; echo step=$nextstep'next step/abr; thx __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] How to get PHP to download web contents
How would you get PHP to download a file such as a web page and put it in a string? What keywords would relate to this (besides php download) I need a user to be able to put in a name and pass and have PHP go to a cetain site. The site can take the user/pass in the url so I do not need a form submit. Then I need the site contents to be in a php variable. Any tips on parsing html out of it would be great. Thanks __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: How to get PHP to download web contents
Hi Nadim, It works but not for sites with password window that pops up. It is not the html based password but the browser window kind. Do you know what this kind is called? I've been searching 'php get html password' etc... Thanks Just a note the other example posted causes my computer to overload. --- Nadim Attari [EMAIL PROTECTED] wrote: How would you get PHP to download a file such as a web page and put it in a string? From the manual: $html = implode ('', file ('http://www.example.com/')); Note: As of PHP 4.3.0 you can use file_get_contents() to return the contents of a file as a string. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] add source code from form to DB - quote error- tried addslashes..
Hi I spent my 6+ hours trying yesterday to get a form to submit source code to the db. The data gets in the db fine if it is just plain ascii. The server has Magic Quotes on and this is bad according to most but should not stop it from working- in fact it should just work. Short Source is here can anyone tell my what addslash/addquote/removequote/htmlentities thing I need to do? I've tried a few. if (!empty($HTTP_POST_VARS[cname])) { $cname= $HTTP_POST_VARS[cname]; $source= $HTTP_POST_VARS[source]; echo lt;plt;/pForm Source = lt;br.htmlspecialchars($source).lt;br; // try to make it insert right. // not getting insert error but only getting partial data inserted for source. //$source= '.mysql_escape_string($source).'; //$source = addslashes($source); //$source = '.mysql_escape_string(stripslashes($source)).'; $sql = INSERT INTO classes set cname='$cname', source='$source'; // the query prints on the screen fine print lt;br.htmlspecialchars($sql).lt;br; mysql_connect(a, b, c); mysql_select_db(codepost); mysql_query($sql); echo New code added!!!; } ? lt;plt;/p lt;form action=addnewclass.php method=POST Class name: lt;input type=text name=cname lt;br Source: lt;textarea name=source rows=10 cols=65lt;/textarea lt;br lt;input type=submit value=Add Code lt;/form __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] php admin text edit then crash question
I can post some source code by form to db and it all looks good in the db. When using phpadmin and adding wow to the end of the source phpadmin gets a quote error. The db field holding this is text. Why would it get a quote error from that? Is this a server issue or my fault? (its hosted) Thanks __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Renaming all pages to .php
I've heard of a Apache server setting or update that makes for example: .com/shoes.html returns page /index.php?site=shoes or .com/shoes.html returns page /shoes.php Just like you have virtual folders you can have wildcard serach and replaced virtual file names. I believe this would solve your problem below and knowing this would make my PHP driven site appear to be a collection of html pages. Does anyone know how to do this or what it is called so I can research it? -Steve --- David Blomstrom [EMAIL PROTECTED] wrote: At 02:19 PM 6/20/2003 +0200, Thorsten Körner wrote: This will run, and I think almost without problems. But IMHO it makes no sense. And I don't know, if all the searchengines out there will be able or willing to read *.php files (google works fine). Are you saying that some search engines might not register pages with php extensions? That would be a MAJOR problem. You should know that renaming all that files is not all, you have to do. you have also to change every single link in your pages, that points to your pages. I don't know how large your project is, but it can be much work, and if you do not add lines of PHP-Code to that pages, you can save much time by not doing so. Hm... it would be nice if I could use a search and replace function, but that would be tricky. If I replaced every instance of .htm with .php, then that would also change links to other websites. For example... a href=htttp://www.50states.com/history.htm would become a href=http://www.50states.com/history.php; I wonder if there's an advanced search and replace technique that would target only internal links on my website. On the other hand, I am doing an extensive overhaul that will require recoding on every single page, so maybe I could just manually change the links as well. Thanks for the tips. The comment about the search engines is especially interesting (or alarming). I'll have to give this some more thought if .php links might affect my site's visibility in search engines. Do you know if the same applies to .asp and ColdFusion? BTW. It is not a good idea to start a new thread by replying to an old one. I wasn't aware that I did. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] addslashes, stripslashes, htmlspecialchars
Hi this is about PHP commands even though has mysql too. I go to mysql board when I find one they said MySQL is not necessarily PHP driven and if I want PHP specific questions to go to a PHP list. How do you deal with forms, db storage of the data and calling it up in a form to edit? The online tutorials I have covered to not address this except with addslashes on one of them. My web page broke when I added a hyperlink in the description because of the ' Previously: used .asp and always set the db in a way similar to parameters? in MySQL Sometimes I did urlencode() on a get string to make the spaces and other characters work. tried addslashes and noticed it does add them, right in the db. Is this the standard? add and remove slashes? other thing confusing me is the htmlentities which may do this better? Thanks, Steve __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] simple date formatting?
Hi I'm looking to format a date but all I find is this date() function and it appears to be for current date? My variable $dbrec[ListDate] is printing: 4/30/2003 0:00:00 It needs to print 4/30/2003 Am I on the right track to try to do a (with right parameters) $formatted_date = date(M D Y,$dbrec[ListDate]); or $formatted_date = date_format(M D Y,$dbrec[ListDate]); Thanks Current code just chops it off: print tdfont color='white'b.substr($dbrec[ListDate],0,9)./td; __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP web templates?
Hi I'm working on the site http://www.handheldwarez.com I really like these sites style of table cells and borders etc... http://tribes.sierra.com/ http://www.planetrenegades.com/modules.php?name=Web_Linksl_op=MostPopular http://www.tribes2maps.com/ I've seen PHP nuke templates and am thinking that is what these sites are? Does anyone have a favorite open source template spot? I'd like a nice metal look like those sites. In the past I took graphics from php nuke free site and make my own tablecell.php that prints nice boxes. That is in use at http://www.northcountyrc.com if you wonder what I'm talking about. Please don't burn me I'm newb and have little art skill but decent photoshop knowledge. Any help, links is much appreciated thanks! - Do you Yahoo!? Free online calendar with sync to Outlook(TM).
[PHP-DB] PHP/MySQL beginner group project
Site: http://www.handheldspecs.com Benefit for helping: Better your PHP/MySQL Know what color/java/phone/game/handheld/mp3/radio/bluetooth to buy (yes Nokia-Ngage does all this) Link on front page of your choice MySQL people aren't necessarily PHP programmers. The site is in PHP so I picked here. If this project is not welcome here pls tell me where to post since it is php/mysql and in php and I apologize now to hope stop the abuse :) If you see the site you know it has sorry db design. My friend suggested this: use three tables. At first glance, it may seem more complicated, but will make your work much easier in the long run. HandHeldNames ID (integer, automatically assigned) Name (String, unique) Fields ID (integer, automatically assigned) Name (String, unique) Type (if necessary. There are several ways of doing this) HandHeldSpecs Name (integer, joined to the ID of HandHeldNames) Field (integer, joined to the ID of Fields table) Value (String. There are several ways of doing this, actually) For instance, what you currently have on the handheldspecs.com site would have the following values HandHeldNames ID | Name 1 | Motorola T720 2 | Nokia 3 | Emerson Fields ID | Name 1 | Screen Width 2 | Screen Height 3 | Pixelsx 4 | Pixelsy 5 | Java Support 6 | Color 7 | Bandwidth 8 | image HandHeldSpecs Name | Field | Value 1| 1 | 1 1| 2 | 2 1| 3 | 320 1| 4 | 200 1| 5 | yes (or 1 or however you want to represent booleans) 1| 6 | yes 1| 7 | 19 1| 8 | (the image file name, for instance) ... I like this very much. It relates to the posts about generated select boxes. It would be real easy to add info to it and it is a fun newbie project for me to learn php/mysql as I can barely connect and make queries. thx. please lets be happy friends. - Do you Yahoo!? Free online calendar with sync to Outlook(TM).
[PHP-DB] how to update field without using UPDATE query?
how to update field without using UPDATE query? I open the db at a certain ID then set $dbrec['field'] = new value How do you update the db? Thanks -steve - Do you Yahoo!? Free online calendar with sync to Outlook(TM).
Re: [PHP-DB] how to update field without using UPDATE query? you are kidding?
Hi in asp it lets me say ~get a record into dbrec which is a database object. dbrec['field1'] = 'wow' dbrec.update; is there no way to do this in linux? thats lame if it is then that means my 25 web sites have to be re-written to work on Linux. --- Becoming Digital [EMAIL PROTECTED] wrote: I assume you lack update permissions, which means you probably don't have the other permissions necessary to change data. Assuming you actually do, you could use REPLACE or DELETE followed by INSERT. Edward Dudlik Becoming Digital www.becomingdigital.com - Original Message - From: Steve B. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, 09 June, 2003 19:29 Subject: [PHP-DB] how to update field without using UPDATE query? how to update field without using UPDATE query? I open the db at a certain ID then set $dbrec['field'] = new value How do you update the db? Thanks -steve - Do you Yahoo!? Free online calendar with sync to Outlook(TM). -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] how to update field without using UPDATE query? you are kidding?
It sounds like you are crying John. Perhaps you know this function? I'm trying to learn PHP holmes. Keep the insults to yourself and help out if you know the answer. --- John W. Holmes [EMAIL PROTECTED] wrote: in asp it lets me say ~get a record into dbrec which is a database object. dbrec['field1'] = 'wow' dbrec.update; is there no way to do this in linux? thats lame if it is then that means my 25 web sites have to be re-written to work on Linux. Okay, you're still confused. This has nothing to do with Linux. It's PHP vs. ASP. ASP has provided you a function to use instead of making an UPDATE query yourself. Learn some PHP so you can write your own update() query. Don't cry because someone hasn't done it for you already. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Way to update field thx Digital
This souce generates a form for editing a database record. It 'manually' puts code for the most important fields at top. It worked in asp despite repeating fields in array list. form action='update.php?ID=? echo $dbrec[ID]; ?' method='POST' Streetnum: input name=Streetnum value='? echo $dbrec[Streetnum]; ?'br Streetname: input name=Streetname value='? echo $dbrec[Streetname]; ?' p/p Complex Name: input name=Complexname value='? echo $dbrec[ComplexName]; ?'br (this is printed for address under active listings)p/p Subdivision: input name=Subdivision value='? echo $dbrec[Subdivision]; ?'br Beds: input name=Beds value='? echo $dbrec[Beds]; ?'br BathsTotal: input name=BathsTotal value='? echo $dbrec[BathsTotal]; ?'br SqFtTotal: input name=SqFtTotal value='? echo $dbrec[SqFtTotal]; ?'br ListPriceLow: input name=ListPriceLow value='? echo $dbrec[ListPriceLow]; ?'br ListStatus: input name=ListStatus value='? echo $dbrec[ListStatus]; ?'br(Active=act, Pending=pend, Sold=closd)br input type=submit value=Update this listing ? print p/pDetailed info for this item is belowp/p; } while (list($k,$v)=each($dbrec)) { echo $knbsp;input type='text' value='$v' name='$k'BR; } ? /form The asp code now converted to php came out like this: ? $sql=SELECT * FROM lsm where ID = .$HTTP_GET_VARS[ID]; $result=query($sql);if (!$result) die('sql error'); $dbrec=getrec($result); if ($dbrec) { $dbrec[Complexname]=$HTTP_POST_VARS[Complexname]; $dbrec[Subdivision]=$HTTP_POST_VARS[Subdivision]; $dbrec[Beds]=$HTTP_POST_VARS[Beds]; $dbrec[BathsTotal]=$HTTP_POST_VARS[BathsTotal]; if ($HTTP_POST_VARS[SqFtTotal]!=) $dbrec[SqFtTotal]=$HTTP_POST_VARS[SqFtTotal]; $dbrec[ListPriceLow]=$HTTP_POST_VARS[ListPriceLow]; $dbrec[Streetnum]=$HTTP_POST_VARS[Streetnum]; $dbrec[Streetname]=$HTTP_POST_VARS[Streetname]; updrec($dbrec,'lsm','ID'); } ? where updrec is jibberish now- in .asp it looped the form and set the db fields then executed dbrec.update() Yes I could make a form that loops the db fields and an update page that loops the form fields and creates an UPDATE string. This is the correct way yes? The reason I'm asking is because I have more sites and this will take a lot of editing and also I'd like to understand the differences here- for instance if it is all asp objects doing this for me then it is possible to write ones in php that do same? Sorry if I get php/mysql terms confused. I see linux running a mysql server and a php interpreter that calls mysql server right? --- Becoming Digital [EMAIL PROTECTED] wrote: I'm sorry, but that is the most confusing question I've heard in some time. The operating system has nothing to do with your ability to update the DB. That is a user permissions issue. If you're referring to PHP as Linux, I can see where the confusion came from. I'd like to help you. So I can attempt to do that, let's see the ASP code you're trying to convert to PHP. Edward Dudlik Becoming Digital www.becomingdigital.com - Original Message - From: Steve B. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, 09 June, 2003 22:14 Subject: Re: [PHP-DB] how to update field without using UPDATE query? you are kidding? Hi in asp it lets me say ~get a record into dbrec which is a database object. dbrec['field1'] = 'wow' dbrec.update; is there no way to do this in linux? thats lame if it is then that means my 25 web sites have to be re-written to work on Linux. --- Becoming Digital [EMAIL PROTECTED] wrote: I assume you lack update permissions, which means you probably don't have the other permissions necessary to change data. Assuming you actually do, you could use REPLACE or DELETE followed by INSERT. Edward Dudlik Becoming Digital www.becomingdigital.com - Original Message - From: Steve B. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, 09 June, 2003 19:29 Subject: [PHP-DB] how to update field without using UPDATE query? how to update field without using UPDATE query? I open the db at a certain ID then set $dbrec['field'] = new value How do you update the db? Thanks -steve - Do you Yahoo!? Free online calendar with sync to Outlook(TM). -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- 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 __ Do you
[PHP-DB] php to make form field for each column then update page.
Hi, I have used asp2php to convert an asp site and the update page does not iterate the form contents. This part saves me making a giant form by making it dynamically- $dbrec=getrec($result); form... while (list($k,$v)=each($dbrec)) { echo $knbsp;input type='text' value='$v' name='$k'BR; submit/form... I've spent the day looking around the net and haven't found it. Mainly I don't know what to search for - mostly tried 'dynamic forms' in google... Any help making update page iterate form contents and update db? I'd like to know a way to do it without an update statement- by opening that record, setting the fields then updating it. Do you know example of this? Thanks -Steve __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Printing date as 04-06-03
Hi all, M-D-Y with leading 0 is how I would like to print dates at my exciting web page. I am trying DATE_FORMAT and my provider locked up?? :(= How would you print this? thx steve http://www.aifiles.com __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP Home 2.2.8
Hi All Has anyone upgraded from PHP Home Edition 2.2.3 (from sourceforge.net) to version 2.2.8 ? and if so were there any issues? Steve Dodkins _ IMPORTANT NOTICE This email (including any attachments) is meant only for the intended recipient. It may also contain confidential and privileged information. If you are not the intended recipient, any reliance on, use, disclosure, distribution or copying of this email or attachments is strictly prohibited. This email 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-DB] posting variables
Hi When I use FORM ACTION=?php echo $_SERVER['PHP_SELF']; ? METHOD=POST INPUT TYPE=submit NAME=submitp VALUE=Sendp INPUT TYPE=submit NAME=submitn VALUE=Sendn to attempt to control variables in the script the variables are not kept and are refreshed every post, how can i ensure they are kept as below? { $lim1 = ($lim1 + 10); echo $lim1; echo is set; } else { echo is not set; $lim1 = ($lim1 + 20); echo $lim1; } Regards Steve Dodkins _ IMPORTANT NOTICE This email (including any attachments) is meant only for the intended recipient. It may also contain confidential and privileged information. If you are not the intended recipient, any reliance on, use, disclosure, distribution or copying of this email or attachments is strictly prohibited. This email 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-DB] Oracle errors not returning w 4.30
Hi all, We recently upgraded to php 4.30 and now our oracle errors are not returning.. This used to work $errmsg = ocierror($err_curs); ocirollback($err_conn); $errtext = $errmsg['message']; TIA Steve -- - Nearly all men can stand adversity, but if you want to test a man's character, give him power. -Abraham Lincoln, U.S. president (1809-1865) Support free speech; visit http://www.efa.org.au/ Heads Together Services Pty Ltd http://www.hts.com.au Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Oracle errors not returning w 4.30
Hey Thies, Weird problem.. I have just discovered that it is not working on only some machines. does it depend on certain environment variables being set either at run time or during compile? Most likely it can't find the ora_messages I would imagine. Regards Steve At 12:41 PM +0100 12/2/03, Thies C. Arntzen wrote: On Wed, Feb 12, 2003 at 07:43:48PM +1100, Steve Farmer wrote: Hi all, We recently upgraded to php 4.30 and now our oracle errors are not returning.. This used to work $errmsg = ocierror($err_curs); ocirollback($err_conn); $errtext = $errmsg['message']; works for me - could you send a _short_ selfcontained script that shows your problem? re, tc -- - Nearly all men can stand adversity, but if you want to test a man's character, give him power. -Abraham Lincoln, U.S. president (1809-1865) Support free speech; visit http://www.efa.org.au/ Heads Together Services Pty Ltd http://www.hts.com.au Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] HTML tags in auth.php script
Check out the auto_prepend configuration option here: http://www.php.net/manual/en/configuration.directives.php I believe you can do this on a per-directory basis, but haven't tried it. -Steve On Friday, January 10, 2003, at 02:56 PM, [EMAIL PROTECTED] wrote: ThX John...One other question. I have an images folder and other 25 sub-folders underneath this folder. Each of this sub-folder is a web album with it own default index.html and thumbnails pics in it. My question is : Is there an easy way of having a folder level access control to the IMAGES folder and not having to get into each of those 25 index.html files and including my auth.php script in there. As of now any one can just type my whole URL upto the sub-folder and get to see my web pics. Thanks in advance. NT -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] SHOW PICTURE FROM DATABASE
On Tuesday, December 31, 2002, at 02:25 AM, nikos wrote: Steve b. the _type is the type of the binary data. From the PHP manual read: $userfile_type - The mime type of the file if the browser provided this information. An example would be image/gif Ok, but it didn't look like you saved the type information in the database, at least it wasn't in your query, so where is it coming from? I mean tacking _type on the variable doesn't magically tell you the mime type except in the case of file uploads (where the type is supplied by the browser), right? Ready to stand corrected... -Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] SHOW PICTURE FROM DATABASE
Some suggestions... On Monday, December 30, 2002, at 03:55 PM, Nikos Gatsis wrote: where showpict.php: $query=SELECT pict FROM pict WHERE pro_id= '$pro_id; (You're missing an end ' there, but apparently that's not the problem) $result=mysql_db_query($database, $query, $conn) or Die (mysql_error()); list($photo)=mysql_fetch_row($result); $type = $photo_type; Where did the $photo_type variable come from? What's in it? if (!empty($photo)) { header(Content-Type: {$type}); I believe this header should be in the form header(Content-Type: image/jpeg) or whatever image type you have. You should probably include an additional header header(Content-Length: . strlen($photo)); echo $photo; } THANX Nikos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Next/Prev 10 lines
Has anyone got some code that will correctly display the next 10 line of a table with prev and next working? Or point me in the right direction for help? 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] Windows vs Linux variable passing
I'm REALLY new at this and someone else actually wrote the following but, can anyone tem me why this works in Windows but not in Linux? It falls through to the NO, it's still not working statement. If I remove the $ in $con from $result = mysql_query(SELECT * FROM mytable WHERE myrow REGEXP \$con\,$db) the nextpage.php will display the rows on the page but not in the header. I'm sure there is a better way to do all this but I don't know how. Any help or suggestions would be greatly appreciated. Thanks, Steve echo h1 ALIGN=\CENTER\First Page Title/h1br; $db = mysql_pconnect(server, , ); mysql_select_db(db,$db); // display individual record if ($row) { $result = mysql_query(SELECT * FROM table WHERE row REGEXP \$row\, $db); } else { $result = mysql_query(SELECT * FROM table, $db); } if ($myrow = mysql_fetch_array($result)) { do { $c = $myrow['row']; $p = $myrow['table']; $comp = strcmp ($c, $z); if ($comp != 0) { printf(h3 ALIGN=\CENTER\a href=\nextpage.php?con=$c\$c/a/h3\n); } $z = $c; } while ($myrow = mysql_fetch_array($result)); } else { // no records to display echo Sorry, no records were found.; } ? br BIFONTP ALIGN=CENTERReturn to: /B/IA HREF=main.htm Home/A/P /body /html nextpage.php html head ?php echo titleNext Page -$con /title; echo link rel=\stylesheet\ type=\text/css\ href=\style.css\ /; echo /head; echo h1 ALIGN=\CENTER\$con/h1br; $db = mysql_connect(myserver, , ); mysql_select_db(mydb,$db); // display myrow from mytable $result = mysql_query(SELECT * FROM mytable WHERE myrow REGEXP \$con\,$db) or die (NO, it's still not working); . . . .etc -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] right join
Hi How do I get the following select to exclude records where labor_qty from labor does not have a record? $result = mysql_query(SELECT labor_ord_no,works_orders_ord_no,works_orders_part_no,works_orders_qty,labor _qty FROM labor RIGHT JOIN works_orders ON labor_ord_no = works_orders_ord_no ORDER BY labor_qty,$link); 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
RE: [PHP-DB] using php4 to connect to mysql (newbie question)
Hi The latest PHP bible is now updated to 4.2 www.troutworks.com -Original Message- From: Snijders, Mark [mailto:[EMAIL PROTECTED]] Sent: 20 November 2002 12:18 To: 'mike karthauser'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] using php4 to connect to mysql (newbie question) read this http://www.php.net/manual/en/ref.mysql.php and other stuff on http://www.php.net good lukck ___ Mark Snijders, Developer Atos Origin Groenewoudeseweg 1, Room VN-515 5621 BA Eindhoven, The Netherlands * : [EMAIL PROTECTED] *:+31 (0)40 - 2785992 (tel) * : +31 (0)40 - 2788729 (fax) The information in this mail is intended only for use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Access to this mail by anyone else than the addressee is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken omitted to be taken in reliance of it, is prohibited and may be unlawful. -Original Message- From: mike karthauser [mailto:[EMAIL PROTECTED]] Sent: woensdag 20 november 2002 13:09 To: [EMAIL PROTECTED] Subject: [PHP-DB] using php4 to connect to mysql (newbie question) hi, I'm new to php and mysql and are trying to find some tutorials that i can work through so i can get my head round connecting php4 to mysql. I have been looking in all the usual places but keep finding php3 examples and also examples using globals on.. The one i have been looking at is http://www.devarticles.com/art/1/23 All fine until it starts using globals... My dev server is running php4.2.3 with globals off, mysql 3.23.52 on freebsd 4.7 stable. Can anyone recommend any good tutorials for my query? thanks mikek -- Mike Karthauser Managing Director - Brightstorm Ltd Email[EMAIL PROTECTED] Web http://www.brightstorm.co.uk Tel 0117 9426653 (office) 07939 252144 (mobile) SnailmailUnit 8, 14 King Square, Bristol BS2 8JJ -- 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] Insert path string into Mysql
On Monday, November 18, 2002, at 01:10 PM, Alan Kelly wrote: $path = 'c:\\demo\\' ; $query = insert into PH_PHOTO (PHOTO_PATH) VALUES ('$path'); $result=mysql_query($query); I would guess that the backslashes are being interpreted once by php when the variable $path is interpolated into the query string (to become c:\demo\) and again by mysql at which point it tries to insert a value for \d. You might try $path = 'c:demo' and see if that works. Or maybe leave the path alone and do the query line like this: $query = insert into PH_PHOTO (PHOTO_PATH) VALUES (' . $path . '); -Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Pull Word Docs
Hi I'm trying to use the following echo a href=\.$myrow[parts_proc].\Procedure/a; where parts_proc contains the document path //ebmnw01/vol1/docs/proc1.doc In Internet Explorer it pulls the document correctly but in Mozilla it tries http:\\192.168.10.50\works\//ebmnw01/vol1/docs/proc1.doc is there another way to represent the document path? 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] sql select
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
RE: [PHP-DB] sql select
Top man!! Many thanks Steve -Original Message- From: [EMAIL PROTECTED] [mailto:epeloke;echoman.com] Sent: 12 November 2002 16:02 To: Php-Db (E-mail) Subject: RE: [PHP-DB] sql select I don't think you can reference the aliased column timea in the select clause, I know sql server won't let you do it..try and (labor_qty*parts_time+parts_setup)labor_time -Original Message- From: Steve Dodkins [mailto:Steve.Dodkins;ebm-ziehl.co.uk] Sent: Tuesday, November 12, 2002 10:16 AM To: Php-Db (E-mail) Subject: [PHP-DB] sql select 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 Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] ROugh idea of speed
Hiya, Just wondering what is the rough idea of speed of a server like this is holding a database with millions of records. I know its difficult, depends on the data stored etc. Its basically storing an index int and about 5 or so char field (50 long). In total I want to store 500 million records. Accessed using PHP. a.. 2x Intel Pentium III 1260 CPU or higher b.. 1 GB RAM c.. 60 GB hard drive d.. 20 GB traffic/month e.. RedHat LInux 7.2 Ive read that its better to store the data in different databases on the same server? Can someone please give me a rough idea of the speed and how many servers needed, my client wants to know how much it will cost to host the site. Anyone have any experience with holding a lot in MySQL? Any idea of speed would be great. Thanks, Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Variables
Hi The following will print the variables ($tim1 and $tim2) correctly but the IF statement using the same vars will not work, it will only work as below which seems to work by comparing the text values of the 2 variables $tim1 $tim2. while($myrow = mysql_fetch_array($result)) { $tim1=timea; $tim2=timeb; if ($tim1 $tim2) { echo TRTD.$myrow[$tim1]./aTD.$myrow[$tim2]./aTD.$myrow[labor_o rd_no]./aTD.$myrow[labor_wkyr]./aTD.$myrow[works_orders_cust omer_id]./aTD.$myrow[works_orders_part_no]./aTD.$myrow[works _orders_qty]./aTD.$myrow[labor_qty]./aTD.$myrow[labor_time] ./aTD.$myrow[timea]; 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
Re: [PHP-DB] MySQL password protection?
You could put it anywhere. Stick it in a text file somewhere, fopen() and read the file for the password. Or keep it in a php script outside of the web root if that's the issue, then just include() it when you need to. Of course any file you put it in will have to be readable by whatever user the webserver is running as. -Steve On Wednesday, November 6, 2002, at 04:16 PM, 1LT John W. Holmes wrote: I was wondering if it is possible to protect my password to the MySQL-server from being in a PHP-script. Now I can't do that, so everybody who gets to see my php-sourcecode also can see my (not protected/not encrypted) password. How can I change this? You can't, unless you want to put it in php.ini or a my.conf file... ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Millions of records in MySQL
Hiya, I remember ages ago that mysql does not properly handle upwards of 10 million records in a table? Any details would be great! Thanks, Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Custom Sort Order in MySQL
Hiya, Just wondering what is the best way to get some data out of a database in cutom order. They all have grades like A*, A, B, C and some are grade Secret. If I sort them by grade secret is at the bottom, I would like this at the top. I realise I could get all the Secret's, then A*, then A as seperate calls, but id prefer to get them all in the correct order as I belive this will be faster. Any help would be very much appreciated. Thanks! Steve
[PHP-DB] MS Access
Hi Has anyone got a sample script that updates/adds and deletes records on an ms access database or can point me to a resource that will have one? 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] Set Cookies
Hi I'm trying to use the following simple script to set cookies but get the following error message cannot add header information - headers are already sent by(output started at c:\program files\php home edition 2\www\listing19.1.php:3) in c:\program files\php home edition 2\www\listing19.1.php on line 4 3 ?php 4 setcookie( vegetable, artichoke, time()+3600, /, $SERVER_NAME, 0 ); 5 ? 6 html 7 head 8 titleListing 19.1/title 9 /head 10 body 11 ?php 12 if ( isset($vegetable ) ) 13 print phello again your chosen veg is $vegetable/p; 14 15 else print phello your 1st visit ?/p; 16 17 ? 18 19 /body 20 /html 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] echo printing a cookie
Hi I'm trying to print the contents of a cookie (php 4.2.3) the syntax below is wrong but what should it be? if ($_cookie[cookiename]== TRUE) { echopyour cookie is $_COOKIE[cookiename]/p; } 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
Re: [PHP-DB] Birthdays!
Yeh but that does not take into account years does it? My table has there birth year, wont that mess it up and not work? I assume I need to do a function only on the months and days?? Thanks! Steve XX -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MS Access Connectivity
Hi I have a problem connecting to ms access over a network as follows. I have set up the system dsn with the correct path, I use odbc_connect( dsn, user, pwd ); to connect. I get a sql error [odbc Microsoft Access Driver] '(unknown)' is not a valid path sql state S1009 in sqlConnect ... If i copy the db to the local drive and amend the system dsn to map to the local drive it works, MS Excel can also connect to the db over the network. Any ideas? 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] postgres cursors
hi, i have a function that returns a cursor. how do i get at it in php? here's my function: create function test3 (INTEGER) RETURNS refcursor AS ' DECLARE cursor1 CURSOR FOR select description FROM t0040stock_item WHERE stock_number = $1; BEGIN open cursor1; return (cursor1); END; ' LANGUAGE 'plpgsql'; thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Dates
Hiya, I am doing a database of things that have dates, some I know the month and year of, some I only know the year. I suppose I could do a field for the year, and one for month, and then allow the month to be NULL. But is there a date type that allows years and / or months??? Thanks, Steve _.-..-```---._..``\--.._ ../\```-._ ``-._ _/_ o \ _.-```.``. \`-._ _=-. _.-`\_\ \ o `.(_`.__./ / |--``-`._##.` -` \ o `. `-`` _` o \#// / \ _.._ \ o _.`--`` _.-`\_.\-`\ | .|`-.___\-` o__.-._. `._..-`` `.\ |/ \__...--`.-`\.-`_.--`. |) | _|.-``\``_...-``\ /`. `. `. // \/.#.`=._ /_ \ \ `._/ \`// \`#`_.--`|_`--.\ __ `. \\_ `. `.`. ``` `--._|__\ `.`._.\-`\ \ `\ \ \ `. ` \ `. `.`. \ | \ `. \ ``-~` \ `. \ _..-` `-``` Stephen Vernon, recently graduated from the University of Sheffield, where I studied Computer Science. I could do with a job! Stephen Vernon Mobile 07971 446 956 Mobile 07971 446 956
RE: [PHP-DB] Session understanding
If you include the other page AFTER you do this check you'll be fine. So run your if statement and then add an else...include other.php; HTH, Steve. -Original Message- From: Rodrigo [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 9:38 AM To: PHP Subject: [PHP-DB] Session understanding Hi people, if i use this code: ?php session_start(); if(empty($_SESSION['username'])) { die('An error has ocurred. It may be that you have not logged in, or that your session has expired. Please try a href=login.phplogging in/a again or contact the a href=mailto:[EMAIL PROTECTED];system administrator/a'); } ? in one page to check if the user is logged, and in this same page i include another page, do i have to put this same test in this page that is beiing included??? this question may be dumb but i don´t knowthnaks a lot for the help. Equipe Pratic Sistemas Rodrigo Corrêa Fone: (14) 441-1700 [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] advise needed for 'authorized only' site
I do pretty much the same thing but with seesion vars, I just check that the user and level session vars are the appropriate values before I display confidential material. -Steve. -Original Message- From: Rob Day [mailto:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 11:22 AM To: 'PHP DB' Subject: RE: [PHP-DB] advise needed for 'authorized only' site I had a similar problem, but I can't promise that my solution is the best way to go about it. After the user was validated, I set a cookie. I then had all subsequent pages start with an if statement that checked for the cookie. If there was no cookie, they were sent back to the entry point. Another option if your application is somehow linear would be to make sure that the referring page is what you wanted it to be. -Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 10:14 AM To: PHP_DB Subject: [PHP-DB] advise needed for 'authorized only' site I have set up a section of my company site for use by authorized dealers only. I am currently using mysql authorization, which works for the first page, but if someone were to type in the url of an underlying page they would be able to get in without authorization. I know I could use .htaccess for handling this but with a minimum of 350 -400 users to keep track of that would be unwieldly to say the least, especially for my boss who doesn't have a clue about *nix and has never even heard of .htaccess. What other options do I have to keep the underlying pages from being accessed without the user being forced to go through the logon screen? Thanks, -- Chip Wiegand Computer Services Simrad, Inc www.simradusa.com [EMAIL PROTECTED] There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corporation, 1977 (They why do I have 9? Somebody help me!) -- 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-DB] Large files using phpMyAdmin
Hiya, So on the net I ask for a dump of my database using myPHPadmin, get a 2mb sql file. Put it in my local copy of myphpadmin and it wont accept it. If I remove some of the lines then it works so I suppose its something to do with the size. Can this be fixed? Is it to do with timeouts? The other problem is that I store pictures in the database, about 1.8mb worth. They look fine on the net but when i download they are messed up!!! They used to till I formatted my hard disk, what have I done wrong? Please! Just a quick note I have not got a command line access to the online server only using myphpadmin and I have tried getting a dump using IE and Netscape to see if it was IE messing the file up! Thanks a lot, Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] what's wrong with this ereg?
Well, one thing is you've got mismatched parentheses. You need another another opening paren right after the if. Also, don't you need to escape the last hyphen in your character sets? As well as the . before the third character set? -Steve On Tuesday, August 20, 2002, at 11:11 AM, [EMAIL PROTECTED] wrote: I am trying an email verification function, like this: if (empty($useremail)) || !eregi(^[A-Za-z0-9\_-]+@[A-Za-z0-9\_-] +.[A-Za-z0-9\_-]+.*, $email)) { $errmsg .= The email address appears to be invalid\n; } But it will not work, on one server I get this error: Parse error: parse error in /home/virtual/site109/fst/var/www/html/auth_dealers/user_input2.php on line 70 and on another server I get this error: Parse error: parse error, unexpected T_BOOLEAN_OR in /usr/local/apache/htdocs/auth_dealers/user_input2.php on line 70 What do I need to do to fix this? -- Chip Wiegand Computer Services Simrad, Inc www.simradusa.com [EMAIL PROTECTED] There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corporation, 1977 (They why do I have 9? Somebody help me!) -- 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] time field query problems.
Thanks, I wasn't sure what kind of field to use, I'll give the timestamp a try and set 0 as default. Regards, Steve. -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Monday, July 29, 2002 6:34 PM To: Steve Bradwell; [EMAIL PROTECTED]; Php-Db (E-mail) Subject: Re: [PHP-DB] time field query problems. Steve, For some reason the below statement is not working. Can anyone tell me why? Select EDIT_LOCK from ordmaster where EDIT_LOCK + INTERVAL 10 MINUTE now() AND ORDER_NO = '5' AND EDIT_LOCK 0; -EDIT_LOCK is a MySQL (ver 3.23.49-max) time field, allows nulls, default is NULL. If this cannot be done in a query, whats the best way to compare time in php? The best way to compare time in PHP is to use the MySQL RDBMS that is managing/retrieving the data for you. Recommendation 1: do not use a Time field (you did mean the back 'half' of a Date-time field didn't you?). Because you are (apparently only) using this field to temporarily lock a row, the value is only ever used for computation (cf display). A Timestamp field is best for computation - a Time field for presentation. Consider also storing such data as an integer field or beware the automatic update feature for Timestamp fields. Recommendation 2: re-consider the (default) use of NULL - this may be the root of the question you're asking: what if the row has never been 'locked' and attempt the (above) SELECT? (then the last comparison clause would be illogical) If the default were zero (0 or 00:00:00) and the retrieval logic updated slightly, things should be less complicated. Regards, =dn - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] time field query problems.
Ya I checked and the manual said that with a version 3.23 or higher you can use + and - signs instead of the date_add subtract. Either way it just returns null. Ever tried somthing like this? Thanks, Steve. -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Monday, July 29, 2002 3:13 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] time field query problems. On Tuesday 30 July 2002 02:41, Steve Bradwell wrote: Sorry to repost but I typed in the wrong sql statement in my previous post. For some reason the below statement is not working. Can anyone tell me why? Select EDIT_LOCK from ordmaster where EDIT_LOCK + INTERVAL 10 MINUTE now() AND ORDER_NO = '5' AND EDIT_LOCK 0; I think you have to use something like: ... WHERE DATE_ADD(EDIT_LOCK, ...) ... Check manual for details. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Intuition, however illogical, is recognized as a command prerogative. -- Kirk, Obsession, stardate 3620.7 */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] time field query problems.
Sorry to repost but I typed in the wrong sql statement in my previous post. For some reason the below statement is not working. Can anyone tell me why? Select EDIT_LOCK from ordmaster where EDIT_LOCK + INTERVAL 10 MINUTE now() AND ORDER_NO = '5' AND EDIT_LOCK 0; -EDIT_LOCK is a MySQL (ver 3.23.49-max) time field, allows nulls, default is NULL. If this cannot be done in a query, whats the best way to compare time in php? Thanks, Steve. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] or statement in url
How about http://www.xyz.com/foo.php?FooID[]=1FooID[]=2 Then FooID will be an array of the values. -Steve On Thursday, July 18, 2002, at 03:20 PM, Matthew K. Gold wrote: can I use an OR operator in a variable that is passed through a url? ex. how can I combine the following two lines so that I end up with records that have an id of either 1 or 2? http://www.xyz.com/foo.php?FooID=1 http://www.xyz.com/foo.php?FooID=2 (I tried the following, but it didn't work: http://www.xyz.com/foo.php?FooID=1||FooID=2 ) thanks in advance for your help. Matt -- 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] PHP database
Hi, I would try to convince the admin that a DB like MYSql (which is actually part of the standard install under Redhat now) is much more secure than storing data in text files !! HTH Steve At 11:02 AM +0200 15/7/02, Tomator wrote: Hello I'm to have database, but server's administrator refuses to install MySQL nor PHP MySQL support :( He told me he won't install it and I should use textfiles if I want to have database. I don't want to write engine to textfiles, so... Can You point where can I find PHP code which realize basic database functions without installing any not standard functions nor modules on unix/linux server? -- - Minds are like parachutes, they work best when open Support free speech; visit http://www.efa.org.au/ Heads Together Systems Pty Ltd http://www.hts.com.au Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] header function
What's on line 3 of Auth_user.php ? If you have anything outside of the ?php ... ? tags it will start the html output. Even just an empty line. -steve On Monday, July 15, 2002, at 04:09 PM, Mohammad Forouhar-Fard wrote: Hi, I have a problem with function header(Location:xy.php?var=2). I have not any text (print echo or display any text) at all before I set a cookie If I try to execute this function of Apache server in my Company it is all auf OK. But if I try to run at home I have even the same error Cannot add header information - headers already sent by (output started at C:\httpd\HTDOCS\Auth_user.php on line 3 Can somebody help my I have at home this configuration: I have Winxp OmniHTTPd/2.09 Server. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] OCIPLogon , maximum number of sessions apache/php - Oracle
Hi all, Does anyone know how many sessions can be opened by apache/php to Oracle using OCIPlogon, or what parameter setting controls this? TIA Steve -- - Minds are like parachutes, they work best when open Support free speech; visit http://www.efa.org.au/ Heads Together Systems Pty Ltd http://www.hts.com.au Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] OCIPLogon , maximum number of sessions apache/php- Oracle
Hi Michael, So what you are saying is that apache/php will keep opening sessions until oracle runs out of processes or cursors or memory or hits session_per_user maximum ?? I was thinking of experimenting with the profile parameter IDLE_TIME Profile Parameter to make oracle close open sessions after a certain amount of time , have you any experience with this? I have open_cursors = 500 processes = 200 max_enabled_roles = 30 regards Steve At 8:24 AM +0200 9/7/02, Michael Bretterklieber wrote: Hi, this depends on your settings in the initinstance.ora in the directory /opt/oracle/OraHome1/admin/instance/pfile dir. Here are some settings: processes = 150 open_cursors = 300 max_enabled_roles = 30 you also have to set the sizes of the shared-memory pool. bye, Steve Farmer wrote: Hi all, Does anyone know how many sessions can be opened by apache/php to Oracle using OCIPlogon, or what parameter setting controls this? TIA Steve -- -- Michael Bretterklieber LCP JAWA Management Software GmbH Liebenauer Hauptstr. 200 A-8041 GRAZ Tel: ++43-(0)316-403274-12 Fax: ++43-(0)316-403274-10 GSM: ++43-(0)676-93 96 698 [EMAIL PROTECTED] homepage: http://www.jawa.at - privat --- E-mail: [EMAIL PROTECTED] homepage: http://www.inode.at/mbretter -- ...the number of UNIX installations has grown to 10, with more expected... - Dennis Ritchie and Ken Thompson, June 1972 -- - Minds are like parachutes, they work best when open Support free speech; visit http://www.efa.org.au/ Heads Together Systems Pty Ltd http://www.hts.com.au Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Delete from multiple tables with php
Hi, What is the best way to simulate the following delete statement with php to MySQL 3.23..? $sql = DELETE ordlines.*, ordmaster.* FROM ordlines, ordmaster; $sql.= WHERE ordlines.ORDER_NO ='.$order.'; From what I've read MySQL doesn't support deletes from multiple tables. TIA, Steve. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Oracle IDLE_TIME Profile Parameter plogon
Hi, At 1:40 PM +0200 8/7/02, B. PERRINE wrote: We are using these ORACLE PARAMETERS, but we don't use plogon; too problems. Instead, we use one logon per request. Is any one really use plogon successfully with Oracle Database 8i and more ? I am using plogon with no problems, apache is compiled with enable-sigchild on It is only one DB that is causing me any drama ! Regards Steve Le lun 08/07/2002 à 05:45, Steve Farmer a écrit : HI all, I was wondering if anyone had experimented with the Oracle Profile parameters such as IDLE_TIME, CONNECT_TIME or SESSIONS_PER_USER in order to control the number of connections apache/php makes to the Oracle DB when using plogon? I was thinking of experimenting with this and wondered if anyone had any pointers? Regards Steve Farmer -- - Minds are like parachutes, they work best when open Support free speech; visit http://www.efa.org.au/ Heads Together Systems Pty Ltd http://www.hts.com.au Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Oracle IDLE_TIME Profile Parameter plogon
HI all, I was wondering if anyone had experimented with the Oracle Profile parameters such as IDLE_TIME, CONNECT_TIME or SESSIONS_PER_USER in order to control the number of connections apache/php makes to the Oracle DB when using plogon? I was thinking of experimenting with this and wondered if anyone had any pointers? Regards Steve Farmer -- - Minds are like parachutes, they work best when open Support free speech; visit http://www.efa.org.au/ Heads Together Systems Pty Ltd http://www.hts.com.au Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Usiing FOREACH to loop through Array
At 3:27 PM -0700 6/29/02, Brad Melendy wrote: Hi All, I've stumped myself here. In a nutshell, I have a function that returns my array based on a SQL query and here's the code: -begin code--- function getCourses($UID) { global $link; $result = mysql_query( SELECT C.CourseName FROM tblcourses C, tblusers U, tblEnrollment E WHERE C.ID = E.CourseID AND E.UserID = U.ID AND U.ID = $UID, $link ); if ( ! $result ) die ( getRow fatal error: .mysql_error() ); return mysql_fetch_array( $result ); } end code I call this from a PHP page with the following code: begin code-- $myCourses = getCourses($session[id]); foreach ($myCourses as $value) { print br$value; } end code--- Now, when I test the SQL from my function directly on the database, it returns just want I want it to return but it isn't working that way on my PHP page. For results where there is a single entry, I am getting the same entry TWICE and for records with more than a single entry I am getting ONLY the FIRST entry TWICE. Now I know my SQL code is correct (I am testing it against a MySQL database using MySQL-Front) so I suspect I'm doing something stupid in my foreach loop. I think your problem lies in a misunderstanding of the mysql_fetch_array() function. It doesn't return the entire result set in an array - just one record at a time. You can fix this in one of two ways: (1) Loop though the entire result set in your function: function getCourses($UID) { global $link; $ResultSet = array(); $result = mysql_query( SELECT C.CourseName FROM tblcourses C, tblusers U, tblEnrollment E WHERE C.ID = E.CourseID AND E.UserID = U.ID AND U.ID = $UID, $link ); if ( ! $result ) die ( getRow fatal error: .mysql_error() ); while ($Row = mysql_fetch_array( $result )) { $ResultSet[] = $Row['C.CourseName']; } return $ResultSet; } ... $myCourses = getCourses($session[id]); foreach ($myCourses as $value) { print br$value; } or (2) set a flag in getCourses() so that the query is only executed once, otherwise returning a result line - something like: function getCourses($UID) global $link; static $result = false; if (!$result) { $result = mysql_query( SELECT C.CourseName FROM tblcourses C, tblusers U, tblEnrollment E WHERE C.ID = E.CourseID AND E.UserID = U.ID AND U.ID = $UID, $link ); if ( ! $result ) die ( getRow fatal error: .mysql_error() ); } { return mysql_fetch_array( $result ); } ... while ($Row = getCourses($session[id]) as $value) { print br, $Row['C.CourseName']; } (standard caveats about off-top-of-head, untested code apply) The reason you are getting the first record TWICE is becaouse of the default behaviour of the mysql_fetch_array() function. It returns both an associative array - ie, elements of the form field-name = value - and a numerically indexed array (0, 1, 2, etc.). You can alter this behaviour by the second parameter of the function: see http://www.php.net/manual/en/function.mysql-fetch-array.php -steve I'm hoping someone will spot my dumb mistake. Thanks very much for any help at all on this. Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- ++ | Steve Edberg [EMAIL PROTECTED] | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | ++ | The end to politics as usual: | | The Monster Raving Loony Party (http://www.omrlp.com/) | ++ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Usiing FOREACH to loop through Array
Oops! It's hot, it's Saturday, brain not functioning at 100%, made cut'n'paste error: SNIP or (2) set a flag in getCourses() so that the query is only executed once, otherwise returning a result line - something like: function getCourses($UID) global $link; static $result = false; if (!$result) { $result = mysql_query( SELECT C.CourseName FROM tblcourses C, tblusers U, tblEnrollment E WHERE C.ID = E.CourseID AND E.UserID = U.ID AND U.ID = $UID, $link ); if ( ! $result ) die ( getRow fatal error: .mysql_error() ); } { return mysql_fetch_array( $result ); } ... while ($Row = getCourses($session[id]) as $value) { print br, $Row['C.CourseName']; } SNIP This last block of code should be while ($Row = getCourses($session[id])) { print br, $Row['C.CourseName']; } -steve -- ++ | Steve Edberg [EMAIL PROTECTED] | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | ++ | The end to politics as usual: | | The Monster Raving Loony Party (http://www.omrlp.com/) | ++ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] what the heck? (elementary question)
On Monday, June 24, 2002, at 01:52 PM, Matthew Crouch wrote: this bit from my index page is giving me 2 headaches: 1. it isn't passing anything into the URL 2. the page that gets called (name.php) sits and tries to load forever. it looks like it's even filling up my hard drive with data (?!) Note: it does this (#2) even if I type in the URL with a variable and value, like name.php?lastname=smith ? printf (form method=\post\ action=\name.php?lastname=%s\, $lastname); ? div align=center input type=Text name=lastname size=75 input type=Submit name=submit value=Search for Last Name /div /form /div Can you do a get and a post at the same time? Tacking the lastname onto the url as in action=\name.php?lastname=%s\ is using a get method, but your form is supposed to set lastname using the post method. Is there some reason you want your script to set one version of lastname and let the user type in a different version of lastname? If so try using the post method with an input type=hidden name=otherlastname value=$lastname. -Steve -- 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] sql standard
Hi, In Oracle they are all UPPERCASE !! Rgds Steve At 11:15 PM -0400 23/6/02, Gerard Samuel wrote: Hope someone can confirm this. I was moving a mysql dump to postgresql, and I had 2 tables with MiXeD upper/lower case letters, that got converted to lowercase. I found a discussion that sql column/table/database names should be lowercase. Just trying to keep in line with a standard. Thanks -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- - Minds are like parachutes, they work best when open Support free speech; visit http://www.efa.org.au/ Heads Together Systems Pty Ltd http://www.hts.com.au Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Innodb and transactions.
So should I be using Innodb tables or BDB tables? Thanks, Steve. -Original Message- From: Michael Bretterklieber [mailto:[EMAIL PROTECTED]] Sent: Friday, June 21, 2002 2:49 AM To: Php-Db (E-mail) Subject: Re: [PHP-DB] Innodb and transactions. Hi, you have to do something like this: mysql_query('SET AUTOCOMMIT=0'); mysql_query('COMMIT'); or mysql_query('ROLLBACK'); mysql_query('SET AUTOCOMMIT=1'); bye, Steve Bradwell schrieb: Hi all, I have just figured out and set up my Innodb on my mysql server so I can use transactions Begin, commit, rollback. I'm now looking for examples on how to do this with php. I hit the php site and the best I could find was fbsql_commit etc... is this what I'm looking for? There's no documentation yet. I'm using php4 with mysql 3.23.49-max, and my tables are Innodb. I appologize if my lingo is somewhat confusing or just wrong but I'm pretty new to this stuff. Any input or examples would be greatly appreciated. Thanks, Steve. -- -- Michael Bretterklieber LCP JAWA Management Software GmbH Liebenauer Hauptstr. 200 A-8041 GRAZ Tel: ++43-(0)316-403274-12 Fax: ++43-(0)316-403274-10 GSM: ++43-(0)676-93 96 698 [EMAIL PROTECTED] homepage: http://www.jawa.at - privat --- E-mail: [EMAIL PROTECTED] homepage: http://www.inode.at/mbretter -- ...the number of UNIX installations has grown to 10, with more expected... - Dennis Ritchie and Ken Thompson, June 1972 -- 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] Innodb and transactions.
Great! thanks for your help. -Steve. -Original Message- From: Michael Bretterklieber [mailto:[EMAIL PROTECTED]] Sent: Friday, June 21, 2002 9:11 AM To: Php-Db (E-mail) Subject: Re: [PHP-DB] Innodb and transactions. Hi, use InnoDB, because InnoDB supports row-level locking, and InnoDB also supports referential-integrity, bye, Steve Bradwell schrieb: So should I be using Innodb tables or BDB tables? Thanks, Steve. -Original Message- From: Michael Bretterklieber [mailto:[EMAIL PROTECTED]] Sent: Friday, June 21, 2002 2:49 AM To: Php-Db (E-mail) Subject: Re: [PHP-DB] Innodb and transactions. Hi, you have to do something like this: mysql_query('SET AUTOCOMMIT=0'); mysql_query('COMMIT'); or mysql_query('ROLLBACK'); mysql_query('SET AUTOCOMMIT=1'); bye, Steve Bradwell schrieb: Hi all, I have just figured out and set up my Innodb on my mysql server so I can use transactions Begin, commit, rollback. I'm now looking for examples on how to do this with php. I hit the php site and the best I could find was fbsql_commit etc... is this what I'm looking for? There's no documentation yet. I'm using php4 with mysql 3.23.49-max, and my tables are Innodb. I appologize if my lingo is somewhat confusing or just wrong but I'm pretty new to this stuff. Any input or examples would be greatly appreciated. Thanks, Steve. -- -- Michael Bretterklieber LCP JAWA Management Software GmbH Liebenauer Hauptstr. 200 A-8041 GRAZ Tel: ++43-(0)316-403274-12 Fax: ++43-(0)316-403274-10 GSM: ++43-(0)676-93 96 698 [EMAIL PROTECTED] homepage: http://www.jawa.at - privat --- E-mail: [EMAIL PROTECTED] homepage: http://www.inode.at/mbretter -- ...the number of UNIX installations has grown to 10, with more expected... - Dennis Ritchie and Ken Thompson, June 1972 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Innodb and transactions.
Hi all, I have just figured out and set up my Innodb on my mysql server so I can use transactions Begin, commit, rollback. I'm now looking for examples on how to do this with php. I hit the php site and the best I could find was fbsql_commit etc... is this what I'm looking for? There's no documentation yet. I'm using php4 with mysql 3.23.49-max, and my tables are Innodb. I appologize if my lingo is somewhat confusing or just wrong but I'm pretty new to this stuff. Any input or examples would be greatly appreciated. Thanks, Steve. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] dba_delete() problems
Hello all, I've got a bit of a problem at the moment. I'm using the dba_ functions to do some simple database access, and I have the need to delete some items from the database from time to time. When dba_delete() is called, it returns true, indicating that the key/value pair was deleted. After making the deletions, dba_sync() is called. The problem is, the database size never decreases no matter how much you delete (even if you remove every item). On examination of the .dbm files in text editor, I found that all the data from every key/value pair was still there, and hadn't been removed as I wanted it to. This is extremely bad for the database, because it grows constantly with no way to decrease the size other than flat out deleting it, which I don't want to do. Am I doing something wrong with deleting the keys, or is this an issue with dba? Notes: I'm using Apache 1.3.24 and PHP 4.2.1 on Windows XP Professional. The database is accessed using the db3 handler. Thank you in advance for any replies, Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] THIS IS A HOAX !!! WARNING !!Re: [PHP-DB] Virus alarm!
Folks, check anti virus sites this is a hoax and will destroy your windows system !! regards Steve At 11:25 AM +0200 16/5/02, Trond Erling Hundal wrote: Jeg fikk en mail fra en I adresseboken min om et nytt virus, som hadde slettet hele harddisken hans! Jeg fant da også ut at jeg hadde blitt infisert av samme virus, og siden du står I adresseboken min kan du også være infisert. For å sjekke om du har fått viruset, gjør dette: 1. Klikk på start - søk 3. Merk av for at du vil søke på hele harddisken. 2. Skriv: sulfnbk.exe, og trykk på søk. 4. Dersom du finner programmet, IKKE START DET. Slett det, og deretter slett det fra papirkurven. 5. Send advarsel videre til alle I adresseboken din. ENGLISH: I recently discovered a virus on my computer that none of my antivirus programs could detect. It spreads through the adressbook, and since you are in my addressbook, I am warning you. The virus deletes everything on your harddisk after 14 days! Here's how you can detect it, and delete it: 1. Go to start - search. 2. Look in all the harddrives on your computer (C:, D:, E: etc) 3. search for a file named: sulfnbk.exe 4. If you find it delete it, then delete it from your recycle bin. 5. Warn everyone who is in your adressbook! Med vennlig hilsen Trond Erling Hundal Daglig leder Epost: [EMAIL PROTECTED] Internett: www.innovationmanagement.no Telefon: 73 54 03 80 Mobil: 918 41 117 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- - Minds are like parachutes, they work best when open Support free speech; visit http://www.efa.org.au/ Heads Together Systems Pty Ltd http://www.hts.com.au Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] indexing
Hi all, More of a database question here, my apologies: I've been doing some reading on indexes but I thought I should get an experienced persons input. My question is about Over Indexing. I have a MySQL MyISAM table that stores inventory transactions, in, out etc. I store numeric fields that are primary indexes in other tables, 2 datetime fields and a qty field, Paul DuBois' MySQL book says that anything used in a where clause or join clause is a candidate for an index. It turns out that 7 out of eight fields fit this description,1 primary key, 4 smallints, and 2 are datetime fields. Should I use all these indexes or is this overkill? Thanks for any input Steve. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Date of Birth From Form
A combination of strtotime() and date() can make this easy. date(Y-m-d, strtotime($birthday)) Or see docs and comments at http://www.php.net/manual/en/function.strtotime.php -Steve On Friday, April 19, 2002, at 01:29 PM, Brandon Paul wrote: Hey all, I have a credit application form, and one of the required elements is the applicant's Date of Birth. I have creditapp table with a birthdate field and it is a DATE datatype. On the form, I want to be able to have them enter their Date of Birth as mm/dd/ and have it go into the database properly (-mm-dd). Is there a way to do it this way, or am I going about it wrong? Any help would be greatly appreciated. Thanks! Brandon -- 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