algolfier 4 years ago
parent 3354e0e404
commit 81a5cc6050

@ -3,7 +3,7 @@ class MyDB extends SQLite3
{
function __construct()
{
$this->open('highscore.db');
$this->open('HighscoreBD.db');
//$this->exec('CREATE TABLE partieScore(IdPartie STRING PRIMARY KEY,scorePremierJ STRING,scoreDeuxiemeJ STRING, pseudoPremierJ STRING,pseudoDeuxiemeJ STRING)');
//$this->exec('CREATE TABLE partieCartes(IdPartie STRING ,IdCarte STRING,colUn STRING, colDeux STRING, colTrois STRING)');

@ -22,30 +22,26 @@
</head>
<body onload="settingOpen()">
<button id="buttons" type="button" class="btn btn-primary btn-lg" >insererjoueur</button>
<!--
<form method="post">
<input name="highscore" type="text">
Entrez votre pseudo : <input type="text" name="nomjoueur"/> <br/>
<input type="submit" name="valider" value="OK"/>
</form>
<?php
require_once("ConnexionBD.php");
session_start();
if (isset ($_POST['valider'])){
$nomjoueur=$_POST['nomjoueur'];
connectmabase();
$sql = "INSERT INTO highscore.joueur VALUES ('','$nomjoueur')";
mysql_query ($sql) or die ('Erreur SQL !'.$sql.'<br />'.mysql_error());
echo "<h2 id='ids'>Nom : <strong>$nomjoueur</strong></h2>";
?>
-->
<script>
$(document).ready(function(){
$(document).on('click','#buttons',function() {
alert("Création des lignes tables")
$("#div1").load('insererscore.php')
});
});
</script>
<div id="div1">
</div>
<div id="pageAccueil">
<div class="logo">
@ -795,6 +791,3 @@ echo "<h2 id='ids'>Nom : <strong>$nomjoueur</strong></h2>";
</body>
</html>

@ -0,0 +1,12 @@
<?php
require_once("connexionBD.php");
$db = new MyDB();
$db->query('INSERT INTO JOUEUR(nomjoueur) VALUES("AlexLeB")');
Loading…
Cancel
Save