¡@

Home 

php Programming Glossary: when

Reference - What does this error mean in PHP?

http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php

compatible with that of CCC BBB ' Fatal error Using this when not in object context Notice Undefined variable Notice Undefined.. modify header information headers already sent Happens when your script tries to send a HTTP header to the client but there.. session cookie to the client. But PHP already sent headers when it wrote the html element to the output stream. You'd have to..

Why shouldn't I use mysql_* functions in PHP?

http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php

segregate code and data again. SQL injections simply are when data bleeds into code context. A database server can't later..

UTF-8 all the way through

http://stackoverflow.com/questions/279170/utf-8-all-the-way-through

. This way MySQL does no conversion from its native UTF 8 when it hands data off to your application and vice versa. Some drivers..

mysql_fetch_array() expects parameter 1 to be resource, boolean given in select

http://stackoverflow.com/questions/2973202/mysql-fetch-array-expects-parameter-1-to-be-resource-boolean-given-in-select

not how to do it. Production code shouldn't use or die when outputting HTML else it will at the very least generate invalid..

How do you parse and process HTML/XML in PHP?

http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html-xml-in-php

selectors and array iterators. SimpleXML is an option when you know the HTML is valid XHTML. If you need to parse broken.. or changing attributes in a tag can make the regex fails when it's not properly written. You should know what you are doing.. custom parser with regular expressions is a waste of time when the aforementioned libraries already exist and do a much better..

Reference - What does this symbol mean in PHP?

http://stackoverflow.com/questions/3737139/reference-what-does-this-symbol-mean-in-php

What is the PHP operator called and how do you say it when reading code out loud where we use object operator in php What's.. is the meaning of Php array_push vs myArray What does mean when reading from a php array Opening and Closing tags Are PHP short..

Headers already sent by PHP

http://stackoverflow.com/questions/8028957/headers-already-sent-by-php

php Too late for headers already. Whitespace before php when somefile.php line 1 mentioned If the message says the error.. execution or suppress the message with e.g. isset or @ when this doesn't obstruct debugging later on. No error message If.. Headers cannot be sent after premature output still. So when header Location ... redirects fail siliently it's good to probe..

When to use single quotes, double quotes, and backticks?

http://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-backticks

to use single quotes double quotes and backticks I've been.. VALUES NULL ' val1' ' val2' ' date' Prepared statements When working with prepared statements consult the documentation to..

Why shouldn't I use mysql_* functions in PHP?

http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php

you can pass _REQUEST variables safely behind any query. When submitted form fields match the database structure exactly it's.. not intend for security. How prepared statements differ When you scramble string variables into the SQL queries it doesn't..

The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

http://stackoverflow.com/questions/13944956/the-mysql-extension-is-deprecated-and-will-be-removed-in-the-future-use-mysqli

will be removed in the future use mysqli or PDO instead When I attempt to connect to a MySQL server from PHP I see the following..

Simple “Long Polling” example code?

http://stackoverflow.com/questions/333664/simple-long-polling-example-code

the above file msg_srv.php and wait for a response. When you get one you act upon the data. Then you request the file.. and repeat What follows is an example of such a page.. When the page is loaded it sends the initial request for the msgsrv.php.. div function waitForMsg This requests the url msgsrv.php When it complete or errors .ajax type GET url msgsrv.php async true..

Reference - What does this symbol mean in PHP?

http://stackoverflow.com/questions/3737139/reference-what-does-this-symbol-mean-in-php

operator work in PHP function What does in 2 mean in PHP When should I use Bitwise operator References Reference assignment..

Secure hash and salt for PHP passwords

http://stackoverflow.com/questions/401656/secure-hash-and-salt-for-php-passwords

entropy is how much variation is within the password. When a password is only lowercase roman letters that's only 26 characters...

Who needs singletons? [closed]

http://stackoverflow.com/questions/4595964/who-needs-singletons

second monitor a second database a second server whatever. When this happens if you have used a static class you're in for a..

PHP global in functions

http://stackoverflow.com/questions/5166087/php-global-in-functions

function exempleConcat global str1 str2 return str1. str2 When does it make sense to use global For me it appears to be dangerous.. of pulling in global keyword vs pushing in arguments . When you push in inject dependencies the function does not rely on.. the function does not rely on the outside anymore. When you do fn 1 you dont have to have a variable holding 1 somewhere..

Call to a member function on a non-object

http://stackoverflow.com/questions/54566/call-to-a-member-function-on-a-non-object

objPortal objPage set_page_title myrow 'title' When I do I receive the error message Call to a member function set_page_title..

How should a model be structured in MVC?

http://stackoverflow.com/questions/5863870/how-should-a-model-be-structured-in-mvc

