Jump to content

Hendz

New Members
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Hendz

  • Rank
    Newbie
  1. @requinix I created a new pdo Object, and fed in details of db like in config file. It doesnt throw the error anymore but then again when i run it it doesnt add given data lol. Sorry, Im php noob. im normally a java dev just learning this is stressful. class UserQuery { public function Adduser($id,$username,$email,$password){ $dsn = "mysql:dbname=test;host=127.0.0.1:3306"; $user = "root"; $passwd = "2194"; $pdo = new PDO($dsn, $user, $passwd); $sql =("INSERT INTO test.user (id, username, email, password) VALUES ('$id', '$username', '$email',$passw
  2. Yeah, i understand it needs to exist but ive read so much and cant figure it out. any hints to guide me in the right direction to solve this problem ?
  3. <?php class UserQuery { public function Adduser($id,$username,$email,$password) { $conn = new Config(); $sql =("INSERT INTO test.user (id, username, email, password) VALUES ('$id', '$username', '$email',$password)"); $conn->exec($sql); } } getting an "exec doesnt exist " error, saying exec doesnt exist in my db file. it doesnt need to exist does it ? anyone any idea why ?
  4. Thanks i added the name + id and it fixed my proble. enjoying php pretty similar to Java but just getting the hang of OOP and PDO a learning experience lol
  5. i Have this Form <form action="action_page.php" method="POST"> <div class="form-group"> <label for="email">Email address:</label> <input type="email" class="form-control" id="email"> </div> <div class="form-group"> <label for="pwd">Password:</label> <input type="password" class="form-control" id="pwd"> </div> <div class="checkbox"> <label><input type="checkbox"> Remember me</label> </div> <button type="submit" class="btn btn-default">Submit</button> </form>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.