Hi there, i’m trying to make a query, that i could put product into a database, but it does nothing and i can’t understand where is the problem. What i’m doing wrong here?
[php] function nameTaken($pavadinimas){
if(!get_magic_quotes_gpc()){
$pavadinimas = addslashes($pavadinimas);
}
$q = “SELECT pavadinimas FROM “.TBL_PREKES.” WHERE pavadinimas = ‘$pavadinimas’”;
$result = mysql_query($q, $this->connection);
return (mysql_numrows($result) > 0);
}
function addNewPrduct($pavadinimas, $kiekis, $vieneto_kaina){
$time = time();
$q = "INSERT INTO ".TBL_PREKES." VALUES ('','$pavadinimas','$kiekis','$vieneto_kaina')";
return mysql_query($q, $this->connection);
return (mysql_numrows($result) > 0);
}[/php]