GROUP BY Php Syntax Needed
I'm having trouble figuring out the PHP syntax to display GROUP BY results.
Here's my MySQL query:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Pattern Syntax Help Needed
I am trying to insert an astrisk (*) in front of a particular Selection field in an HTML file. The purpose of this would be to mark fields that have missing or incorrect data from a form post. But alas, I am having trouble getting the pattern syntax right. This is what I have so far:
GROUP BY...
I've a little problem with GROUP BY for my query: SELECT `rel_experience_client`.`client_ref`, `client`.`id`, `rel_experience_client`.`experience_ref`, `experience`.`id` AS `id1`, `experience`.`titre_fr`, `client`.`libelle` FROM `rel_experience_client` INNER JOIN `client` `client1` ON (`rel_experience_client`.`client_ref` = `client1`.`id`) INNER JOIN `experience` ON (`rel_experience_client`.`experience_ref` = `experience`.`id`) RIGHT OUTER JOIN `client` ON (`rel_experience_client`.`client_ref` = `client`.`id`) ORDER BY `client`.`libelle`
[XML] Is There An XML Group?
I've typed an XML source which calls a CSS source, the result should be a page displayed in IE6, instead I see the XML source. That's pretty logical since there a no XHTML tags for IE6 to interpret. I'm looking for a discussion group like'comp.lang.xml' but I can't find one.
Group By Problem
I am trying to use group by but whenever I run the page only 3 rows are displayed, 1 of each type. This is my code: $result = mysql_query("SELECT * FROM programs group by type order by name desc", $link) or die ("query 1: " . mysql_error());
Add A Group On Server
I have a php page which calls an exe through exec function. This exe add a group on the server. The problem is that I don't have the permissions to create a new group (Control Panel/ Administrative Tools/ Computer Management/...) even if I change the settings of Security for the user aimed. So, the execution failed and the server returns me "Error 5".
PHP MySQL, Group By
I'm building an XML news feed search engine, using PHP and MySQL, and I am basing the style on Google. I have achieved almost everything I have set out to do but... I would now like to incorporate the feature Google has were it shows 2 results from a website, and one is indented, and there's an additional link "More results from XYZ.com". I've been fiddling around with GROUP BY, but, I would like to limit the group size to 2. Just like Google.
GROUP BY On A DATETIME
Is there an MySQL query to group data on year-month using datetime(YYYY-MM-DD HH:MM:SS)?
Mysql Group?
I'm having trouble coming up with what I would assume is a rather simple mysql query about retrieving records that haven't been updated after a certain time.
Group An Array
i have the following array: Array ( [0] =Array ( [0] =Leamore Windows Ltd [1] =553398833511417 [2] =20 ) [1] =Array ( [0] =HRPC [1] =920589205210538 [2] =1 ) [2] =Array ( [0] =Leamore Windows Ltd [1] =553398833511417 [2] =2 ) ) is it possible to group the items in the array and order by name to output the following: Array ( [0] =Array ( [0] =HRPC [1] =920589205210538 [2] =1 ) [1] =Array ( [0] =Leamore Windows Ltd [1] =553398833511417 [2] =22 ) )
MySQLi Group
I have started a new group for those of us here that may run into issues specifically with MySQLi in PHP5.
Group By Date
so i got some data on a mysql table that i want to group by date i was thinking of SELECT song_name,DATE_FORMAT(date, '%m - %d - %y') as dates FROM tra_artist_song GROUP BY DATE how do make every data under the same date appear under that date
Group Script
Is there a php script that is similar to Yahoo Groups/ MSN Groups that I can download? I don't want to use Yahoo Groups cause it has ADs and not much customization. I want to put it on my website and customize it myself.
How To Group Timestamps By Date?
This might be an idiot question, but how do you group by timestamps by date? I mean, given a large number of timestamps, spanning many months, how do grab them and say how many are from each day? If the timestamps measure visits to a web site, how to easily say there were 45 visits on January 4th? The first idea that occurs to me is to put them all in an array and then loop through the array and use date() on each, one at a time, finding out the date of each and then adding up how many for each date. But I'm wondering if PHP has a more direct, obvious command?
Running As Different User And Group
It's a common problem when trying to install apps like this on hosted (virtual host) sites, that the app wants to run as the Apache user/group. Inlcuding wrx permissions on various directories. The problem the web directory are normal user home directories, so the user/group are the same as the userid. Which leads the directories bye given "world" read/write/exicute prev. Which seem to me a major secruity issue. </Rant> My question is where and how can I change the userid/group that TikiWiki expect, starting with the inital DB conncect string.
GROUP BY Clause Not Working
I'm using PHP 5 to make an ODBC connection to an MS Access database using PEAR and I'm getting DB Error: Syntax Error when using the GROUP BY clause. Here's my query: SELECT * FROM HardwareInstallationsSummary WHERE LocationID = $loc_ID GROUP BY EquipmentTypeID
Group Error Checking
Need to check a group of form inputs and want to run them in a group instead of separate statements. This is what i have so far and no luck any suggestions. I just put the form fields as variables in these to test and this is a far as I got before I realized this may not be the best way. Any suggestions? Code:
How To Group Similar Strings?
I am using PHP to build a system, the system will be provided with a number of sentences. I need to make an algorithm which can group the sentences on the basis of similarity e.g I have following senteces: "Musharraf vows that Nawaz Sharif will be arrested on his return because he is in exile because of the agreement he signed." "Maria Sharapova seems to be very deterministic about her new ambition, she can win the title." "The presedent of Paksitan: Musharraf is facing a lot of difficulties at Home, at one side Supreme court has ruled against him and on the other side Nawaz Sharif is comming back." Now if I have a number of sentences (may be in thousands), I need to write an algo which can group first and the third sentence, and grop 2nd alone.
SUMS And GROUP Tutorial
I'm looking for a tutorial on how to use SUMS and GROUPS to display data from an SQL database. I've had a quick look round but can't find the basics! I'm already familiar with displaying the data as it is but not performing calculations. Could someone point me in the right direction.
Group Based Privilege Systems
Trying to figure out the best way to implement a user/group system using PHP and MySQL, and I was wondering if any of you have any thoughts on the subject. Each webpage I design will have a corresponding entry in a module database table and they will be verified using PHP_SELF. For instance. When you visit index.php, there will be a function that queries a database against PHP_SELF and looks for index.php to find out if it has any special group privileges (if they can edit something or just view it etc) if there are no group privileges then it will be assumed that everyone can do everything on that particular webpage. The users groups that he is a member of, will be held in sessions when the user logs on. What do you think? is this a common way of doing it? is it secure?
Assigning Variables From Array When Using 'group'
I want to use this query to set variables. The number of variables is consistent, but sometimes the result does not return that same number.. ie one date range may have items from group2,6 and 7, while other date ranges have items in all groups. The query: Code: "SELECT e_group, sum(amount * quantity) as total FROM expense where e_date between '$arr1_date'"." and '$dep1_date' GROUP BY e_group"; (variables for dates are already defined elswhere in the form) Here is what the table looks like: Code:
Sort A Group Of Nodes By Attribute? How?
I have the following XML file: <?xml version="1.0" encoding="iso-8859-1"?> <items> <item line="2">all that glitters is gold,</item> <item line="1">Theres a lady thats sure,</item> <item line="3">and she's buying a stairway to heaven</item> </items> To output this code Im using the following PHP: $xmldoc = domxml_open_file('stairway.xml', DOMXML_LOAD_DONT_KEEP_BLANKS); $node = $xmldoc->document_element(); if ($xmldoc->has_child_nodes()) { $node = $node->first_child(); $endwhile = false; while ($endwhile != true) { echo $node->get_content() . "<br />"; if ($node->next_sibling()) { $node = $node->next_sibling(); }else{ $endwhile = true; } } } This does what it supposed to do except I want to ensure that it outputs nodes ordered by 'line' attribute. The obvious answer would be to put them in order in the XML file and the above example is very simple so that you get the point, the real life example however will be much larger and encase anyone put something in the wrong order it would muck up my presentation. How could I adapt my code above to allow my nodes to be sorted? I dont mind the nodes being out of order in the physical file (stairway.xml) but when they are output using my script, I want them to be ordered.
MySQL - What Do I Need? GROUP BY? Nested SELECT?
I am stumped (or maybe just too durned tired). Here's what I got... CREATE TABLE `nodecat_map` ( `nodecat_id` mediumint(8) unsigned NOT NULL auto_increment, `nodecat_cat_id` mediumint(8) unsigned NOT NULL default Ɔ', `nodecat_node_id` mediumint(8) unsigned NOT NULL default Ɔ', PRIMARY KEY (`nodecat_id`), KEY `nodecat_cat_id` (`nodecat_cat_id`), KEY `nodecat_node_id` (`nodecat_node_id`) ) TYPE=MyISAM; CREATE TABLE `nodes` ( `node_id` mediumint(8) unsigned NOT NULL auto_increment, `node_content_id` mediumint(8) unsigned NOT NULL default Ɔ', PRIMARY KEY (`node_id`), KEY `node_content_id` (`node_content_id`) ) TYPE=MyISAM; CREATE TABLE `text` ( `text_id` mediumint(8) unsigned NOT NULL auto_increment, `text_content_id` mediumint(8) unsigned NOT NULL default Ɔ', `text_text` mediumtext NOT NULL default '', `text_timestamp_dt` int(11) NOT NULL default Ɔ', PRIMARY KEY (`text_id`), KEY `text_content_id` (`text_content_id`) ) TYPE=MyISAM; Plus a 'CAT' table not shown, but referred to in NODECAT_MAP by NODECAT_CAT_ID. I don't want to spend too much time explaining how/why the tables are organized like this, but here's a basic rundown of their relationships: 1) NODECAT_MAP maps NODES to CATS (categories, basically folders), with many NODES associated with a single CAT. 2) A NODE is basically a document whose content is stored in a TEXT record, and in order to track multiple revisions of a NODE document many TEXT records can be associated with a single NODE. Here's what I CAN do ... Given a CAT_ID (in this instance "5") I can successfully return all records with the following query: SELECT ncat.*, n.*, txt.* FROM nodecat_map ncat LEFT JOIN nodes n ON ncat.nodecat_node_id=n.node_id LEFT JOIN text txt ON n.node_content_id=txt.text_content_id WHERE ncat.nodecat_cat_id=5 ORDER BY ncat.nodecat_id DESC, txt.text_timestamp_dt DESC ;
PHP User Group Forming In Louisville, KY
I've been attempting for some time now to put together a PHP user group in Louisville, KY USA. If you're interested in this idea, please join the PHP meetup at http://php.meetup.com . I would really much enjoy meeting other PHP developers in my area.
GROUP BY And DISTINCT Query Problem
I am trying to write a query that will pull dates from a date column (cl_date) in a table (calendar_League) without giving me the same date more than once. On top of that I am also trying to only return results that are >= todays date. Code:
If/Else Statment Within An Select/Option Group
I want to create an update query in a form so that I can update my groups attendance. The variables 100% are working and are pulling the correct info. In the update attendance column, I would like an If else statement that says if the attend_status == present echo SELECTED VALUE="", so that the pull down menu will display the current attendance value. From there I will select the new update attendance info and then submit it using an update query. Below is the code. I am running into other problems with the quotation marks in such because this is all located within the <php> tags. Code:
Radio Button Group Value Caption
I have 2 radio buttons in a group named Gender one being male and one being female, now how would i get the value from the user's choice out of the two radio buttons and assign it to an $Gender variable..?
Format SQL To Display Data In A Group?
Can any one tell me if there is a way to display data from a MySQL DB in groups? For example: May: Item 1 1/05/2007 Item 2 2/05/2007 Item 3 3/05/2007 June: Item 4 1/06/2007 Item 5 2/06/2007 Item 6 3/06/2007 And so on... Obviously i would be after having a title of that current month etc. But would need the data to go and update on its own, so once may has gone, June would be he first month, if you see what i mean?
Web Calendar Group/individual View Events?
There seem to be a lot of web calendars out there and I am having a tough time sorting out which ones to even try - a lot of the more popular ones were created 2 or 3 years ago. Can anyone recommend a good one that uses php and mysql preferably? One of the main uses would be for family to indicate their holidays so all in the family can see. Thus, it would require a group/public feature that allows users to see all "public" holidays or just their own holidays.
Help Starting W/ User, Group Mgmt And Mvc's
Hey all, very new to PHP and want to try it out on a project (on which I have lots of time to learn) that authenticates logins, manages users and groups, and which pages they get access to. Normally I do a lot of work in Java and use different MVC frameworks like webwork, spring, hibernate, etc. Anyone point me in the directions of examples and great books that I need to know to do this right?
Create Radio Button Group WHERE Other Fields Can Disappear?
I'm trying to create radio buttons on my form where if one radio button is selected, then other fields disappear. Here is classic example: Do you have a passport? o NO o YES, if so Date issued: [date pull down menu] See what i mean? If the user clicks NO, then the "yes" selection as well as the Date pull down menu will turn grey so that the user cannot select it anymore. Is it possible doing this without reloading the page?
Http://groups.google.com/group/comp.lang.php
Methods & Tools is a free e-newsletter for software developers, testers and project managers. Summer 2007 issue's content: * Agile Tool Selection Strategy for Web Testing Tools * What's Wrong with Agile Approaches * Mocking the Embedded World: Test-Driven Development, Continuous Integration, and Design Patterns * Personal Quality Management with the Personal Software Process 60 pages of software development knowledge.
CRON Scripts Fail To Access Group-shared Directories
I have CRON scripts with owner/group relationship of "phillip/apache" that need to access directories within the docroot. The directories, if I create them, will have owner/group relationship of "phillip/apache", and all is well since they are all group-accessible (permissions of 0770). However, I have a web app within the docroot that has the ability to spawn folders of its own. These folders will, of course have owner/group relationship of "apache/apache", and for security purposes must also have permissions of 0770. When my CRON scripts accesses the "phillip/apache" folders, all is well. However, when it access the "apache/apache" folders, I get a PHP warning "Permission Denied" when trying to access these folders using this: Code: ( php )
Group-Office / IMAP EMail - Wrong Date Display ??!!
I installed the Community Version of the Group-Software GroupOffice (http://www.group-office.com) on my Webserver. Group-Office got a module for webmail (IMAP/POP3 eMail-Server). I copied my mail on my IMAP-Server. There are two diffentent views form the mails, a Listview and a Detailview of the selected mail. I think in the Listview there is a wrong eMaildate - Itīs the date the mail saved on the server. In my case there are many mails with the same date, because I copied a lot of them at the same day in the IMAP Folder. The Detailview displays the right emaildate, the date of sending the mail. There are two different PHP-Files, one for the listenview (messages.php) und one for the datailview (message.php). I think I found the lines of each file for retrieving and displaying the dates. Code:
Help Needed..
I am Ronny from Germany, so please excuse my English. Since early 2002 I am trying to solve th following problem: I am trying to programm a meta search engine - which fetches the results of about 10 search engines. Now I solved the problem with fopen(), fread() etc. But it is to slow - and so my question is : Is it possible to make several http requests at the same time in PHP or do you know a Perl Program where I can put in maybe 10 URLīs and the results where saved in an array which I can use in PHP???
NOW() Help Needed
I am putting data into a mysql database, the database tells me the time a user signed up, this is placed in the table using the now function but the date always shows as 2002/11/06 not how i would like it, i want it to view as 06/11/2002, i think it can be manipulated in many ways. Also on manually updating a further table i have to place in a date manually, when i put the date in the fiels using phpmyadmin the date still looks like 2002/11/06, i try change the value but with no joy.
Help With Regexp Needed
Hello, I'm coding a simple templating system to fit in to my simple CMS system. The way this will work is that the administrator of the CMS can edit the template (stored in a db), and insert 'snippets' into the template. A snippet is a piece of code (also stored in the db) which may have PHP code in it, which will then be eval()'d. A simple example would be: <html> <head> <title>[[title]]</title> </head> <body> [[menu]] [[content]] </body> </html> The snippets here are [[title]], [[menu]] and [[content]]. This is fine as long as I know exactly which snippets will be in the template, but that's not always the case. So what I want to do, is search through the string containing the template, find all the snippets and save these in an array. My guess is that this'd be done with regular expressions, but I'm still very new at those, and have no idea how to do what I want. Does anyone have an idea about how to do this? Thanks! Alex
PHP Developers Needed
hello, My name is Joshua Abbott and I am project administrator of the AWHCP project on sourceforge.net. Our project is aiming to create an advanced web hosting control panel of 350 end user features (once final release) and a lot of security features in a packaged OS called extremeserv-linux @ extremeserv-linux.com . We desperately need PHP Developers to help in this endevour. So, if you are interested or want more information please email URL
Help Needed In Sending SMS With PHP
I want to know the process and the Implementation of sending text SMS to mobile phones with PHP. Is there any article regarding this? or any code example?
Nusoap & XML Help Needed
I am getting below result when accessing a web service. Now how can I separate the values and assign them in variables for further use?
Help Needed With DB_DataObject
I have just adopted a PHP project and need some help understanding DB_DataObject. I've looked around on the web and can't find a simple explanation. Basically, my MySQL database has no tables. I have a createTable.php script which I believe is a standard script, it runs but tell me "NO TABLES". There is a function in the script called _createTableList() which is looking for tables not finding any (I don't really understand why there should be pre-existing tables when the script is supposed to be creating them...) I have .ini files which seem to describe the schema, and classes which correspond to the entries in the .ini file - but no SQL, and I do not understand how to get the schema into the database. I believe the environment is set up correctly for the script to find the .ini files. I hope that was clear, and I hope somebody here can advise me - I'm sure it's simple enough for somebody who knows what they're doing with DB_DataObject! Using PHP5 btw, if that matters.
Help Needed With Nntp
Im having trouble with a script trying to display newsgroups. The script just hangs when trying to select a newsgroup (fget command)....
New Line Help Needed
I'm trying to insert a newline character into the string below for an <INPUT TYPE="image" ALT= tag but when I hold the mouse over the image I see the string but without a newline break in the string - how do I get the line to break?
Sql Optimize Help Needed
SELECT * FROM post WHERE forumid=1 ORDER BY ctime LIMIT x,10 ctime=creation time both forumid and ctime is index separately it take too much time when x is so large. how can i optimize this query?
Help Needed In IMAP+PHP
I am having a mail client script, which will read and send mail to mail server, using IMAP. When i am sending mail with attachment through forwarding, the attachment is not getting attached correctly, Plz any one can help me to come out of the problem. Note : I am using PHP 4.3.10 + IMAP + Apache +Zend Engine v1.3.0
URL Variable Needed
For a specific purpose I need the complete url displaying in the Url bar in the browser. Is there any function which provides that?
Advise Needed
I've no access to mysql NG, so I ask here. We are looking for a system where user pay for having their article on homepage. Only 5 articles are shown every time. The length of the service is 2 weeks. The articles should be shown equally between clients. If a user select a particular object in search engine, then coming back on the homepage the shown article should reflect their need. How to create a mysql query to get equally chances between articles ? If only 2 announces of 5 are bought, I then want to fill the free places with professionals articles. I'd like to get random article from professionals, but not 2 articles from the same pro. How to do so ? also with query (not with PHP) If isn't possible, on PHP should I get all announces then try to find randomly between results ?
Reg Expression Needed?
I'm retrieving some content from a DB but I would like to get first couple sentenances from the content and display this, I don't for sure if I have to use a regular expression to do this, but any assistance would be much appreciated.
PHP Script Needed
Question: Where can I get a script(s) that do this: http://network-tools.com/analyze To be more precise, I would like the script that: prints visitor's IP, monitor resolution, referral link, colors depth, scans ports etc... etc... I have been searching hotscripts.com for few days, came out empty handed...
|