473,386 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

radio buttons on fetched data

ive this code which fetches track title and artist name from the database ,,,, i want to insert radio button in front of each fetched row through which user wud b able to select a song which he wants to download

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3.  
  4. include 'oracleconn.php';
  5.  
  6.  
  7.  
  8.   $conn = connect();
  9.  
  10.  
  11. $query = 'select ttitle, artist from Track';
  12. $stid = oci_parse($conn, $query);
  13. $r = oci_execute($stid);
  14.  
  15. // Fetch the results in an associative array 
  16.     print '<table border="1">';
  17. while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC)) {
  18.    print '<tr>';
  19.  
  20.    foreach ($row as $item) {
  21.       print '<td>'.($item?htmlentities($item):' ').'</td>';
  22.    }
  23.    print '</tr>';
  24. }
  25. print '</table>';
  26.  
  27. // Close the Oracle connection
  28. oci_close($conn);  
  29.  
  30.  
  31. ?>
  32.      <p>&nbsp; </p>
Nov 5 '08 #1
2 1339
Markus
6,050 Expert 4TB
jaguarpk786, this is your second warning on using [code] tags (or more fittingly: not using [code] tags). It is against forum guidelines to post code without using code tags. Continue to do this, and you will receive a ban of some sort.

Please review the posting guidelines to avoid this action being taken.

MODERATOR.
Nov 5 '08 #2
nathj
938 Expert 512MB
It's seems like a nice idea, just do it.

As you are using tables (aarrghh) simply add another row on the left or right contain these input controls and then in your code populate the elements with input controls.

Based on the code I read it looks to me like you would be better off with check boxes. they would certainly be easier if you want multi-selection facility. If I've mis-understood that part of it and it is a forced single selection then you will want a radio button but with your layout the code is going to be awful.

If you need a tutorial on either of these controls head over to W3Schools HTML tutorial

Have a go and let us know how you get on - posting final code in code tags!

nathj
Nov 7 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Owen Funkhouser | last post by:
I have a form with three radio options. And I have three buttons: <input type="submit" name="mainform_action" value="Edit Data"> <input type="submit" name="mainform_action" value="View Data">...
15
by: JR | last post by:
Hi. I hope someone out there who is more versed with JavaScript than I can help me with the following annoying problem. Here's the problem. I have a form with the following layout: Column A...
4
by: Jay | last post by:
I have a form used to submit data (no surprises there!). I'd like to be able to populate the same form with previously submitted data. The data lives in a database once submitted and using ASP I...
4
by: Jared | last post by:
Radio Button or Check Box and Event Procedures I need to insert either radio buttons or check boxes onto my form. I'm not sure which to use, or if there are other options. I am using the buttons...
2
by: James P. | last post by:
Help, I need to display radio buttons on a form. The data is from SQL table: each row in each table is displayed as a radio button. I have multiple SQL tables so I understand I need to put...
5
by: Dabbler | last post by:
What is the best way to handle data interpolation between form controls and the actual sql data field. I have radio buttons that need to be interpreted, form values that have to be translated.....
2
by: alomrani | last post by:
Hi all , I'd appreciate anyone insight on this I have created a form that fetched rows from a query. On each row I have added buttons to execute command for that relevant row only. The Form...
4
by: Blasting Cap | last post by:
I have a page that has a number of radio buttons that will be displayed to different access levels of a user who logs in to my website. For instance, if there are a dozen buttons, user1 will see...
7
by: gengyue | last post by:
Hi, I am running a report using Cold Fusion. This report is generated by cfloop tag. Depends on the record count of a query, the report will list the data retrieved from the database. each row in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.