
kenny22
Members-
Posts
12 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
kenny22's Achievements

Newbie (1/5)
0
Reputation
-
got it working by using session variable $colname_rsTeamselect = $_SESSION['category']; if (isset($_POST['team'])) { $colname_rsTeamselect = $_POST['team']; $_SESSION['category'] = $_POST['team']; may not be correct way but it works
-
i've narrowed down the problem to this bit of code $colname_rsTeamselect = "-1"; if (isset($_POST['team'])) { $colname_rsTeamselect = $_POST['team']; when i click to update form it reloads form using $colname_rsTeamselect = "-1"; instead of holding the previous value of $colname_rsTeamselect so i'm looking for a way to hold the value of $colname_rsTeamselect until a new $_POST['team'] is entered from search box
-
i have set up a search form which is linked to dynamic update form on the same page, when you pick an item from listbox in form 1 it will populate form2 (update form) with the data from DB and repeat for all matching records, the update of the form is done by using a checkbox (onclick), all this works fine and DB updates fine. My problem is when i check a checkbox in any of the update forms the data is updated but all the update forms are removed so if i want to update another record i need to enter original search again to get forms to display again i know the problem is because the page is refreshing when onclick is activated and it loses the search value so returns empty form. i know you can use java to stop page refreshing but never used it before and been trying to get it to work with no success, is there any other way to keep page from refreshing
-
needing some help on this, i have a form with a dynamic listbox and and textfields, what i need to do is when i select item from listbox i need it to fetch the data from DB and fill out rest of fields in form. i 'm using dreamweaver and can post code if required kenny
-
Thanks for reply more info for you, the form pulls in a list of names from database and has a check box for each name, i want to be able to select 11 names by checking the boxes next to the names and submit the form so it enters the value '1' into a field for each name example: name1, 1 (check box selected) name2, 1 (check box selected) name3, 0 (check box not selected) kenny
-
Is it possible to have multiple check boxes on a single form and a single submit button tp post the values into different rows of DB Kenny
-
correct was calling mysql_fetch_array() before loop, see my post above as i've edited it
-
thank you it works 95%, only problem is it misses out first record, if query returns 4 it will still show 4 forms but only 3 records leaving 1 form blank kenny Edit: :D code now working 100% had to remove $row_Recordset1 = mysql_fetch_assoc($Recordset1); from after select query as that was 1st record and was getting lost Many thanks again
-
Have a web page that displays a number of update forms depending on the amout of records that get returned from a mysql query, if query returns 4 records then the page will display 4 identical forms, the trouble i'm having is getting the each of the 4 forms to display a different record as at the moment they all show just first record of query. I have played around with loops but not getting anywhere which may be due to my limited knowledge code for page is below <?php $numberofrow =mysql_num_rows($Recordset1); for($counter = 1;$counter<=$numberofrow;$counter++){ ?> <label for="hometeam2"></label> <form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>"> <label for="hometeam"></label> <input name="fixid" type="text" id="fixid" value="<?php echo $row_Recordset1['FixtureID']; ?>" /> <input name="hometeam" type="text" id="hometeam2" value="<?php echo $row_Recordset1['hometeamname']; ?>" /> <label for="homescore"></label> <input name="homescore" type="text" id="homescore" value="<?php echo $row_Recordset1['homescore']; ?>" /> <label for="awayscore"></label> <label for="fixid"></label> <input name="awayscore" type="text" id="awayscore" value="<?php echo $row_Recordset1['awayscore']; ?>" /> <label for="awayteam"></label> <input name="awayteam" type="text" id="awayteam" value="<?php echo $row_Recordset1['awayteamname']; ?>" /> <input type="submit" name="update" id="update" value="Submit" /> <input type="hidden" name="MM_update" value="form1" />
-
First post and very much a newbie my html page has this script in header, however when i debug the line http.open("GET", url + escape(idValue) + "&rand=" + myRandom, true); returns a non defineded http, i've checked my "getagentids.php" file but cant see why its returning 0 i have included my getagentids.php script below Html page <script> var url = "getagentids.php?param="; function getagentids() { var idValue = document.getElementById("agid").value; var myRandom = parseInt(Math.random()*99999999); // cache buster http.open("GET", url + escape(idValue) + "&rand=" + myRandom, true); http.onreadystatechange = handleHttpResponse; http.send(null); } function handleHttpResponse() { if (http.readyState == 4) { results = http.responseText.split(","); document.getElementById('agfn').value = results[0]; document.getElementById('agsal').value = results[1]; document.getElementById('agtel').value = results[2]; document.getElementById('agid').value = results[3]; } } getagentids.php $con = mysql_connect('localhost', 'root', ''); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("test", $con); if(strlen($param)>0){ $result = mysql_query("SELECT * FROM contact WHERE ContactID LIKE '$param%'"); if(mysql_num_rows($result)==1) { while($myrow = mysql_fetch_array($result)){ $agentname = $myrow["ContactFullName"]; $agenttel = $myrow["ContactTel"]; $agentsal = $myrow["ContactSalutation"]; $agentid = $myrow["ContactID"]; $textout .= $agentname.",".$agentsal.",".$agenttel.",".$agentid; } } else { $textout=" , , ,".$param; } } echo $textout;
-
here in uk, 3pts for win, 1 for a draw what i have come up if ($score1 > $score2) { $homepoints = '3'; $awaypoints = '0'; $homewin = 'W'; $awaywin = 'L'; } if ($score1 < $score2) { $homepoints = '0'; $awaypoints = '3'; $homewin = 'L'; $awaywin = 'W'; } if ($score1 == $score2) { $homepoints = '1'; $awaypoints = '1'; $homewin = 'D'; $awaywin = 'D'; } going to do some more work on form page so that it looks at the value of $homewin, $awaywin and allocates points from there, was hoping someone had already solved this problem before thanks for reply kenny
-
I'm in the process of creating a webage that shows latest scores and an updated league table for soccer/football matches like the bbc sports website does. I have the database set up with a form to update and display latest score all work well apart from if i update a score like the following teamA 1 teamB 0 it updates table to give teamA 3 points based on the current score however if teamA score again teamA 2 teamB 0 it updates table again but gives teamA another 3 points which is not correct so i need a way to stop it happening. thought about it for a while and only thing i can come up with is some maths to compare the values of score for each team and add/remove points as dependent on current score. Anyone got something similar to this