ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
<?php
echo "<form method=\"post\" action=\"roster_process.php\" name=\"roster\">";
require_once "DB.php";
require_once "footballdb.php";
$conn =& DB::connect (fantasydb_dsn ());
if (DB::isError ($conn))
die ("Cannot connect to server");
$query1 ="CREATE TEMPORARY TABLE temp SELECT
DISTINCT CONCAT(qb_stats.first_name,\" \",qb_stats.last_name) AS qb_name FROM qb_stats";
$result = mysql_query($query1) or die ("Query for qbtemp");
$query = "SELECT temp.qb_name FROM temp,members WHERE members.name=temp.qb_name
AND members.owner=\"$owner\"";
$result = mysql_query($query) or die ("Query for QB");
//let's get the number of rows in our result so we can use it in a for loop
$numofrows = mysql_num_rows($result);
for($i = 0; $i < $numofrows; $i++)
{
$row = mysql_fetch_array($result); //get a row from our result set
echo "<FONT SIZE=\"2\"><input name=\"qb_group\"
value=".$row[0]." type=\"radio\"> ".$row[0]."</FONT><br>";
}
//now let's close the table and be done with it
"DROP TABLE temp";
$conn->disconnect ();
echo "<input name=\"submit\" value=\"Enter\" type=\"submit\"></div>
</form>";
?>
Which is supposed to place qb_name's(first and last) next to radio buttons in a form. It is also supposed to send the selected qb_name(first and last) to another page (roster_process.php) when the Enter button is pressed.
what happens is, on the form next to the radio buttons the first and last names of the desired qb's appear however on the roster_process.php page only the first name appears.
What is prohibiting both the first and last name of qb_name from being displayed on the roster_process.php page. I hope I have given enough detail about this problem for someone to be able to see the problem. The more I try to figure this out the less I understand.
If you want to select multiple values then you'll need to use checkboxes instead of radio buttons as well as making the changes keefaz mentioned above.
I corrected the code as you instructed but I get the same results, "first_name" only for the
roster_process.php page and "first_name last_name" for the originating roster.php page. I can not understatd this. It seems to me that ".$row[0]." should contain the exact same data for both instances.
You fixed it. It works as should. I am now confused by the fact that the old code placed the first_name on the roster_process.php page. Why did it place anything there at all? The code as it is now has two sets of .$row[0]. one with double quotes(escaped) and one with single quotes. They dont act the same way. If I place double quotes(escaped) on both, I end up with quotes around the name on the originating page but not on the roster_process page.
Anyway thanks for fixing this for me and if you have the time mabey you could clear up my question as well.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.