Thread View: adobe.golive.dynamic.content
3 messages
3 total messages
Started by Jeremy_M._Cox
Mon, 09 Aug 2004 15:01
Simple voting question
Author: Jeremy_M._Cox
Date: Mon, 09 Aug 2004 15:01
Date: Mon, 09 Aug 2004 15:01
12 lines
1949 bytes
1949 bytes
I have a simple interface where a user can click on a students name which is a link to the next page, a details page if you will. A page parameter is passed to fill the next page with the information pulled from the db table with the corresponding primary key in this case the student's ID.
This information is inside a form with only a hidden field named "vote" and a value of // '<?php echo pageParameter("showme",""); ?>' The showme contains the primary key so that when the submit button is pressed the students's ID is posted.
The form action is linked to the next page which is a simple thank you for voting. It also contains some php script.
// <?php $vote = $_POST['vote']; // $query = "update tbaotw set atw_votes = atw_votes + 1 where atw_ID = '$vote' "; // ?>
I know the ID is being posted because I can use the echo command to display the current ID that was passed. The script executes but the db isn't updated. The query works with in phpMyAdmin but not in GoLive.
Am I doing something wrong. Do I have to create a select statement to retrieve the value for atw_votes and then add 1 to it. then add it to the db.
Any help would be appreciated. Thanks
Re: Simple voting question
Author: Jeremy_M._Cox
Date: Mon, 09 Aug 2004 17:09
Date: Mon, 09 Aug 2004 17:09
1 lines
928 bytes
928 bytes
Sometimes just posting stuff makes you realize what an idiot you are and how simple the solution is. The solution as simple as db connection via an include file and ACTUALLY RUNNING the query with the mysql_query function. So forget this post unless you are wanting to do the same thing.
Re: Simple voting question
Author: Jerry_Artman
Date: Wed, 11 Aug 2004 17:33
Date: Wed, 11 Aug 2004 17:33
1 lines
722 bytes
722 bytes
I was wondering where the connection was :-)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads