[PHP-DB] RE: Assistance on Query
Hi People, I would like some assistance on the following scenario. I have to pull out all records for a particular userid (easy enough) and then only show those entries where the follwing occurs. These records from the table will contain either an entry in the services_type field or the non_services_type field. What I need to do is show only those where the number of consecutive records that contain an entry in the non_services_type field is greater than or equal to 3 so example:- record 1 contains an entry in non_services_type record 2 contains an entry in services_type record 3 contains an entry in non_services_type record 4 contains an entry in non_services_type record 5 contains an entry in non_services_type record 6 contains an entry in services_type so I would need to display records 3,4,5 only Can anyone assist me with this? Cheers, Shannon When you do your while ($row = mysql_fetch_assoc($result)) { ... } you will need to keep a list of consecutive records. Try this: ?php $i = 0; $j = 0; while ($row = mysql_fetch_assoc($result)) { $current_string = ( !empty($row['non_services_type']) ) ? 'non_services_type' : 'services_type' ; if ($previous_string == $current_string) { $i++; if ($i = 3) { $records[$j] = $row; $j++; } } else { $i = 0; $previous_string = $current_string; } } ? Then simply echo $records. This may have some bugs to iron out, but this is a way to get the job done, please reply if you have found a better way. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] RE: php-db Digest 16 Jan 2005 13:41:28 -0000 Issue 2777
From: [EMAIL PROTECTED] To: php-db@lists.php.net Subject: php-db Digest 16 Jan 2005 13:41:28 - Issue 2777 Date: 16 Jan 2005 13:41:28 - php-db Digest 16 Jan 2005 13:41:28 - Issue 2777 Topics (messages 38151 through 38154): Re: Integrating Interbase.so and PHP 38151 by: Doug Thompson Re: MySQL db sync 38152 by: Bastien Koert Adding Up MySQL Results 38153 by: Nathan Mealey Assistance on Query 38154 by: Shannon Doyle Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-db@lists.php.net -- php-db_38151.ezm php-db_38152.ezm php-db_38153.ezm php-db_38154.ezm -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Final Year Computer Science Project involving PHP
Well, it's not Java, PHP, or Mysql, but if you want a challenging project then have a look at libmcal http://sourceforge.net/projects/libmcal/ It's meant to provide calendar services and includes the beginnings of an icap server - which is to a calendar what IMAP is to email. There is also a PHP libmcal module to allow you access to the mstore backend (the horde project uses this a one type of calendar storage). There is also a shell of gtk calendar app but it would be more interesting to write a bonobo / kpart plugin for it. Right now the project has stagnated, it's tricky to install, and probably has a few bugs, and also has stuff yet to be implemented. This is a challenging project worthy of a very high mark (if you, or anyone else, can get it working that is). HTH, Paul On Fri, 2002-07-12 at 16:13, Serdar Sokmen wrote: Hi, Please read the rest of this email if you're interested in helping final year Computer Science student (yes, that's me...) by giving him some ideas on his final year project very possible involving PHP and SQL... I will start next autumn my third year of Computer Science studies. I have to carry out a large programming project in this final year. These projects are supervised and assessed via a dissertation and an oral presentation. The project alone counts for 20% of my whole degree, so it is quite important. A variety of project proposals have been made available for our consideration already but they all look very dull and boring. We are also encouraged to come up with our own project ideas. The onus is on us to define the problem boundaries, to investigate possible solutions, and to present the results verbally, in writing and (possibly) to demonstrate in action. They like having projects that find solutions (or improve a current sloution) real life problems. This summer, I am doing an internship in a Swiss IT company, working on a Content Management System implemented with PHP and MySQL. This will obviously give me some valuable experience with these languages (I sort of already learn them quite well...) and most of our tuition in Uni is based on Java. If you can think of an interestin final year project involving hese languages, it would be very kind to share it with me... In order to obtain a very high mark, the project needs to be challenging. For example, having an e-commerce web-site using a Database is seen as a weak, non-innovative project... Many Thanks for your time Serdar Sokmen [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- - Paul Cooper | Tel: 0121 331 7858 Senior Programmer and Database Engineer | Fax: 0121 331 7859 UCEcom | mailto:[EMAIL PROTECTED] University of Central England | http://www.ucecom.com Birmingham, B4 7DX | - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP linux interbase Apache
On Thu, Sep 06, 2001 at 03:38:18PM +0100, Stephane MOREL wrote: Thank you for your answer after a glance on the net I have found I need interbase.so. This is not present on my disk do you how can I retrieve it steph How and where did you intsall interbase - it's been a while so I forget. I think the rpm version installs itself in /opt/interbase (you can check with rpm -ql interbase). If that is the case then you need to configure with ./configure --with-apxs=/path/to/apxs --with-interbase=/opt/interbase --enable-track-vars Paul Meir Kriheli a écrit : On Thursday 06 September 2001 13:31, Stephane MOREL wrote: Hi all I'm new on PHP. I've installed PHP interbase Apache correctly. But I would like to connect Interbase database through PHP. So I enable interbase support for php by doing this : ./configure --with-interbase --with-apache --enabled-track-vars if you compile with --with-apache, you'll have to recompile apache too. You can compile it as a shared module --with-apxs=path to your apxs. Note: you'll need Apache development stuff (Depends on your distro). Any way after running make install make sure you've restarted Apache. make make install Evreything works fine When I do this : ? $conn=ibase_connect(192.168.2.2:/opt/interbase/examples/employee.gdb, SYSDBA, masterkey); if (!$conn) { echo Access Denied!; exit; } ? my browser say :Call to undifined function :ibase_connect. I understood that I must enable the extension in php.ini. I think the extension was automatically added to my php.ini but I can not find any entry in php.ini for interbase. If someone could help TIA Steph -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- - Paul Cooper | Tel: 0121 331 7858 Senior Programmer and Database Engineer | Fax: 0121 331 7859 UCEcom | mailto:[EMAIL PROTECTED] University of Central England | http://www.ucecom.com Birmingham, B4 7DX | - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] passing object elements in urls
On Tue, Feb 06, 2001 at 05:46:25PM +, Darryl Friesen wrote: Got a slight problem. I'm attempting to pass a number of variables from one form to another. The problem occurs when one of the object elements contains more than one word. [snip] Any idea how to pass object elements with spaces in a URL? Try encoding the spaces as %20 (the hex value for a space). There's probably a PHP function to do this for you (and one to do the reverse) -- I haven't looked. Yes there are: urlencode() and urldecode() http://www.php.net/manual/en/function.urlencode.php http://www.php.net/manual/en/function.urldecode.php Paul You could try using a + instead of a space too. - Darryl -- Darryl Friesen, B.Sc., Programmer/Analyst[EMAIL PROTECTED] Education Research Technology Services, http://gollum.usask.ca/ Department of Computing Services, University of Saskatchewan -- "Go not to the Elves for counsel, for they will say both no and yes" -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- - Paul Cooper | Tel: 0121 331 7858 Senior Programmer and Database Engineer | Fax: 0121 687 7859 UCEcom | mailto:[EMAIL PROTECTED] University of Central England | http://www.ucecom.com Birmingham, B4 7DX | - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]