Ok, so everyone has decided (and for good reason) strait SQL is of the devil. This leaves us with many methods of placing a "middle-man" in our code to separate our code from the database. I am now going to spit out all the info I have gathered in the hope someone can set me strait and tell me what I built.
An ORM (Object-relational map...
Just trying to figure out the proper and safer way to execute mathematic operation passed as string. In my scenario it is values fetched from image EXIF data.
After little research I found two way of doing it.
first, using eval:
function calculator1($str){
eval("\$str = $str;");
return $str;
}
second, using create_function:
...
I'm trying to add a table row with ajax/jquery that has a form element in it. Everything works just fine if I set it without the ajax, but somehow everything inside the <form> tag is just completely lost.
I'm not sure where I'm losing the form (jquery's .html() is effectively the same as innerHTML right? If that's the case I suspect t...
I seem to go back and forth on this, sometimes it works for me, often it doesn't and I can't figure out how/why I can get it to work sometimes, and at other times it won't.
I have 5 databases, and need to grab data from each of them during a maintenance routine.
For each of the databases, I have an external file which contains all the ...
When I use PEAR, it always generates
lots of errors.
How do you guys treating about them?
(1)use PEAR , and just ignore errors.
What is error thing? I can't see them.
(2)use PEAR, but tweak error level,
to they do not generate errors.
(3)Don't use PEAR thing. switch to cakephp.
...
I am trying to build a dynamic menu in my PHP CMS; the pages/categories are organized using the nested sets model.
Full tree:
root
A
B
B1
B1.1
B1.2
B2
B2.1
B2.1
C
C1
C2
C3
D
I want to convert this result set to an unordererd list, which only displays a part of the tree.
For example:
If I click on B, I want...
I'll admit I'm not 100 % on the inner workings of PDO and MySQL, so I'll give an example to make my question clearer.
I'm making a rather crude browser based strategy game, because I think it's a fun way to learn PHP and databases. I was bug-testing the battle script when I came across a rather unexpected bug. I use Cron Jobs to call a ...
Hello,
I'm currently writing an application that works with modules. The module part is all okay, but I am not entirely clear on what would be the best approach to display multiple modules on a same page. The way common MVC like systems could work is that an URL like "site.com/article/full/18543/how-to-lose-weight" (I'm not implying any...
It appears there are many ways to approach date and time massaging in php. I usually am only every dealing with local time. Today, I need to work in UTC.
I am querying against an API, the data they give me about an arbitrary record is:
created: Thu, 18 Jun 2009 21:44:49 +0000
* Documented as 'UTC record creation time'
utc_offset: -28...
Just transferred an Expression Engine web site to a new hosting environment. New server is Windows 2003 Standard running PHP 5.2.44 via FastCGI and IIS 6. Other PHP sites run fine on this server (WordPress, CMSMadeSimple, etc.). This is the first ExpressionEngine site we've worked with. We've restored the database, setup a user account f...
I am trying to use a form to send an prototype ajax request to a php script via post and then display an alert window for success and failure
I am currently using this code
<div id="reservationRequestForm">
<form name="requestReservationForm" method="post" onsubmit="new Ajax.Request('admin/process/process_reservation_request.php', {...
I am writing a string compare function to sort medical terms that often contain special accented characters from many different European languages, and I need to somehow achieve a collation similar to MySQL's latin1_general_ci.
First, I'm doing some basic munging on the strings to remove spaces, quotes, hyphens, parentheses, etc. The pr...
I have two modules, default and mojo.
After the initial bootstraping code which is the same for both of the modules, I want, for example, to use different layouts for each module (Or use different credentials check etc).
Where do I put this: IF(module=='mojo') do this ELSE do that
...
How would I do something like this :
class Test
{
public function test($methodName) {
$this->$methodName;
}
private function a() {
echo("a");
}
private function b() {
echo("b");
}
}
$testObj = new Test();
$testObj->test("a()");
$testObj->test("b()");
Maybe I should just pass a parameter "TYP...
I have a class which initiates another class, i'm not concerned with having a reference to the object i only need the method and have to pass in new parameters.
class A {
__set .....
}
class B extends A {
$anotherA = new A;
$anotherA->myName = 'stackoverflow';
}
in short i'd like to have class B extend A, init a new in...
So...
I've been reading about REST a little bit, and the idea behind it sounds nice, but the question is, can it be easily integrated into the standard flow of a webpage?
For example, a user creates some sort of item, a blog post or what have you, and now he wants to delete it, so he clicks a 'delete' link on the page. Now what? How do...
I want to convert an Object into a String in PHP. Specifically, I'm trying to take a mysql query response, and I'm trying to convert it into something I can write to a file and use later.
Of course, when you try to write an Object to a file, PHP appropriately yells: Catchable fatal error: Object of class DB_result could not be converted...
I've just started reading about php, it needs me to install php, apache and MySql to run any php script. can any one suggest me a simplest method to install php, apache and MySql so that i can sun those php script.
I've tried the zip files from php.net, Are those required to run the script offline for practicing the script? what do i do ...
We have a social site, and want to integrate facebook connect to save time on the user needing to select their gender, etc. etc. and also use FB Connect as a method to skip signing up with us.
Each user on our site has a unique user name that they go by... One thing I can't wrap my head around, is if someone logs in with Facebook connec...
I am developing a big application using PHP. Is MySQL or SQL Server the best one to use?
...