in many cases functions are defined as variables
If you're talking about the function names being prefixed by @, that's actually an error control operator. Notices that would otherwise be emitted are silenced when you use it.
$db= @mysql_select_db($db_name, $connection) or die(mysql_error()...
@Jack I don't think your answer matches the question to be honest. He asks why mysql_connect(...) is assigned to $db, which then is never used again. At least that's what I understood. He probably didn't even notice the @ to be something special and thinks that's how a function name has to start. While your answer is definitely helpful, because it might clarify some misconception, you don't really answer the question, I think.
@TillHelgeHelwig Yeah, maybe that should take a backseat .. I'm just trying to figure out why OP talks about "in many cases functions are defined as variables"
yeah , that was my guess too ... it seems they are either handling/storing the "delete" actions differently for mods, or mod status comes with new user ID.
Im trying to learn how to fetch data from mysql.This isnt working any clues function get_news() { $result = mysql_query("SELECT news_content FROM news"); echo '$result'; }
The use of Mock and Stub Objects is an important skill to learn when using Test Driven Development (TDD). Mock objects allow you to replace dependencies of an object with lookalikes, much like crash test dummies are used during automobile safety tests so humans aren't harmed.
@Jack Yeh so O_EXCL doesn't do what I thought it did. I thought it locked the file exclusively so that any other program attempting to open it would fail, but apparently not.
What I do find interesting though, is open(3) states If O_EXCL is set and O_CREAT is not set, the result is undefined. - so why doesn't O_EXCL just include O_CREAT?
@Baba I don't like SplFileObject because I think that returning false or null on failure is not a good practice (i.e. exceptions should be thrown) for OO architecture. Anyway, I was saying that throwing exceptions like this when some function fails is not a good practice. — PLB2 mins ago
@Baba (quickly reads the question) for completeness you should probably demonstrate ErrorException as well then, I think the only reason that try/catch is in the OPs code is because he's trying to handle errors as if they are exceptions
@Baba Well, much as this really sucks, it's one of the only two places I ever use the @ operator (the other being LDAP), and I check every call for failure and usually throw exceptions if it's unrecoverable.
@Baba It's not that bad. The original NoSQL. It's only good for what it's good for, though (if you see what I mean) it is not a relational database and forget that at your peril. It's used a lot in the telephony world, and often to great effect.
@Baba It'll never happen, it's a BC break, unless you add a flag to the constructor or something. Either way, I can't see it happening, because internals are too busy arguing the toss over other unimportant crap/politics.
in authorized.net ARB payment. i have problem in production mode test credit card running still after setting path = api.authorized.net and test mode "off". i want to stop test card.
@Ocramius Okay. One more thing. I'm reading doc. now and question came up regarding foreign keys. I see that quite an amount of references point to repository entities at same time in your slides I understood, that it is same entity class as for the record, except it is used to work as a table. i.e. to get collection of records, right? Or is it different class like, Customer, CustomerRepository?
@Eugene a repository and an entity are different things. The entity repository is an object that is responsible for fetching entities. The entity instances are the record themselves
@Rikesh You think so? Outside of the few people that frequent the chat rooms, there is not a lot of community going on. Most of the people nominated I had never even heard of before.
if i var_dump($_POST) its showing 'img' variable value but if i try to access any of its property like $_FILES['img']['name'] its saying undefined variable...suggestions pls..
@pbvamsi - Make sure your form contains "multipart/form-data" something like <form action="upload_file.php" method="post" enctype="multipart/form-data">
@Gordon I might try and draw up some stats from data.SE later on, I'm kind of intrigued by the relatively poor turnout compared the people who visited the election page
@DaveRandom but i'm moving the uploaded file , move_uploaded_file(), any how it is showing if i var_dump($_FILES), but now i need to access the file name, size, type @Rikesh i did but still the problem persists
@DaveRandom i've 10 primary keys in the table, i've deleted 8th for some other cause, now am trying to place DML query, does missing of 8th key matters! (does auto increment gets effected if 1 row is deleted in between!)
@Jimbo do u find something wrong in this $query="insert into latest_news_biglist('heading','content','imgloc') values($heading,$content,$img1)"; i've echo'ed 3 variables-no problem with them.. column name is also correct
@pbvamsi Btw you're using mysql_* functions, when you should be using mysqli_* or PDO_* to access your MySQL database - you want to look up those and prepared statements to protect your code from things like SQL injection - I think you need to do some research on this