![]() |
| ||
| Retreiving variables from a sql query into a form I need to add a paypal 'add to cart' button to my page to submit the contents of my table to a shopping cart. The contents of the table are variables as they are from a sql query. Does anyone know hoe I could get the paypal link(script below) to retreive the variables from my query and submit them to the shopping cart. <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> I need $myrow[0] to be used for item_number, $myrow[1],$myrow[2],$myrow[3] and $myrow[4] to be combined to make item_name and $myrow[5] to be used for Ammount. Thanks Huw |
| ||
| Re: Retreiving variables from a sql query into a form can you provide more specifics on sql versions, platform, etc? |
| ||
| Re: Retreiving variables from a sql query into a form Quote:
The Host company use Linux servers and run the latest versions of SQL & PHP Huw |
| ||
| Re: Retreiving variables from a sql query into a form You could run a query like: [php]<?php // don't forget to create a connection to database first! // i.e.: @mysql_connect('localhost','username','password'); // and choose a database @mysql_select_db('database_name'); // fetch the info from database $myrow = @mysql_query("SELECT * FROM table"); // make it so that it's like $myrow[0], $myrow[1], etc. $myrow = mysql_fetch_row($myrow); ?>[/php] |
| All times are GMT -4. The time now is 3:58 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC