User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,595 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,417 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 6242 | Replies: 3
Reply
Join Date: Aug 2004
Posts: 6
Reputation: huwgomez is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
huwgomez huwgomez is offline Offline
Newbie Poster

Retreiving variables from a sql query into a form

  #1  
Aug 5th, 2004
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">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="info@wildcar.co.uk">
<input type="hidden" name="item_name" value="">
<input type="hidden" name="item_number" value="">
<input type="hidden" name="amount" value="">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="GBP">
</form>

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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2004
Location: VA, USA
Posts: 459
Reputation: TKS will become famous soon enough TKS will become famous soon enough 
Rep Power: 6
Solved Threads: 17
TKS's Avatar
TKS TKS is offline Offline
Posting Pro in Training

Re: Retreiving variables from a sql query into a form

  #2  
Aug 16th, 2004
can you provide more specifics on sql versions, platform, etc?
My Home Away from Home: Yet Another Linux Blog
Reply With Quote  
Join Date: Aug 2004
Posts: 6
Reputation: huwgomez is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
huwgomez huwgomez is offline Offline
Newbie Poster

Re: Retreiving variables from a sql query into a form

  #3  
Aug 17th, 2004
Originally Posted by TKS
can you provide more specifics on sql versions, platform, etc?


The Host company use Linux servers and run the latest versions of SQL & PHP

Huw
Reply With Quote  
Join Date: Nov 2003
Location: Toronto, Canada
Posts: 354
Reputation: Gary King will become famous soon enough Gary King will become famous soon enough 
Rep Power: 6
Solved Threads: 5
Colleague
Gary King's Avatar
Gary King Gary King is offline Offline
PHP/vBulletin Guru

Re: Retreiving variables from a sql query into a form

  #4  
Aug 23rd, 2004
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]
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 6:53 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC