473,770 Members | 5,925 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cant Get posted value

flexsingh
17 New Member
Hello there, I have constructed a option of choosing a court only available when member no = "0". This works fine and is in the first code: -

[PHP]<html>
<head>
</head>

<body background="mai n background1.jpg " link="blue" vlink="blue">

<table width="350" border="1" align="center" cellpadding="0" cellspacing="1" >
<tr>
<td><form name="Update Network Gaming form" method="post" action="updateb court_ac.php">
<table width="100%" border="1" cellspacing="1" cellpadding="3" >
<tr>
<td colspan="3" align="center"> <strong><font face="sans-serif, Arial" font color="white">I nsert Data Into mySQL Database </strong></td>
</tr>
<tr>
<td><font face="sans-serif, Arial" font color="white">M ember No</td>
<td><font color="white">: </td>
<td><input name="Member_No " type="int" id="Member_No"> </td>
</tr>
<tr>
<td><font face="sans-serif, Arial" font color="white">C ourt No</td>
<td><font color="white">: </td>
<td><input name="Court_No" type="varchar" id="Court_No" value="Bcourt"> </td>
</tr>

<tr>
<td><font face="sans-serif, Arial" font color="white">T ime Slot No</td>
<td><font color="white">: </td>
<td><select>

<?php
$db_name="proje ct"; // Database name
$tbl_name="bcou rt"; // Table name

// Connect to server and select database.
$conn = mysql_connect($ _SESSION['host'], $_SESSION['username'], $_SESSION['password'])or die("cannot connect");
mysql_select_db ("$db_name", $conn)or die("cannot select DB");

$time=urlencode ($_GET['Time_Slot_No']);

$time = "SELECT Time_Slot_No FROM $tbl_name WHERE Member_No = '0'";
$query = mysql_query($ti me, $conn); // do the query
while($queryCol umn=mysql_fetch _assoc($query)) { // fetch each row in the result set
$val=$queryColu mn['Time_Slot_No']; // make it simpler
echo "<option value='$val'>$v al</option>"; // construct option statement
}
?>
</select></td>
</tr>

<td colspan="3" align="center"> <input type="submit" name="Submit" value="Continue "></td>
</tr>
</table>
</form>
</td>
</tr>
</table>



</body>
</html>[/PHP]

It then sends the data to be updated into the table replacing the member number "0" to whatever was put in.

The problem I am getting is it can't update any time slot as it cant retieve the slot I asked for. It only updates member = "0".

[PHP]<?php
// this starts the session
session_start() ;
?>

<?php
$db_name="proje ct"; // Database name
$tbl_name="bcou rt"; // Table name

// Connect to server and select database.
mysql_connect($ _SESSION['host'], $_SESSION['username'], $_SESSION['password'])or die("cannot connect");
mysql_select_db ("$db_name") or die("cannot select DB");

// Get values from form
$memberno1=$_PO ST['Member_No'];
$courtno1=$_POS T['Court_No'];
$TSN1=$_POST['Time_Slot_No'];

$time=urldecode ($_GET['Time_Slot_No']);

// Insert data into mysql
$query = ("UPDATE $tbl_name SET Member_No = '$memberno1' WHERE Time_Slot_No = '".$_GET['Time_Slot_No']."' LIMIT 1");
$result=mysql_q uery($query) or die(mysql_error ());

// if successfully insert data into database, displays message "Successful ".
if($result){
echo $query;
}
else {
echo "Cannot Update";
}
// close connection
mysql_close();
?>[/PHP]

I had asked for a echo query and it shows : -
"UPDATE bcourt SET Member_No = '3' WHERE Time_Slot_No = '' LIMIT 1"

So I know it can't find the time slot, can anyone help me please.

Thank you in advanced forany help.
Mar 30 '08 #1
6 1963
ronverdonk
4,258 Recognized Expert Specialist
Your <form> is posted, [php]<td><form name="Update Network Gaming form" method="post" action="updateb court_ac.php">[/php]then why do you retrieve the passed value from the $_GET array?[php]$query = ("UPDATE $tbl_name SET Member_No = '$memberno1' WHERE Time_Slot_No = '".$_GET['Time_Slot_No']."' LIMIT 1");[/php]Ronald
Mar 30 '08 #2
flexsingh
17 New Member
Your <form> is posted, [php]<td><form name="Update Network Gaming form" method="post" action="updateb court_ac.php">[/php]then why do you retrieve the passed value from the $_GET array?[php]$query = ("UPDATE $tbl_name SET Member_No = '$memberno1' WHERE Time_Slot_No = '".$_GET['Time_Slot_No']."' LIMIT 1");[/php]Ronald

