55 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for rpv_sen

Hi I am trying to create a update function. But it not updating in the database. Please help me to fix. **Test-2.php** $whereString = ''; $bind = NULL; if(isset($_POST['Submit'])) { if($_POST) { $SCYQ64UKID = $_GET['SCYQ64UKID']; $SCYQ64AVGP = $_POST['SCYQ64AVGP']*100; $searchFields = array('SCYQ64EMAL'=>$_POST['SCYQ64EMAL'],'SCYQ64EV01'=>$_POST['SCYQ64EV01'],'SCYQ64EV02'=>$_POST['SCYQ64EV02'],'SCYQ64EV03'=>$_POST['SCYQ64EV03'],'SCYQ64EV04'=>$_POST['SCYQ64EV04'],'SCYQ64EV05'=>$_POST['SCYQ64EV05'],'SCYQ64EV06'=>$_POST['SCYQ64EV06'],'SCUSER'=>$_POST['SCUSER'],'SCYQ64AVGP'=>$SCYQ64AVGP,'SCYQ64TZ'=>$_POST['SCYQ64TZ'],'SCJOBN'=>gethostname(),'SCPID'=>'SSWEB','SCUPMJ'=>$_POST['SCUPMJ'],'SCUPMT'=>$_POST['SCUPMT']); if($post = array_filter($_POST)) { if($fields = array_intersect_key($searchFields, $post)) { …

Member Avatar for rpv_sen
0
449
Member Avatar for rpv_sen

Hi I am trying to display count of a row using function with get values. Please help me to fix the issue **class** class Users { private $conn; private $db_name= "DATABASE"; public function __construct($db) { $this->conn = $db; } /*Join Two Tables with where condition and order by*/ public function …

Member Avatar for rpv_sen
0
574
Member Avatar for rpv_sen

I have created a function. if i provide correct username and password. i am getting a error message as **Sorry, that username / password is invalid !** can any one please help me to fix the issue. **login.php** <?php require 'include/init.php'; $general->logged_in_protect(); if(empty($_POST) === false) { $username = trim($_POST['username']); $password …

Member Avatar for rpv_sen
0
573
Member Avatar for rpv_sen

Hi I am trying to connection my database ODBC using function. I am getting an error **Connection error: could not find driver** **mycode is** <?php class Database{ // specify your own database credentials private $host = "servername"; private $db_name = "databsename.schemaname"; private $username = "username"; private $password = "password"; public …

Member Avatar for rpv_sen
0
3K
Member Avatar for jay.barnes

Hi all, I've been working with PHP, using procedural methods, for several years now, and have begun to explore the object-oriented side of it. While it didn't take me long to understand the potential advantages that come with working in this manner, I'm still having some trouble wrapping my head …

Member Avatar for jay.barnes
0
415
Member Avatar for SkateX

Greetings, I'm having problems with my output. Essentially I am just trying to print out any Cat who is over 3 years old and has Claws. But my output keeps printing out either nothing at all or the 3rd cat 3 times. I've struggled with this for hours trying to …

Member Avatar for JamesCherrill
0
296
Member Avatar for samson.dadson.3_1

the problem I have here is: when I input an integer it works fine, but when i input any other thing, it doesn't give me a chance to input again when the loop iterates, it just keeps printing "error type the right thing" to the screen even though "cin var" …

Member Avatar for samson.dadson.3_1
0
2K
Member Avatar for Builder_1

please tell me in how many ways OBJECT ORIENTED PROGRAMMING is different from procedural programming in JAVA

Member Avatar for JamesCherrill
0
292
Member Avatar for raminshahab

I can't seem to get a response from my query method. I have a database connection from method ping_server and use mysqli as connector. Can anyone help me figure out why I cannot print results from mysqli_fetch_array. dbclass.php class db { private $connection; private $selectdb; private $lastQuery; private $config; function …

Member Avatar for raminshahab
0
345
Member Avatar for Gaetane

This started out as `I love PHP traits! I'm going to use them everywhere! ^_^` and now it has turned into a `Thought Exercise / Learning Experience >_<`. Consider the following example: trait TheErrorOfYourWays{ public function booboo(){ echo 'You had a booboo :('; } } trait SpectacularStuff1 { use TheErrorOfYourWays; …

Member Avatar for Gaetane
2
2K
Member Avatar for diafol

Having just found 'traits' - see http://www.daniweb.com/web-development/php/threads/468928/php-trait-method-conflicts-trait-inheritance#post2043565 I was wondering whether they could be used to share a DB connection object across disparate classes, or would the old singleton or dependency injection methods still be the way to go? I'd value any views on this.

Member Avatar for diafol
2
713
Member Avatar for davidjennings

Hi All, I am trying to connect to a database OOP singleton method. I am getting an error "syntax error, unexpected 'function_construct'" and I unable to find the syntax error in the code. Any help with this would be appreciated. Thanks in advance David // Page: index.php <?php require_once 'classes/db.php'; …

Member Avatar for davidjennings
0
819
Member Avatar for dany12

I would like some help with my connect class.This class is created by me it is my way of thinking so i would like to know why this class dossent get my variables and connect proprely to mysql. the code <?php /** * Exp:Connect to database in oop style @params …

Member Avatar for pritaeas
0
1K
Member Avatar for dany12

Hy I want to understand what is a better approach on problem solving point of view for a php project , a framework or the mvc pattern? I would like to add that I know that both principels are quite the same but with a minor diffrence that a framework …

Member Avatar for dany12
0
368
Member Avatar for HunainHafeez

today a friend told me that Hunain, did you notice that OOP concepts like inhertance, polymorphism, interface etc aren't usuallt applied to ASP.net. so it made me confused and thought for a while, and yes he seems to be right ! i never used any of them adn even most …

Member Avatar for JorgeM
0
110
Member Avatar for mmcdonald

Hi all, I've literally JUST dived into OOP and it's a totally different world. I've written some pretty awful code just to grasp OOP basics. The following code is all in the same file and runes fine, there are no warnings, errors, notices and so forth yet it doesn't work …

Member Avatar for mmcdonald
0
291
Member Avatar for pritaeas

I'm working on an ORM experiment, and I'm looking for ideas to help choose which path to take in it's development. I currently have an index showing how to use it, two interfaces, a database class, a table base class and two auto-generated classes (representing a database table). The first …

Member Avatar for pritaeas
1
315
Member Avatar for NardCake

Hello! So I currently have a class titled Appliciation which contains a method called start. <?php class Application { /* * Application class */ public function __construct($IceTray){ $this->IceTray = $IceTray; } /* Starts application */ public function start(){ /* Confiures error reporting */ $this->IceTray->Error->configure(); $Path = $IceTray->Path; include APPDIR.'/paths.php'; $Path->start(); …

Member Avatar for NardCake
0
289
Member Avatar for davidjennings

Hi All - I am trying create classes for db connection and I am getting the following error Thanks in advance D Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'XXXXXXX_david'@'localhost' (using password: YES) in /home/djenning/public_html/dbconnection/connection.php on line 20 Cannot connect to the database page: connection.php <?php class createConnection //create a …

Member Avatar for davidjennings
0
530
Member Avatar for kakalahori

ok here is the login function from my class user which parent class is a Db connection file <?php require_once("DBConnection.php"); class User extends DBConnection { .... .... ... ... public function Login() { $sqlSelect = "select `UserName` from `user` where `UserName` = '$this->userName' and `Password` = '$this->password'"; $result = @mysql_query($sqlSelect, …

Member Avatar for diafol
0
211
Member Avatar for PhilEaton

Here is the code: var Circle = function( radius ) { var _radius = radius, _area = function() { return Math.PI * _radius * _radius; }, _perimeter = function() { return 2 * Math.PI * _radius; }; this.radius = _radius; this.area = "Area" + _area(); this.perimeter = "Perimeter" + _perimeter(); …

Member Avatar for PhilEaton
0
153
Member Avatar for NardCake

Hello! I'm working on a mini framework and everything is going great, exvept this one part that I have gotten working but it brings more complications and it's extremely confusing to me. So I will summarize what is going on. Essentially I have a class (a controller, we'll call this …

Member Avatar for pritaeas
0
219
Member Avatar for LastMitch

Hi, I been learning **OOP** slowly. I'm stuck how to resolved an **function query() on a non object issue**. My files are very basic: This is my **db.php** file: <?php global $db; class foo_mysqli extends mysqli { public function __construct($host, $user, $pass, $db) { parent::__construct($host, $user, $pass, $db); if (mysqli_connect_error()) …

Member Avatar for broj1
0
842
Member Avatar for sheikh zohaib

hey all i am new to all this languages and Computer sciences so if you help me i am trying to write a code and its constantly giving me errors here is the code at line 10 , 102 , 115 tell me how to fix it.. waiting... #include<iostream.h> void …

Member Avatar for sheikh zohaib
0
175
Member Avatar for pilotkid424

I am trying to create a function which adds an array to another array and replaces the data in the 1st array with the new data. For example, A=A+B. However, when I write my code as below, I get the error C2676:binary '[' : 'const Matrix' does not define this …

Member Avatar for pilotkid424
0
207
Member Avatar for LastMitch

Hi I'm having issue of understand how to **echo** a variable when the `class` is `extended`. I have **2** files. This is my **index.php** file: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>OOP Example</title> <?php include("class.php"); ?> </head> <body> <?php $mitch = new person("Mitch Last"); echo "Mitch's full …

Member Avatar for LastMitch
4
293
Member Avatar for sapure

In this example, what's the difference between creating a class variable from the "class Employee" & creating an object from the class GenQueue ?! What's the difference in uses and implementation? import java.util.LinkedList; class GenQueue { private LinkedList list = new LinkedList(); public void enqueue(E item) { list.addLast(item); } public …

Member Avatar for riahc3
0
228
Member Avatar for LastMitch

Hi, I'm learning OOP and I'm having issue echoing an `attribute` function. This is my example: <?php class sandwich { function sandwich($hero) { echo "I like to eat $hero sandwich.<br>"; } } $a = new sandwich("roast beef"); $b = new sandwich("pastrami"); $c = new sandwich("turkey"); ?> When I echo it …

Member Avatar for LastMitch
0
142
Member Avatar for LastMitch

Hi, I want to know how did I came up with this error when I run my code: `Trying to get property of non-object in line 19.` What does it mean? I want to echo out `My favorite candy is M&M Peanuts.` But instead I echo out `My favorite candy …

Member Avatar for LastMitch
0
1K
Member Avatar for HunainHafeez

with a lil bit of change in code ,it's functioning, but I want it to function with data members being private :-/ #include<iostream.h> #include<conio.h> class account{ public: int account_number; float balance; int passw; public: void display() { cout<<"Account number is:"<<account_number<<endl<< "Account balance is:"<<balance<<endl; } void user(int acc, float amou, int …

Member Avatar for HunainHafeez
0
182

The End.