Domanda

Quando richiedo questa funzione

    //Add the content to the database
function articleadd() {
    mysql_query("INSERT INTO site_content (title,content,reference,author,userid,authorip,day,month,year,token) VALUES ('$title','$articlebody','$reference','$author','$userid','$ipaddress','$day','$month','$year','$token')");
}

Per qualche motivo sconosciuto produce un errore del server interno. Onestamente non ho idea del perché, chiedo questa funzione di seguito e funziona bene

    //Add a message if the user is not logged in
function message() {
mysql_query("INSERT INTO messages (from,to,subject,content,type,ip) VALUES ('$userid','$userid','The content $title is pending completion.','A article was attempted to be saved, however when the we tried to saved it there was no-one logged in. As a result we saved the article but quarantined it so it will not show on the website. To correct this error, please click the link below, review the article and confirm it should display on the site. <a href=$url>$url</a>','$type','$ipaddress')");

}

Con entrambi li sto chiedendo uno dopo l'altro come segue

    articleadd()
    message()

Ho, nella funzione che non funziona ha sostituito tutta la query MySQL con un molto semplice

    echo "hello world";

Eppure ricevo l'errore.

Ho provato a copiare e incollare le cose anche la parola "funzione" per assicurarmi di non commettere un errore sciocco. Purtroppo non ho accesso al registro del server con il mio provider di hosting. Infine, sono consapevole che non sto passando le variabili, e questo è un problema separato, ma sulla base del fatto che si lavora con le variabili e il test "Hello World" non può essere il problema.

Nessuna soluzione corretta

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top