Forum Moderators: coopster

Message Too Old, No Replies

Session Post?

         

amwd07

12:42 pm on Dec 2, 2007 (gmt 0)

10+ Year Member



I am trying to insert data into 1 database field
$ins_restaurant_ratings->addColumn("rate", "STRING_TYPE", "SESSION", "ratings");

I can see the session is working because when I submit the commas are in the DB but no ne of the values are there?

So I know my implode works but my $_POST don't seem to show?

$service = $_POST['service'];
$atmosphere = $_POST['atmosphere'];
$cleanliness = $_POST['cleanliness'];
$value = $_POST['value'];
$experience = $_POST['experience'];

$ratings = array("$service", "$atmosphere", "$cleanliness", "$value", "$experience");
$ratings_combined = implode(",", $ratings);

session_start();
$_SESSION['ratings'] = $ratings_combined;

PHP_Chimp

2:11 pm on Dec 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



have you looked at both
print_r($_POST);
print_r($_SESSION);
to see what is going on with both of these?

amwd07

2:25 pm on Dec 2, 2007 (gmt 0)

10+ Year Member



I have tried this with the following results
but still only shows up the commas in the DB

Array ( [name] => adam [email] => sales@test.co.uk [postcode] => SY3 8LP [service] => 4 [atmosphere] => 5 [cleanliness] => 4 [value] => 5 [experience] => 4 [comments] => test [dine_id] => [accountname] => [user_id] => [onhold] => [KT_Insert1] => Rate Outlet ) Array ( [KT_lastsiteroot] => d0e619c8b5b8e6a9aa2b6a8e19f6a3be [service] => 4 [atmosphere] => 5 [cleanliness] => 4 [value] => 5 [experience] => 4 [ratings] => 4,5,4,5,4 )

amwd07

2:34 pm on Dec 2, 2007 (gmt 0)

10+ Year Member



It seems to work on refresh but not when I post the data

Refresh:
Array ( [KT_lastsiteroot] => d0e619c8b5b8e6a9aa2b6a8e19f6a3be [service] => 5 [atmosphere] => 5 [cleanliness] => 5 [value] => 4 [experience] => 5 [ratings] => 5,5,5,4,5 )

post by submit:
Array ( [KT_lastsiteroot] => d0e619c8b5b8e6a9aa2b6a8e19f6a3be [service] => [atmosphere] => [cleanliness] => [value] => [experience] => [ratings] => ,,,, )

amwd07

3:10 pm on Dec 2, 2007 (gmt 0)

10+ Year Member



I have tested to see if the session is working with print_r($_SESSION); before submit

Array ( [KT_lastsiteroot] => d0e619c8b5b8e6a9aa2b6a8e19f6a3be [service] => [atmosphere] => [cleanliness] => [value] => [experience] => [ratings] => ,,,, )

when I press submit my print_r now shows, please anyone any idea's as why it is showing the array before submit?

Array ( [KT_lastsiteroot] => d0e619c8b5b8e6a9aa2b6a8e19f6a3be [service] => 4 [atmosphere] => 5 [cleanliness] => 4 [value] => 5 [experience] => 4 [ratings] => 4,5,4,5,4 )

amwd07

4:09 pm on Dec 2, 2007 (gmt 0)

10+ Year Member



ahhhhhhhhh I had the session after the insert, I put it before and it works now

Thanks anyway :)