Ciao a tutti, ho difficoltà a far funzionare questo codice PHP:
Scritto così non funziona.
Premetto che echo della variabile $GLOBALS['tabella'] restituisce correttamente "computer"
se invece lo scrivo così funziona...
grazie in anticipo....
Scritto così non funziona.
Premetto che echo della variabile $GLOBALS['tabella'] restituisce correttamente "computer"
PHP:
require_once("blocks/config.php");
class ajax_table {
..................
function delete_record($id){
if($id){
$tab = $GLOBALS['tabella'];
mysql_query("delete from $tab where id = $id limit 1");
return mysql_affected_rows();
}
}
..................
se invece lo scrivo così funziona...
PHP:
require_once("blocks/config.php");
class ajax_table {
..................
function delete_record($id){
if($id){
$tab = "computer";
mysql_query("delete from $tab where id = $id limit 1");
return mysql_affected_rows();
}
}
..................
grazie in anticipo....