oevelse9: intet vil virke, og jeg er tom for ideergreenspun.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 "
Restaurant Score Ratings
" while { [ns_db getrow $db $selection] } { set_variables_after_query append restaurant "$rest_name $average $ratings Rate it... " } ns_return 200 text/html [home_page "Kommentarservice" "Restaurant kommentarservice
$restaurant