Results 1 to 4 of 4
Aug 13, 2001, 04:30 #1
html select, and inserting to var. ?!
Hi all again !
now i just wanna know this, i have html select which will sort the sub_cat, sub_cat_id, and catagory :
$sql_cat="select * from subcat";
echo "<select name=\"newsub_cat\">";
echo"<option value=\"$sub_cat\">:: $catagory ::: $sub_cat ::: $sub_cat_id ::</option>";
i was trying with this :
$query = mysql_query("Select catagory from subcat where newsub_cat='$sub_cat'",$db);
list($sub_cat_id, $sub_cat, $catagory) = mysql_fetch_row($query);
echo "[$catagory] $newsub_cat";
Last edited by Richi; Aug 13, 2001 at 04:42.
Aug 13, 2001, 06:38 #2
- Join Date
- Jul 2000
- 0 Post(s)
- 0 Thread(s)
From the mySQL Documentation
http://www.mysql.com/doc/U/P/UPDATE.html"Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
Aug 13, 2001, 06:47 #3
ok, i know that, but here i have var.,from this var. i need to update or to insert to db. 2 var. !
when i select from the html select, ill choose the sub_cat, which i can insterted to the db. but how can i insert also this sub_cat main catagory also into the db. ?
Field Type Attributes Null Default Extra Action sub_cat_id int(7) No auto_increment Change Drop Primary Index Unique sub_cat varchar(30) Yes Change Drop Primary Index Unique catagory varchar(30) No
Aug 13, 2001, 07:09 #4
done with this code :
$query = mysql_query("Select * from subcat where sub_cat='$newsub_cat'");
$count = mysql_num_rows($query);
$h = mysql_fetch_array($query);