[PHP-DB] Please point me in the right direction.......
I have a question about contracts or agreements. I am considering hiring a local company to do some coding for us in LAMP to augment what we have done already. I have a problem with the standard we own the code and copyright clause in thier service agreement. Can someone point me to the correct mailing list as I don't wish to start an inapropriate thread. Thank you. -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: More help with restore server
I fixed my problem, for those that are interested. I have now discovered the beauty of compiling from source. I ended up downloading php from the php.org site and compiled it. It repaired all php/mysql relationships and files and fixed my problem. These is latest of several occurances (not just php/mysql) where I was able to solve a problem by skipping the rpm and just compiling from source. Has anyone else found this to be the case? On Wednesday 27 October 2004 02:42 pm, Michael Cortes wrote: Here is another situation I find myself in. I did a rm -rf /var/* installed a new harddrive as /dev/hdd0. I installed the old harddrive as hdd1. I did a new installation of 7.3 on hdd0 and copied the old /home and /etc to hdd0. I have the email server back, the dns back, am working on the web site. I was just finishing up and restoring a php/mysql calendar and I got an error call to undefined function: mysql_connect() I get dependency errors like php = 4.1.2-7.3.6 is needed bye php-imap-4.1.2-7.3.6 so i rpm -U php-4.1.2-7.3.6.i386.rpm and I get package php-devel-4.1.2-7.3.6 is already installed so I rpm -q php and i get php-4.1.2-7 -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] More help with restore server
I just seem to be full of it, questions these days. Here is another situation I find myself in. I did a rm -rf /var/* Yeah, yeah I know. So getting beyond the oops factor, I have been recreating the server. I installed a new harddrive as /dev/hdd0. I installed the old harddrive as hdd1. I did a new installation of 7.3 on hdd0 and copied the old /home and /etc to hdd0. I will be upgrading to newer versions of rh and then probably migrating to fc2 or white box linux. For now, I wanted to recover my machine to it's previous state. It is our DNS, email and web server. I have the email server back, the dns back, am working on the web site. I was just finishing up and restoring a php/mysql calendar and I got an error call to undefined function: mysql_connect() I googled and it seemed to suggest I needed some updates or php or mysql packages installed. I then d/l'ed from ftp.redhat.com/pub/redhat/linux/updates/7.3/en/os/i386/ (which i assume are the last updates for 7.3) to hdd1 and I just tried to rpm -U mysql* and php* I get dependency errors like php = 4.1.2-7.3.6 is needed bye php-imap-4.1.2-7.3.6 so i rpm -U php-4.1.2-7.3.6.i386.rpm and I get package php-devel-4.1.2-7.3.6 is already installed so I rpm -q php and i get php-4.1.2-7 Something seems obviously wrong. I f anyone has ideas, I would welcome them. -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] I have a CR-LF problem when pulling stuff out of my DB
This may not be exaxtly PHP-DB related but it is a result of screwing something up grin. I pulled a bunch of data from a DOS formatted tab seperated file and now I am dumping back out into a text file (on linux). So, as you can imagine, I ended up with a bunch of ^M throughout the file. I plan on fixing this. The solution is easy enough. I just need to remember to open the text files in vim and save as unix files. However, I now have an immediate need. I want to open these five files in vim and find and replace the ^M in every instance. I know how to find and replace (:g/find//s/replace/g). But I cannot get the ^M in the string. If I actually hit ctrl-m it reads as a return; if I type ^M using the shift-6 then it looks for the actual characters. Can anyone help? -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] I have a CR-LF problem when pulling stuff out of my DB
That didn't work. Here's why. This is not a dos file. It is a unix file but when dumping the data from my db, some fields had a trailing CR and LF. So what I ended up with was a ^M showing in the middle of a line when I open the file in vim. And... the lines will also end where they shouldn't. What is supposed to be one line, then continues on the next. While dos2unix did strip out the ^m, it left the LF (is it return or linefeed in unix) at the end of the line, starting a new one. I need to actually do a search on ^M followed by LF and replace it with nothing so I get my full line back. But I don't know how to enter in LF or CR in a vim search string. Hope this clarifies. On Thursday 19 August 2004 08:50 am, Russell Johnson wrote: Actually, an easier tool to use is dos2unix, which is available on most Linux boxes. Just type dos2unix [filename], and you should be all set. -Mensaje original- De: Michael Cortes [mailto:[EMAIL PROTECTED] Enviado el: Thursday, August 19, 2004 1:36 PM Para: [EMAIL PROTECTED] Asunto: [PHP-DB] I have a CR-LF problem when pulling stuff out of my DB However, I now have an immediate need. I want to open these five files in vim and find and replace the ^M in every instance. I know how to find and replace (:g/find//s/replace/g). But I cannot get the ^M in the string. If I actually hit ctrl-m it reads as a return; if I type ^M using the shift-6 then it looks for the actual characters. Can anyone help? -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] I have a CR-LF problem when pulling stuff out of my DB
I found part of the answer.. when doing a search in vim you can hit ctrl-m as long as you hit ctrl-v first. ctrl-v tells vim to treat the following as a character, not to do the action i.e... carriage return. Now I need just one more piece, if anyone has the answer: ctrl-m is a carriage return. Does anyone know what ctrl seqence is line feed? Thanks On Thursday 19 August 2004 09:49 am, Michael Cortes wrote: That didn't work. Here's why. This is not a dos file. It is a unix file but when dumping the data from my db, some fields had a trailing CR and LF. So what I ended up with was a ^M showing in the middle of a line when I open the file in vim. And... the lines will also end where they shouldn't. What is supposed to be one line, then continues on the next. While dos2unix did strip out the ^m, it left the LF (is it return or linefeed in unix) at the end of the line, starting a new one. I need to actually do a search on ^M followed by LF and replace it with nothing so I get my full line back. But I don't know how to enter in LF or CR in a vim search string. Hope this clarifies. -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Maximum execution time of 30 seconds exceeded
Duhhh. me mike. me like cumputors. This is where the honest geek admits his mistakes. I had a do while loop such as do { mysql_query ($qupdate, $link); $rslterror=mysql_error($link); $number++ } while ($rslterror!=null); I was trying to insert a new record with $number being a field requiring a uniqe number. If it failed, it should up the number by one and try again. I still don't have that working properly, but that wasn't my endless loop problem. You may have notice that I used a query ($qupdate) above. I defined $qinsert earlier on in my script and should of used it instead of $qupdate. $qupdate was undefined and therefore caused an edless loop. Anyway, I fixed my dumb mistake. If anyone would like to help me with a better one, maybe you can tell me if I am doing my do while correctly. It's only running through once, not getting a succesful insert and dropping out. Thanks On Monday 11 August 2003 02:02 am, Michael Cortes wrote: I am using the Konqueror browser and browing to http://localhost/my.php Howerver, the script I wrote, doing various queries and lookups, inserts, etc.. takes a while to complete. That is fine with me. I'll wait. However, the server and/or browser will not wait. I believe the server is the one which will not wait because I have one echo line at the beginning of the script which put a title Udate Students athe the top center of the page and that writes then there is a pause while the queries are run and then I get the following error in my browser Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/html/student_info/ps2follett.php on line 139 Can anyone help? -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Maximum execution time of 30 seconds exceeded
This worked great. I am keeping a table of available PINs for each of my groups of students. I rewrote the code to get a random number from the table and if if it updates the student successfully, it deletes the number from the availables table. Thanks a lot! On Monday 11 August 2003 03:09 pm, Mike Brum wrote: Why is it important that you recycle old PINs? This is most likely eating up the most time in your script execution. My suggestion would be to either A) just keep creating a new one and ignore ones when a child leaves or B) create a 2nd, much smaller table available_pins and when a child leaves, insert their former PIN into this table. Then upon executing the new student script, you check the available_pin table for rows 0. If so, use the first one. If not, give them a new one. Good luck. -M -Original Message- From: Michael Cortes [mailto:[EMAIL PROTECTED] Sent: Monday, August 11, 2003 2:57 PM To: Ben Lake Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Maximum execution time of 30 seconds exceeded I do have an auto_increment for the record id. But that is just a way for me to uniquely id the record. Student numbers, barcodes, etc can change. The reason I am using the do/while loop is: Every student is getting a 4digit pin for library, cafeteria and network access. It has to be unique and we have been assigning a different range of numbers per building/grade. There are various procedural reasons for this. I have verified that I am identifying the new student correctly and going into the do/while loop with a variable that holds the correct starting number for the appropriate pin range. It's then just a matter of trying consecutive numbers till I find an available pin. The pin may be available because a student left the school or because it's next available at the end of the line. Anyway, I was not aware I could pick and choose my ranges in an AUTO_INCREMENT field. I appreciate any thoughts you may have. Thanks. On Monday 11 August 2003 02:41 pm, you wrote: Why don't you use an AUTO_INCREMENT field in your table to define a unique number? Ben -Original Message- I had a do while loop such as do { mysql_query ($qupdate, $link); $rslterror=mysql_error($link); $number++ } while ($rslterror!=null); Anyway, I fixed my dumb mistake. If anyone would like to help me with a better one, maybe you can tell me if I am doing my do while correctly. It's only running through once, not getting a succesful insert and dropping out. Thanks -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Left Join with more than two tables......
Thanks. I couldn't find the correct syntax in my resources. I tried at one point to use commas like: select * from table1 left join table2,table3 on table1.id=table2.id,table1.id=table3.id Thanks again for the correct syntax. On Tuesday 12 August 2003 04:00 pm, Brent Baisley wrote: The left join works the same for two or more tables. select * from table1 left join table2 on table1.id=table2.id left join table3 on table1.id=table3.id ... Just specify the table you want to join and what to use to join them. On Tuesday, August 12, 2003, at 03:16 PM, Michael Cortes wrote: I know that we can .. select last_name,first_name, table2.school from table1 left join table2 on school_id=bldg_id Listing all students and giving the school name for all students, if they have one. If not, it lists the kid anyway and leaves that field blank. Anyhow, how about multiple tables? I can't find it with google. I have : table1 with the students table2 with library PINs and an autoincrement id table3 with a lunch status and an autoincrement id I want to list all students (I will select just certain fields) but if they have it, I want to list the PIN from table2 and the lunch status from table3. I can do it as a join but then anystudent who doesn't cross-reference gets left out. I need to list all students. -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Maximum execution time of 30 seconds exceeded
I do have an auto_increment for the record id. But that is just a way for me to uniquely id the record. Student numbers, barcodes, etc can change. The reason I am using the do/while loop is: Every student is getting a 4digit pin for library, cafeteria and network access. It has to be unique and we have been assigning a different range of numbers per building/grade. There are various procedural reasons for this. I have verified that I am identifying the new student correctly and going into the do/while loop with a variable that holds the correct starting number for the appropriate pin range. It's then just a matter of trying consecutive numbers till I find an available pin. The pin may be available because a student left the school or because it's next available at the end of the line. Anyway, I was not aware I could pick and choose my ranges in an AUTO_INCREMENT field. I appreciate any thoughts you may have. Thanks. On Monday 11 August 2003 02:41 pm, you wrote: Why don't you use an AUTO_INCREMENT field in your table to define a unique number? Ben -Original Message- I had a do while loop such as do { mysql_query ($qupdate, $link); $rslterror=mysql_error($link); $number++ } while ($rslterror!=null); Anyway, I fixed my dumb mistake. If anyone would like to help me with a better one, maybe you can tell me if I am doing my do while correctly. It's only running through once, not getting a succesful insert and dropping out. Thanks -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Don't know why query works this way
I have been writing my queries like this... $link = mysql_connect ($host, $username, $password); $query = insert into $table ('joe', 15); if ( mysql_db_query($dbname, $query, $link)){ } But then I was reading that I should use mysl_query instead of mysql_db_query. But I was having a problem with where do i put the $dbname. When I used: mysql_query ($dbname, $query, $link) I got an error message saying i had too many arguments. So I changed it to: mysql_query ($query, $link) I then got an error message saying it didn't know what database I was connected to. I finally got around the problem by including the database name in the query, like so: $query = insert into $dbname.$table ('joe', 15); I shouldn't have to say, but this is a simplified example. I didn't want to include all the fields, tables, values that the true example has. The question is, am I doing this right? Do I have no choice but to retype the $dbname all over the place if I want to use mysql_query? Thank in advance for any help. -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Left Join with more than two tables......
I know that we can .. select last_name,first_name, table2.school from table1 left join table2 on school_id=bldg_id Listing all students and giving the school name for all students, if they have one. If not, it lists the kid anyway and leaves that field blank. Anyhow, how about multiple tables? I can't find it with google. I have : table1 with the students table2 with library PINs and an autoincrement id table3 with a lunch status and an autoincrement id I want to list all students (I will select just certain fields) but if they have it, I want to list the PIN from table2 and the lunch status from table3. I can do it as a join but then anystudent who doesn't cross-reference gets left out. I need to list all students. -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Maximum execution time of 30 seconds exceeded
I am using the Konqueror browser and browing to http://localhost/my.php Howerver, the script I wrote, doing various queries and lookups, inserts, etc.. takes a while to complete. That is fine with me. I'll wait. However, the server and/or browser will not wait. I believe the server is the one which will not wait because I have one echo line at the beginning of the script which put a title Udate Students athe the top center of the page and that writes then there is a pause while the queries are run and then I get the following error in my browser Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/html/student_info/ps2follett.php on line 139 Can anyone help? -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] If select query doesn't net any results
I am a programming novice and just created my first php application. However I have a situation I don't know the answer to. My db queries (mysql) are written like this: $qtrans= select * from $table where (conditionals) order by some field; $link=mysql_connect ($host, $user, $password); $result=mysql_db_query($dbname, $qtrans, $link); while ($row = mysql_fetch_array($result)) { do stuff with the array here } I would like to created an if statement that only occurs if the query gets a result. If there are no records that meet the query conditionals and my array ends up with null, I do not want my if statement to take place. Is this easy enough to do? Any help would be great. Thank you, Michael Cortes Fort LeBoeuf School District 34 East 9th Street PO Box 810 Waterford PA 16411-0810 814.796.4795 Fax1 814.796.3358 Fax2 978-389-1258 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] OT... distribution under the GPL
This is probably off topic..I hope someone can help. How do I go about distributing a php program (collection, scripts, whatever) under the GPL? Thank you for any help you may give in pointing me in the right direction. M.Cortes Fort LeBoeuf School District -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] OT...where do I go for this......?
I realize this is off topic, not php db interfacing. However, it is php and I am hoping someone can point me to a mailing list that would cover this question. So here goes I am working on a simple inventory program and am running into the following messageMethod Not Allowed The requested method POST is not allowed for the URL/cafe_inventory/choose.php. Apache/1.3.23 Server at (domain.net) Port 80 I have been researching this and cannot get it fixed. I believe it may have to do with Bastille. I used Bastille about 2 years ago and 3 versions ago. I've updated the RH on this server several times but just recently added php and we plan to use it as our application server, if I can get this problem solved. If anyone can think of a mailing list, chat room, or even paid tech support to help me with this problem, I would greatly appreciate it. Thank you, Michael Cortes Fort LeBoeuf School District 34 East 9th Street PO Box 810 Waterford PA 16411-0810 814.796.4795 Fax1 814.796.3358 Fax2 978-389-1258 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] OT...where do I go for this......?
I just checked and register_globals are on in php.ini. I have also previously been in the httpd.conf in my previous attempts to fix this problem. I have googled my fingers off and all fixes have mentioned the conf file for apache. I have played with options ExecCGI as well as other options as per google search results. BTW... I am trying to use the POST method in my php scripts. On 10 Oct 2002 at 10:20, Naved, Masroor wrote: Michael, The easist way of fixing this is to turn register_globals on. It is defaulted to off since a few versions ago, I believe. However, there are some security concerns you should be aware of with this option. Google around for some discuss about this. On 10 Oct 2002 at 12:09, John W. Holmes wrote: That would be an Apache configuration issue. Somewhere in http.conf, I think, you can choose whether or not to allow GET/POST operations. -Original Message- I am working on a simple inventory program and am running into the following messageMethod Not Allowed The requested method POST is not allowed for the URL/cafe_inventory/choose.php. Apache/1.3.23 Server at (domain.net) Port 80 If anyone can think of a mailing list, chat room, or even paid tech support to help me with this problem, I would greatly appreciate it. Michael Cortes Fort LeBoeuf School District 34 East 9th Street PO Box 810 Waterford PA 16411-0810 814.796.4795 Fax1 814.796.3358 Fax2 978-389-1258 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: AW: [PHP-DB] OT...where do I go for this......?
This is what I have in my config file: # The following is for PHP4 (conficts with PHP/FI, below): #IfModule mod_php4.c AddType application/x-httpd-php .php4 .php3 .phtml .php AddType application/x-httpd-php-source .phps #/IfModule # The following is for PHP3: #IfModule mod_php3.c AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3-source .phps #/IfModule # The following is for PHP/FI (PHP2): IfModule mod_php.c AddType application/x-httpd-php .phtml /IfModule You can probably tell that I have commented out some of my IfModule statements. I kept getting a repeated theme of the AddType statements not being active in my google searches. I figured I could test by comment out the if and making them active all the time. On 10 Oct 2002 at 18:59, Thomas Lamy wrote: Have you checked apache's config file for: AddType application/x-httpd-php .php AddType application/x-httpd-php .php4 AddType application/x-httpd-php-source.phps BTW... I am trying to use the POST method in my php scripts. On 10 Oct 2002 at 10:20, Naved, Masroor wrote: -Original Message- I am working on a simple inventory program and am running into the following messageMethod Not Allowed The requested method POST is not allowed for the URL/cafe_inventory/choose.php. Apache/1.3.23 Server at (domain.net) Port 80 If anyone can think of a mailing list, chat room, or even paid tech support to help me with this problem, I would greatly appreciate it. Michael Cortes Fort LeBoeuf School District 34 East 9th Street PO Box 810 Waterford PA 16411-0810 814.796.4795 Fax1 814.796.3358 Fax2 978-389-1258 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Help with code
I don't know if this is the place for a new programmer to get help. But here goes.. // list items and get input for today's item uses/receipts print (tr align=center valign=top\n); print (td align=left valign=topselect name=itemchoiceoptionChoose Item/o ption\n); I am using the following code to let my users choose from a list of inventory items: $userarray = mysql_fetch_array($resultuser); while ($itemarray = mysql_fetch_array($resultitem)) { print (option value=$itemarray[description]$itemarray[description]/option\n); } print (/select\n); print (/td\n); Some example items from which they choose areapple sauce, case, 12/8oz and Beef, Patties Lean, A627, 40#, gov. My problem is such. When they choose and item and submit the transaction. $qtrans = insert into $tbltrans values('0', 'daily', '$building', '$itemchoice', '0', '$count', '0', '$ddate', '$cat'); I am loosing all of item description after the first comma. Beef, Patties Lean, A627, 40, gov turns into Beef,. Can anyone help? Michael Cortes Fort LeBoeuf School District 34 East 9th Street PO Box 810 Waterford PA 16411-0810 814.796.4795 Fax1 814.796.3358 Fax2 978-389-1258 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php