Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
help with adding data to database
Old 12-06-2002, 11:57 PM help with adding data to database
Precision's Avatar
Skilled Talker

Posts: 57
Location: New York
Trades: 0
Hello,
I am a very new newbie at PHP and need some help with adding this one data to the field "catid."

Here's the code I have for the catid form part..
Code:
echo "<br><b>Issue:</b> <select name=\"catid\">";
    
	$selcat = sql_query("select catid, title from ".$prefix."_stories_cat order by catid DESC limit 2", $dbi);
	while(list($catid, $title) = sql_fetch_row($selcat, $dbi)) {
	            if ($catid==$title) {
	    $sel = "selected ";
	}
		echo "<option $sel value=\"$catid\">$title</option>";
	$sel = "";
    }
    echo "</select>";
here's the code i have to enter the cat id into the database...

Code:
$result = sql_query("insert into ".$prefix."_queue values (NULL, '$uid', '$name', '$subject', '$story', '$storyext', now(), '$topic', '$catid', '$alanguage')", $dbi);
I have a normal page, and then a preview page. I am also having trouble with creating the selected field. After the you select the catid and then preview, the selected field becomes default again. I tried to fix it with the $sel but had not luck, i just left it in there just in case one day I or anyone of you guys can figure it out

Thank You
__________________
-Precision Out
Precision is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to help with adding data to database
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18129 seconds with 12 queries