I got this to work in its entirety today. My biggest confusion was that I did not know $Variable[#] was an array! Now that I know that, what you were saying makes perfect sense.
You're right, I will go through the code and do some massive cleaning up. This is actually my second time through. The first time was all hard coded tables without looping. It was arduous to deal with.
Thanks again for your help.
User Profile
Collapse
-
Okay, so this is starting to work. The $TVStation variable is echoing back within the loop - where you haveThanks for your help. This is a big step forward.Code:echo( $_POST['TVStation'.$a] );
Leave a comment:
-
I apologize for confusing the two quotes.
I changed the code to this...Code:$TVSQL = mysql_query("SELECT TVStation FROM NCF_tvstations ORDER BY TVStation ASC"); echo "<select name=TVStation[$a]><option value=''>Select TV</option>"; WHILE ($z = mysql_fetch_array($TVSQL)) { $TVStation[$a]Leave a comment:
-
I am still having trouble getting what's going on with the code I use. I use the exact same coding logic twice before on the same page but outside of the loop statement without issue.
I am using the loop statement because I am building multiple events; quantity determined by the user. The TV Station is a part of the event (the channel that the game is on), which can change for each event.
In your first response, you...Leave a comment:
-
I am using. Whenever I use $POST_, I lose the values and nothing prints.Code:echo $TVStation[$a];
I am usingto increment the variable each time the loop runs. IsCode:$a = $a+1
a better method to accomplish this?Code:$a++
Here is the entire code in case you are wondering - a lot of this is in-progress and requires clean-up:
...Code:<?php //Week Variable $Season_Start = mktime(0,0,0,8,30,2009);
Leave a comment:
-
Php Drop Down Menu Passing Last Row In Array
I have an issue with a drop down menu that I am hoping you all can help me with. The issue is when I press "Submit", my code prints back values from a form I developed (eventually I will write them to a database). In this form, I have a dynamically built drop down (php/ mysql query). No matter which value I select, it always prints the LAST row in the table (array) as the selected value. My code follows:
1) I connect... -
PHP Programming Resource
I am looking for a good web resource for php programming with Register Globals turned off. I built my entire site relying on global variables and now I would like to redo it the secure way. My host is requiring that I do this, so now or never for me!
Cheers,
Seth -
I see no one has responded. Perhaps I should re-write my question.
I got most variables to pass from one page to the next, however one continues to fail.
[php]
<?php session_save_pa th("/xxxxxx/");
session_start() ; ?>
--SOME HTML Code--
<?php //Sets Season to current season
$Season = '2007';
echo $Season;
$_SESSION['Season']...Leave a comment:
-
Dropdown Menu Passing Last Row as Session Variable
Recently my web host decided to "upgrade". This change rendered many of my pages useless and I am scrambling to fix the issues, so you may see several posts from me in the coming days.
My first issue is that all of my dropdown menus are passing the last row to the next page as the session variable. The pages that I am talking about can be found at:
Weekly13_Test
The code that follows was... -
Ronald,
As always, thanks for the response. I was making things more complicated than they need be. For one, I needed to have my submit statement on the second page and only echo back the variable - instead of submitting, and then recalling the values to the "my information page". The code is as simple as
[PHP]
dbConnect('my_d atabase');
echo $g1;
[/PHP]
As for...Leave a comment:
-
Sorry about the ill-formatted post.
Hello All. I have a problem with a form that I am trying to create. What happens is: I have a person enter a UserName and select some values using radio buttons. They submit the form, and the next page is intended to echo their information back. I was able to get the first page to write values to the database, but when I add the second page, the values do not write to the database and I get an...Leave a comment:
-
Php MySQL_query and echo conflict
Hello All. I have a problem with a form that I am trying to create. What happens is: I have a person enter a UserName and select some values using radio buttons. They submit the form, and the next page is intended to echo their information back. I was able to get the first page to write values to the database, but when I add the second page, the values do not write to the database and I get an error.
Here is a pared-down version... -
I got it! I changed the double quote to a single quote to get the following code. I had to convert the Date and Time columns into one DATETIME column.
[php]
<?php
$sql1B = "SELECT DATE_FORMAT(Dat eTimes, '%a. %b. %e, %Y - %I%:%i %p') AS DateTimes
FROM Shows WHERE ShowID = '$Show1'";
$query1B = mysql_query($sq l1B);
$DateTimes1 = mysql_result($q uery1B, 0);
echo $DateTimes1;
?>...Leave a comment:
-
I tried this method and I always get a parse error, unexpected T_STRING on line 103 (the first line of code):
[php]
mysql_query(SEL ECT DATE_FORMAT(col 1, "%a. %b. %e, %Y") AS Date
FROM Shows WHERE ShowID = '$ShowID1');
echo $row(Date);
[/php]
any suggestions are greatly appreciated.
Cheers,
SethLeave a comment:
-
[SOLVED] Date formatting
Hello all,
I have a table with a Date column and a Time column formatted as 'YYYY-MM-DD' and 'HH:MM:SS', respectively. I want to use php to print/ echo the date and time in the following format: "DayOfWeek. Month. DayOfMonth, Year, HH:MM PM" for example "Mon. Oct. 9, 2006 09:30 PM" (which is stored in the table as Col1 - 2006-10-09 and Col2 - 21:30:00).
I attempted to get the Date column formatted... -
Thanks Ronald! One more thing I had to do is to set the $_SESSION variables so the team names and game ids would carry all the way to form three. Works like a charm :-)
CHeers,
SethLeave a comment:
-
This is what I desire - "whatever you do in your second script will always be followed by an update to the MySql database."
But what I do in the first First form gets written in my table - it writes the row before I enter values into the "AwayScore" and "HomeScore" fields. I verified this by checking the table right after I hit the 1st submit ("submitok") . My code writes a row that has the...Leave a comment:
-
Complex Form Question
I have a 3-part form that I am having trouble with. First part is to select the user group and the week and year that I want to submit results for, this calls the elements that I want to update.
The second part is to enter the results and submit them to a MySQL table called results the final part echoes the results.
The issue is that my form writes the elements that I called up to the this table before I enter the...
No activity results to display
Show More
Leave a comment: