Perché non mi inserisce i dati nel database?

di Anonimizzato11392 il
1 risposte
Non mi da errori ma non inserisce più nulla!

Questo é la pagina da dove invio i dati
_______________________________________________
<?php
session_start();
echo $_SESSION['nome_utente_segreteria'];
if(isset($_SESSION['nome_utente_segreteria'])==false){ header( "Location: Index.php"); }
?>
<html>

<head>
<title> Gestione Segreteria </title>
</head>

<body>
<body background="download1.jpg"; background-repeat: no-repeat;>
<?php
$host="localhost";
$user="root";
$pass="";
$db= "studio_dentistico";
$conn=mysql_connect($host,$user,$pass);
mysql_select_db($db,$conn);
$query="SELECT * FROM anagrafica_pazienti";
if($result = mysql_query($query,$conn))
?>
<center>
<p align="center">
<h1> Gestione Segreteria </h1>
<hr size=”1?>
<h2> Inserimento Paziente </h2>
<form action="GS_InserimentoPaziente.php" method="POST">
Nome: <input type="text" name="nome" value ="" /> <br>
Cognome: <input type="text" name="cognome" value ="" /> <br>
DataN: <input type="date" name="datan" value ="" /> <br>
Cellulare: <input type="int" name="cellulare" value ="" /> <br>
eMail:<input type="text" name="email" value ="" /> <br>
<input type="submit" value="Inserimento Paziente">
</form>

eccettera eccetera (le altre funzioni sotto funzionano)
__________________________________________________________________
Questa la pagina dove inserisce i dati ricevuti
__________________________________________________________________
<?php
session_start();
echo $_SESSION["nome_utente_segreteria"];
if(isset($_SESSION["nome_utente_segreteria"])==false){ header( "Location: Index.php"); }
?>
<html>

<head> <title> Acquisici Paziente </title> </head>

<body>
<?php
$host="localhost";
$user="root";
$pass="";
$db= "studio_dentistico";
$conn=mysql_connect($host,$user,$pass);
mysql_select_db($db,$conn);
$query="INSERT INTO anagrafica_pazienti (Nome,Cognome,DataN,Cellulare,eMail) VALUES ('$_POST[nome]','$_POST[cognome]','$_POST[datan]','$_POST[cellulare]','$_POST[email]')";
if($result = mysql_query($query,$conn));
?>

<center> <img src="fatto.jpg" /> </center>

</body>
</html>
______________________________________________________________

Non mi da nessun errore, mi appare l'immagine che voglio ma non inserisce nulla nel database, prima funzionava, mettendo le sessioni (che funzionano) ha smesso ma non capisco perché!

Questo é l'inserimento (che funziona) da phpmyadmin
INSERT INTO `studio_dentistico`.`anagrafica_pazienti` (`MatricolaPaziente`, `Nome`, `Cognome`, `DataN`, `Cellulare`, `eMail`) VALUES ('1', 'Luca', 'Damonte', '1995-13-09', '12343454', '');

Anche aggiungendo il nome del database dopo "INSERT INTO" non va! :/

1 Risposte

  • Non so perché ora funziona
    che strano il php
    vabbé grazie lo stesso a tutti!
Devi accedere o registrarti per scrivere nel forum
1 risposte