oevelse9: intet vil virke, og jeg er tom for ideer

greenspun.com : LUSENET : WebdesignII : One Thread

Jeg får disse fejlmeddelelser når jeg går fra restaurant.tcl til restaurant_add.tcl når jeg trykker på rate it: can't read "rest_name": no such variable while executing "ns_returnredirect "form.tcl?rest_name=$rest_name&rest_id=$nextval" " (file "/web/mlysholt/www/oevelse9/restaurant_add.tcl" line 18) invoked from within "source $file" Når jeg skriver ny restaurant: can't read "rest_id": no such variable while executing "if { $rest_id != "" } { set selection [ns_db select $db "select rest_name from restaurant where rest_id=$rest_id"] } else { set selection [database..." (file "/web/mlysholt/www/oevelse9/restaurant_add.tcl" line 5) invoked from within "source $file" Min restaurant.tcl: set_form_variables 0 proc home_page {...} } set db [ns_db gethandle] set query "select restaurant.rest_id, rest_name, avg(rating) as average, count(*) as ratings from restaurant, rating where restaurant.rest_id = rating.rest_id group by restaurant.rest_id, rest_name order by average desc" set selection [ns_db select $db $query] set restaurant "
" while { [ns_db getrow $db $selection] } { set_variables_after_query append restaurant "" } ns_return 200 text/html [home_page "Kommentarservice" "

Restaurant kommentarservice

$restaurant

RestaurantScoreRatings 
$rest_name$average$ratingsRate it...

Skriv en ny kommentar

Indtast restaurant-navn: "] Min restaurant_add.tcl: set_the_usual_form_variables 0 set db [ns_db gethandle] if { $rest_id != "" } { set selection [ns_db select $db "select rest_name from restaurant where rest_id=$rest_id"] } else { set selection [database_to_tcl_string $db "select rest_id from restaurant where upper(rest_name)=upper($QQrest_name)"] } if { $selection == "" } { set nextval [database_ to_tcl_string $db "select id_seq.nextval from dual"] ns_db dml $db "insert into restaurant (rest_id, rest_name) values ($val, '$rest_name')" set_ } ns_returnredirect "form.tcl?rest_name=$rest_name&rest_id=$nextval" Jeg sidder fuldstændig fast!

-- Merete Lysholt (mlysholt@it-c.dk), April 21, 2002


Moderation questions? read the FAQ