Nicolvian's Forum Posts

  • I realized afterwards. except that the error persists.

    Fatal error: Uncaught Error: Call to a member function prepare() on null in C:\wamp64\www\login.php on line 13
    
    Error: Call to a member function prepare() on null in C:\wamp64\www\login.php on line 13
    
  • on my php page.

    3 errors.

     Notice: Undefined variable: base in C:\wamp64\www\login.php on line 13
    
    Fatal error: Uncaught Error: Call to a member function prepare() on null in C:\wamp64\www\login.php on line 13
    
    Error: Call to a member function prepare() on null in C:\wamp64\www\login.php on line 13
    
  • I have to create my table.

    she is called user.

    AJAX.LastRequest shows nothing.

  • no /:

  • <?php
    
    try
    {
     $bdd = new PDO('mysql:host=localhost;dbname=stockage;charset=utf8', 'root', '');
    }
    catch (Exception $e)
    {
     die('Erreur : ' . $e->getMessage());
    }
    
    	$sql = "SELECT id FROM user where username = ?";
    	$stmt = $base->prepare($sql);
    	$stmt->bind_param("s", $_GET['name']);
    	$stmt->execute();
    	$result = $stmt->get_result();
    	$row = $result->fetch_object();
    	echo $row->id;
    
    ?>
  • <?php header('Access-Control-Allow-Origin: *'); // Connection BDD /////////////////////////////////// try { $base = new PDO('mysql:host=localhost; dbname=stockage', 'root', ''); } catch(exception $e) { die('Erreur '.$e->getMessage()); } ///////////////////////////////////////////////////// $sql = "SELECT id FROM members where username = ?"; $stmt = $base->prepare($sql); $stmt->bind_param("s", $_GET['name']); $stmt->execute(); $result = $stmt->get_result(); $row = $result->fetch_object(); echo $row->id; ?>

  • Hello. I am trying to return the ID of my user.

    except that nothing is displayed.

    <?php header('Access-Control-Allow-Origin: *'); // Connection BDD /////////////////////////////////// try { $base = new PDO('mysql:host=localhost; dbname=stockage', 'root', ''); } catch(exception $e) { die('Erreur '.$e->getMessage()); } ///////////////////////////////////////////////////// $stmt = $base->prepare("SELECT id FROM members where username = ?"); if ($stmt->execute(array($_GET['name']))) { while ($row = $stmt->fetch()) { echo($row["id"]); } } ?>

    http://zupimages.net/viewer.php?id=19/20/n3po.png

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • problem connecting database I followed a tutorial here:

    construct.net/en/tutorials/simple-login-using-a-mysql-database-312

    except that at home nothing happens.

    the variable remains at 0.

    and the objects do not fade.

    <?php header('Access-Control-Allow-Origin: *'); $dbhost = "localhost"; $dbname = "stockage"; $dbuser = "root"; $dbpass = ""; try{ $dbcon = new PDO("mysql:host={$dbhost};dbname={$dbname}",$dbuser,$dbpass); $dbcon->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $query = "SELECT id FROM members WHERE username = :username AND password = :password"; $statement = $dbcon->prepare($query); $statement->execute( array( "username" => $_GET["fname"], "password" => $_GET["fpass"] ) ); $count = $statement->rowCount(); if($count > 0) { echo "connetion etablie"; } } catch(PDOException $ex){ die($ex->getMessage()); } ?>