<?php
$SOC=" ";
$NOM1=" ";
$NOM2=" ";
$NOM3=" ";
$NOM4=" ";
$NOM5=" ";
$TITRE=" ";
$PUB=" ";
$AC1=" ";
$AC2=" ";
$O1=" ";
$O2=" ";
$O3=" ";
$MAIL=" ";
$GSM=" ";
$TEL=" ";
$SIDXCLI=" ";

// on se connecte à notre base pour client

$servername = "localhost:8889";
$username = "root";
$password = "root";
$dbname = "devis";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 
					 

$SIDXCLI = htmlentities($_POST['idxcli']);
	// print "dans la boite<br>";

    
	

					 $sql = "SELECT * FROM data";
$sql = "SELECT * FROM tete WHERE idx=1";
//$sql = "SELECT * FROM data WHERE id=".intval($_POST['idxcli'])." ";
//print $sql;					 
					// $sql = "UPDATE\n". "  `data`\n"." SET\n". " societe = \'testoooyeahhh\'\n". "WHERE\n". " id = 3";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
		

		
		
        //echo "Soc: " . $row["societe"]. " - Nom: " . $row["nom1"]. " - idx: " . $row["id"]. " " . $row["nom2"]. "<br>";
		//echo "Soc: " . $row["societe"]. " - Nom: " . $row["nom1"]. "  " . $row["nom2"]. "<br>";
    } 
    
	
	} else {
    echo "0 results";
}

//$sql = "INSERT INTO data (societe,nom1,nom2,nom3,nom4,nom5,titre,ac1,ac2,o1,o2,o3,mail,tel,gsm,pub,jour)
//VALUES ('$SOC' , '$NOM1', '$NOM2', '$NOM3', '$NOM4', '$NOM5', '$TITRE', '$AC1', '$AC2', '$O1', '$O2', '$O3', '$MAIL', '$TEL', '$GSM', '$PUB', //'$today')";


$conn->close();
					 
	?>			
	