/    Sign up×
Community /Pin to ProfileBookmark

update quesry not working in my oops php programme .

guys i really followed this set of tutorials online , its to help me understand the oops concept :

heres the link for one of the videos [URL=”https://www.youtube.com/watch?v=uF-L7ympvfw”]https://www.youtube.com/watch?v=uF-L7ympvfw[/URL]

now i typed out all the code as that guy had done in the video , but i am still getting errors , so i kind of need some help here , for someone to check my code . I got the “select” query working somehow , though the update query is not working .

i know debugging help is usually not encouraged on forum , but i would really really be grateful and would buy u a beer if you could help me debug this :

heres the link to what i’ve done on git : [URL=”https://github.com/gautamz07/oopslogin”]https://github.com/gautamz07/oopslogin[/URL]

now in mysql you will have to create a table :
with the following attributes :

id fname lname email

and don’t forget to change the db name in index.php if you run the code.

also for the update query chage the index.php file code to as follows :

[CODE]<?php
include(‘./class.database.php’);
include(‘./class.table.php’);
include(‘./user.class.php’);

$dbo = database::getInstance();
$dbo->connect(‘localhost’, ‘root’, ” , ‘zakoo’);
$user = new user();

// $temp = array(1);
$data = array(“fname”=> “pandit” , “lname”=>”Jawaharlal” , “email”=> “[email protected]”);
// $user->load(‘2’);
$user->bind($data);
$user->store();

// echo “{$user->fname} {$user->lname}”;
?>[/CODE]

now one other difference you need to know if you do this is the guy in the video has used mysqli where as i am using mysql , i know its a crime to be using it , but still for this demo thinggi its ok ?

Gautam.

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@Strider64Dec 19.2014 — 

now one other difference you need to know if you do this is the guy in the video has used mysqli where as i am using mysql ,[B] i know its a crime to be using it , but still for this demo thinggi its ok ? [/B]

Gautam.[/QUOTE]


I don't know why learning new programming techniques a person would want to use soon to be obsolete code, but it's still OK to ignore posts. ?
Copy linkTweet thisAlerts:
@gautamz07authorDec 19.2014 — the important part was learning the oops concept ? the rest really does't matter to me ?
Copy linkTweet thisAlerts:
@ginerjmDec 19.2014 — You give us a smattering of code and say there are errors with it. Very helpful. Hope this response is just as helpful. Maybe one day when you stop doing things backward you'll make a proper post and really give us a problem to solve.

Switch to mysqli or better yet use PDO - great for OOP!
Copy linkTweet thisAlerts:
@NogDogDec 19.2014 — I doubt there will be many readers here willing to set up a copy of your application and DB just to help you debug. If you want to report specific error messages here you don't understand, and the relevant code cited by those errors, we can try to help you understand what the issue is. And don't forget to turn on all error reporting:
[code=php]
<?php
ini_set('display_errors', true); // turn off for production
error_reporting(E_ALL | E_STRICT);
[/code]
Copy linkTweet thisAlerts:
@gautamz07authorDec 20.2014 — Thanks nogDog ? i'll start with that .
×

Success!

Help @gautamz07 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...