« first day (1 day earlier)      last day (309 days later) » 

2:52 AM
0
Q: PHP OOP Fatal error: Call to undefined function valid_email()

JarrodI'm trying to teach myself PHP OOP and following some tutorials online. I built a registration project and it worked fine til I tried to add a validate function to test for a valid email. My function is below. public function valid_email($email){ return filter_var($email, FILTER_VA...

0
Q: PHP OOP PDO Fatal error: Allowed memory exhausted

WillemI am getting this error. I make use of a class file, function file and then the view file. Fatal error: Allowed memory exhausted public function adminSearchFullName($admin_firstname,$admin_lastname){ $adminsearchresultsfullname = array(); try { $db = databa...

 
3:10 AM
0
Q: PHP OOP Design for an Internet Comic website

Django ReinhardtI'm trying to learn PHP OOP, and as a test project I've decided to create a website for an internet comic (e.g. XKCD.com). It's largely an academic exercise, so no need to suggest existing solutions for this problem :) When I've read about OOP, most of the examples seem to involve things like: ...

 
 
5 hours later…
7:57 AM
2
Q: include view after extracting data

Mithun SenI have two functions loadView() and render() in my view class. public function loadView($view){ if(file_exists(APP.'view/'.$view)){ require(APP.'view/'.$view); } else{ die(APP.'view/'.$view.' not found.'); } } public function render($v...

 
 
6 hours later…
1:55 PM
1
Q: How does Doctrine set private IDs

Rogue CoderIn PHP, I can create a model with a private/protected $id variable and no setter. Doctrine ORM is able to set that property when the object is saved/loaded. How does this work internally? I assume this is handled by serialization, but I haven't been able to find the code responsible of this be...

 
2:38 PM
0
Q: Is just caching database query results in the model layer acceptable?

Silver89Is it acceptable for larger websites to cache database query results in their model layer but still force the controller layer to have to build that information per request? For example: Model Layer function getData() { $sql = "SELECT * FROM data"; $key = md5('query'.$sql); if((...

 
3:32 PM
0
Q: Kohana: Using auth module of php-activerecord, but seeing error as " Class 'Arm' not found"

Mitesh SharmaI am using PHP-activerecord in kohana and using its auth module by calling function : User::create_user("Name", "Name", "Name", "Name"); But seeing error : ErrorException [ Fatal Error ]: Class 'Arm' not found I have added kohana-activerecord in bootstrap.php and also enabled Auth module. arm...

 
4:05 PM
-4
Q: PHP MVC - Please suggest a method for my new application

user1854007we are planning to build a php based application that will be used by our staffs. Please suggest any free open source mvc pattern or is it better to create in free style code..Since we have not created any previous apps in mvc I would like to create a mvc based app this time...I am greatly thank...

 
4:41 PM
-1
Q: Using Cakephp to plot coordinates on google map

Nitish SharmaI'm trying to fetch some data from my database table according to user's current geolocation. I can do it with normal php & js. But because I want to use the MVC model. So, I'm using cakephp but I'm not being able to figure out a way to accomplish my task using cakephp. As far as I know I can...

 
 
2 hours later…
6:17 PM
0
Q: Cant get only frist row from array whit foreach

Csak Zoliclass cuc { public $result,$numrow ; public function connect () { $this->con = mysql_connect("localhost","root","") or die('Could not connect: ' . mysql_error()); mysql_select_db ('client',$this->con) or die('Could not connect to database: ' . mysql_error());; } publ...

 
 
2 hours later…
8:39 PM
1
Q: using function in methods while working OOP in PHP

Mohammad Bagher SaberiI need to know something about OOP in PHP. Can I put functions in class methods or no ? Like this: <?php class test { function test1() { // do something function test1_1() { // something else } } } ?> And use it in this way: $test->test1->test...

 
 
2 hours later…
10:24 PM
0
Q: How can I run a method from an object's parent class that has been overridden in PHP?

thatthatisisThis may be a duplicate post, but searching for the answer just led me to the C, Java and ColdFusion ways of doing this... Given class A with method foo() and class B extends A and also has foo(), I want to run something like: $b = new B(); $b->A::foo(); (this is working C syntax, but that d...

 
11:15 PM
0
Q: Validate unique username or email

DriglouI want to make a validation that would check if input in this case username is equal with the chosed column, if it's equal then to stop text with a message. Also i would love to know what should i use to make a method of connecting to database and then to simply call it in every method i need, to...

 

« first day (1 day earlier)      last day (309 days later) »