macpeace
09-11-2009, 10:36 PM
Hello again...
Maybe someone can help me with this:
TABLES:
categorias: id_cat - cat_name
catalogo: id - id_cat - id_img - name - desc - status
In a form I submit the content for insert in catalogo. In one input, I lookup for categorias (cat_name) but only for displaying ther name, because what i need to insert in catalogo field is the id_cat. I've the following code:
--------------------------------------------------------------------
$id = $_POST['id'];
$catg = $_POST['catg']; //it passes the categorias cat_name, but i need the id_cat
$catalogname = $_POST['catalogname'];
$catalogdesc = $_POST['catalogdesc'];
$stat = $_POST['stat'];
if ($catalogname == ""){
echo "<h3>Empty Fields...</h3>";
}else{
mysql_query("INSERT INTO `catalogo` VALUES ('','$catg','','$catalogname','$catalogdesc','$stat')");
Maybe someone can help me with this:
TABLES:
categorias: id_cat - cat_name
catalogo: id - id_cat - id_img - name - desc - status
In a form I submit the content for insert in catalogo. In one input, I lookup for categorias (cat_name) but only for displaying ther name, because what i need to insert in catalogo field is the id_cat. I've the following code:
--------------------------------------------------------------------
$id = $_POST['id'];
$catg = $_POST['catg']; //it passes the categorias cat_name, but i need the id_cat
$catalogname = $_POST['catalogname'];
$catalogdesc = $_POST['catalogdesc'];
$stat = $_POST['stat'];
if ($catalogname == ""){
echo "<h3>Empty Fields...</h3>";
}else{
mysql_query("INSERT INTO `catalogo` VALUES ('','$catg','','$catalogname','$catalogdesc','$stat')");