in the Presentation layer are views and controller. When you are dealing with websites that use MVC design pattern the.. that it should be associated with a table for visitors . When you create a new model the Library it asks for Factories in..

Reference: What is a perfect code sample using the MySQL extension? [closed]

http://stackoverflow.com/questions/6198104/reference-what-is-a-perfect-code-sample-using-the-mysql-extension

to direct the individuals writing those questions to PDO. When it is an option we should do so. It is however not always possible..

Headers already sent by PHP

http://stackoverflow.com/questions/8028957/headers-already-sent-by-php

already sent by PHP When running my script I am getting several errors looking like this.. the double linebreak it can't ever append to them again. When PHP receives the first output print echo html it will flush..

Create Image From Url Any File Type

http://stackoverflow.com/questions/10233577/create-image-from-url-any-file-type

'http example.net photo.jpeg' SEE BELOW HO TO DO IT WHEN http ARGS IS NEEDED jpeg_image imagecreatefromfile 'http example.net..

Symfony2 collection of Entities - how to add/remove assotiation with existing entities?

http://stackoverflow.com/questions/11089861/symfony2-collection-of-entities-how-to-add-remove-assotiation-with-existing-en

to user . 1.3 Desired functionality 1.3.1 Add role WHEN user clicks add button in Roles table THEN jquery removes that.. list item to User form avoRoles list 1.3.2 Remove roles WHEN user clicks x remove button in User form avoRoles list THEN.. AND jquery adds new row to Roles table 1.3.3 Save changes WHEN user clicks Zapisz save button THEN user form submits all fields..

MySQL Error - Commands out of sync; you can't run this command now

http://stackoverflow.com/questions/16029729/mysql-error-commands-out-of-sync-you-cant-run-this-command-now

@sql NULL SELECT GROUP_CONCAT DISTINCT CONCAT 'sum CASE WHEN maildate ''' date_format mailtime ' e b' ''' THEN 1 else 0 END..

mysql order by issue

http://stackoverflow.com/questions/2005350/mysql-order-by-issue

SELECT FROM table WHERE id IN 3 6 1 8 9 ORDER BY CASE id WHEN 3 THEN 1 WHEN 6 THEN 2 WHEN 1 THEN 3 WHEN 8 THEN 4 WHEN.. WHERE id IN 3 6 1 8 9 ORDER BY CASE id WHEN 3 THEN 1 WHEN 6 THEN 2 WHEN 1 THEN 3 WHEN 8 THEN 4 WHEN 9 THEN 5 END .. 3 6 1 8 9 ORDER BY CASE id WHEN 3 THEN 1 WHEN 6 THEN 2 WHEN 1 THEN 3 WHEN 8 THEN 4 WHEN 9 THEN 5 END share improve this..

MySQL greatest value in row?

http://stackoverflow.com/questions/2687256/mysql-greatest-value-in-row

2147483646 COALESCE `2` 2147483646 COALESCE `3` 2147483646 WHEN `1` THEN 1 WHEN `2` THEN 2 WHEN `3` THEN 3 ELSE 0 END AS maxcol.. `2` 2147483646 COALESCE `3` 2147483646 WHEN `1` THEN 1 WHEN `2` THEN 2 WHEN `3` THEN 3 ELSE 0 END AS maxcol FROM tbl WHERE.. COALESCE `3` 2147483646 WHEN `1` THEN 1 WHEN `2` THEN 2 WHEN `3` THEN 3 ELSE 0 END AS maxcol FROM tbl WHERE ... It's not..

Can you add an if statement in ORDER BY?

http://stackoverflow.com/questions/3550942/can-you-add-an-if-statement-in-order-by

would be the CASE statement ORDER BY CASE `type` WHEN 'Member' THEN LNAME WHEN 'Group' THEN GROUPNAME ELSE 1 END ASC.. statement ORDER BY CASE `type` WHEN 'Member' THEN LNAME WHEN 'Group' THEN GROUPNAME ELSE 1 END ASC Note that the entire block..

unit testing and Static methods

http://stackoverflow.com/questions/5961023/unit-testing-and-static-methods

static methods but I would of liked having an idea of WHEN static methods are useful if at all. It seems from this post..

MYSQL select mutual friends

http://stackoverflow.com/questions/8906154/mysql-select-mutual-friends

query to find a users friends quer mysql_query SELECT CASE WHEN userID id THEN userID2 ELSE userID END AS friendID FROM friends.. id I have tried this however it doesn't work SELECT CASE WHEN userID id OR userID session THEN userID2 ELSE userID END AS.. reading the mutual part SELECT a.friendID FROM SELECT CASE WHEN userID id THEN userID2 ELSE userID END AS friendID FROM friends..