Salve oggi ho creato uno script ma mi da l'errore "Query was empty" qualcuno mi potrebbe aiutare io ho riguardato tutto...ecco il mio codice:
Codice PHP:
<?php
//oggetto start
ob_start();
//sessione start
session_start();
/*recupero le variabili inviate tramite get e definisce la data corrente */
$name = $_GET[$nome];
$data = date("d/m/Y");
$richiesta = amicizia;
//connesione al database
include("config.ini.php");
//query
$id = mysql_query("SELECT id FROM utenti WHERE nome = '".$name."'");
if(!mysql_query($query,$dbh)) /*eseguo la query e controllo se va a buon fine ^^*/
die("<h1>".mysql_error()."</h1>");
$richiesta = "INSERT INTO richieste.".$array['id']." (id_amico, tipo_richiesta, data_amicizia) VALUES ('".$session[id]."' , '".$richiesta."' , '".$data."')";
if(!mysql_query($query,$dbh)) /*eseguo la query e controllo se va a buon fine ^^*/
die("<h1>".mysql_error()."</h1>");
mysql_close($dbh);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Richiesta effetuata con sucesso</title>
</head>
<body>
[img]loghi/logo.png[/img]
<div style="text-align: center;">Richiesta inviata con
sucesso[url="home.php"]torna alla home[/url]</div>
</body>
</html>