Id need to retrieve the past value so it knowns which time slot to update the member no for. That is why I'm getting the value (time_Slot_No".
Mar 30 '08 #3
ronverdonk
4,258 Recognized Expert Specialist
Guess you don''t know what I am talking about.
When you POST a value, you cannot retrieve it from the $_GET array, you must retrieve it from the $_POST array!

Ronald
Mar 30 '08 #4
flexsingh
17 New Member
Guess you don''t know what I am talking about.
When you POST a value, you cannot retrieve it from the $_GET array, you must retrieve it from the $_POST array!

Ronald
I understand now thank you, it works fine. Would you like me to post the working code up for any other users stuck to see?

Thank you very much for your help!
Mar 31 '08 #5
Markus
6,050 Recognized Expert Expert
I understand now thank you, it works fine. Would you like me to post the working code up for any other users stuck to see?

Thank you very much for your help!
I think Ron's last post sums it up.

Regards :)
Mar 31 '08 #6
ronverdonk
4,258 Recognized Expert Specialist
I understand now thank you, it works fine. Would you like me to post the working code up for any other users stuck to see?

Thank you very much for your help!
No, I think we get the idea. But I am glad you worked it out. See you around.

Ronald
Mar 31 '08 #7

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

Similar topics

6
7584
by: Fozya | last post by:
Hi, I have problems compiling some code that perfectly runs in VS.Net in the G++. Here is what I got: MyClass a; MyClass b; //assign values to a and b .......
0
1635
by: Tony Williams | last post by:
I have posted a number of posts in the Access newsgroups concerning my problem with DLookup. I have had a number of the experts with helpful suggestions but I still can't get it to work! This is what I am trying to do: I have a table called tblmaintabs which holds year to date data for a number of companies which they supply on a quarterly basis. The field txtDomfacsoleqtr is one of the fields that holds part of this data. The...
9
4352
by: Dan K. | last post by:
Hi Folks, Problem is, that on one of my controls the DEL key wont work in textboxes. i have different controls of this kind in my app and this is the only one the DEL Key wont do his job. BACKSPACE and rightclick menu delete works either. seems the DEL Key fires no event ... i insert following code in my project to check this. no mehthod call if DEL key hit ... any solution or idea for this problem ? cant say ... users on this...
7
1434
by: Mike Fellows | last post by:
Below is my code that is carried out on my dataset, datagrid etc... Im trying to get column0 "Date & Time" to show date and time, not just date ive read some stuff posted by Dmitriy Lapshin on this board that goes way over my ability (this is my first vb or vb.net project). from what I can tell i need a GridColumnStyles collection adding to my datagrid but each and everytime I try to do this my code crashes.
16
1777
by: Mike Fellows | last post by:
when i load my windows form i populate a combobox i use the code below Dim conn As New System.Data.SqlClient.SqlConnection(strConn) Dim sql As String = "AllLenders" Dim da As New System.Data.SqlClient.SqlDataAdapter(sql, conn) Dim ds As New DataSet() da.Fill(ds) ComboBox1.DataSource = ds.Tables(0) ComboBox1.DisplayMember = "Lender" da.Dispose()
0
954
by: riteshraha | last post by:
Hi everyone, I am a member of this forum. i have posted my problem repeatedly to this forum. but i cant get any reply from this forum. plz anyone make any reply of my problem. I cant retrieve selected item from checkboxlist in asp.net project. when i submit multiple item from checkboxlist it works fine. but when i am trying to edit this items then checkboxlist does not select the previous values that i have selected.It only selects one item....
19
2264
by: bb nicole | last post by:
Below is my search engine for job portal which jobseeker can find the job through quick search. But it cant work... Is it mysql query got problem?? Thanx.. Interface <html> <head> <title>UMS e-Job Portal</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body {
2
2678
by: moondaddy | last post by:
I had to repost this because I had to update and change my msdn alias. I will re-ask the question and clarify a few things that were not clear before. This code is all executed on my dev machine running winXP sp2 and VS2005. I'm using a c# 2.0 winforms app which talks to a c#2.0 asp.net app that also contains 1 web service. Note: the webpage and web service are located side by side in the same web app.
66
8198
by: happyse27 | last post by:
Hi All, my html code is sno 1) and perl code is sno 2). a) I tried to print $filename and it cant print out the value, only blank was displayed, and the file could not be uploaded. And it didnt display the html after the perl script executed. Using perl 5.1 and apache 2.2.9 version(apache installed and run without any errors and no warning, perl tested fine) b) Also, when i clicked the html code to submit the upload of the...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10002
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9869
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.