473,666 Members | 2,144 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to combine and pass data in one page?

I didn't know what to use as a title for this. Here is the scenario:

I have a op.reqedit.php page. This page a form where you input data.
In this page I have split a MySQL field. It is called
MachineTypeOfWo rk and is split into Replace, Adjusted, REbuild,
Inspected and Repair. These all become check boxes for the user. The
form submits to op.reqadd.php. In this page I first have a hidden box
where I combine all of the above into Type (this works fine, I have
unhidden the box to see it). Then I have

$MachineTypeofW ork = $_GET['Type'];
$sql_query = mysql_query("UP DATE results SET (a bunch of fields)
MachineTypeOfWo rk='$MachineTyp eofWork' WHERE WorkOrder = '$wo'") or die
(mysql_error()) ;

My problem is that it updates all of the fields it should except the
MachineTypeOfWo rk field in MySQL. It actually overwrites what is
already there with nothing.

What I do not know (I am new) is can I combine the field and pass it to
the database in the same page or do I need another page in the
background for this?

ANy help is appreciated.

Tina

Jul 21 '05 #1
2 1832


ti*********@gma il.com wrote (in part):
I didn't know what to use as a title for this. Here is the scenario:

$MachineTypeofW ork = $_GET['Type'];
What is the method that is used on your form? The above will be valid
if the method is "get", if it is "post" use $_POST['Type'] instead.
$sql_query = mysql_query("UP DATE results SET (a bunch of fields)
MachineTypeOfWo rk='$MachineTyp eofWork' WHERE WorkOrder = '$wo'") or die
(mysql_error()) ;


If you set a variable to the query string and then echo the string,
what is printed?

When your script start, dump the $_GET and $_POST superarrays and check
what your script is receiving.

<?
echo '<pre>';print_r ($_POST);echo '</pre>';
echo '<pre>';print_r ($_GET);echo '</pre>';
?>

Let us know the results.

Ken

Jul 21 '05 #2
I am using Get (and it works for all of the other fields. Here is what
I have in the beginning of my reqadd page to pull everything together.
It is unhidden now to make sure it works.

<?
$Replace = $_GET['Replace'];
$Adjusted = $_GET['Adjusted'];
$Rebuild = $_GET['Rebuild'];
$Inspected = $_GET['Inspected'];
$Repair = $_GET['Repair'];
?>
<html>
<INPUT NAME="Type" Value="<?if ($Replace !='Replace')pri nt "0";else
echo $Replace;?>.<?i f ($Adjusted != 'Adjusted')prin t "0";else echo
$Adjusted;?>.<? if ($Rebuild != 'Rebuild')print "0";else echo
$Rebuild;?>.<?i f ($Inspected != 'Inspected')pri nt "0";else echo
$Inspected;?>.< ?if ($Repair !='Repair')prin t "0";else echo
$Repair;?>"></html>

<?
$MachineTypeOfW ork = $_GET['Type'];

This prints out correctly, but now when I continue with anything. Even
Echo $MachineTypeOfW ork it prints out nothing. When I run the script
you gave me I get

[wo] => 2
[MachineAssigned To] => adfweg
[MachineDateAssi gned] => 07/20/05
[MachineDateDue] => werf
[MachineDateComp leted] => aewrv
[MachineFollowUp] =>
[Replace] => Replace
[Adjusted] => Adjusted
[Rebuild] => Rebuild
[Inspected] => Inspected
[Repair] => Repair
[MachineWorkDone] =>
[MachineMaterial sUsed] =>

This is correct, it's all coming across. With the code above it also
prints out correctly (Replace.Adjust ed.Rebuild.Insp ected.Repair), It's
just that from this point on I seem to not be able to convert it to the
MYSQL field that I need it to send to.

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
8150
by: trint | last post by:
add them into one PrintDocument: PrintDocument pd1 = new PrintDocument(); PrintDocument pd2 = new PrintDocument(); PrintDocument pdCombined = new PrintDocument(); pdCombined = pd1 + pd2; pdCombined.Print(); Thanks, Trint
3
1615
by: Chris | last post by:
I have a modal (yes it must be modal) web page. I do this by having an empty frame that points to my main page (so that I can repost without new popups) I have to pass data to the child page from the parent and the only way I can figure to do it by the url. Please correct me if I'm wrong on that. When the data get to my frame I then have to pass the data to my child form, again through the url (i think). The only way I found to do...
8
6574
by: darrel | last post by:
I'm still trying to fully understand how best to pass variables between pages/usercontrols/each other. On a current site I've done, I've had one userControl do the logic and set the variable, and then I had other usercontrols simply read this by traversing the class structure: siteClass.userControlClass.specficVariable. That worked fine. The new site I'm working on is a bit different, as I'm using multiple
8
4582
by: frekster | last post by:
Hi. I used to be able to do this easily in vb 6 via looping and preserving the source array data/size etc. How can I do this in vb.net? I've been trying for a while now and this should be an easy task but it just isn't clicking. For some reason, the preserve doesn't seem to be working.
17
7069
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the returned value is "" Anybody know how to set this value on 1st page properly, in order to let 2nd page catch it? I don't want to use querystring to pass this value!
1
2480
by: zwieback89 | last post by:
Hi, I am still not able to get this working in a simple page. Please help me. I am badly stuck.... I am trying to view the contents of the Beverage Category. I have built it like a hierarchy in the form of styled <UL> tags. Please assist me in combining the 2 pages into one page. I would extremely grateful. My code is:
5
12912
by: Rodjk #613 | last post by:
Hello, I am working with a database that is in use in several locations. The structure of the databases are identical, but the data is different. I am tasked with combining the data into one large database. (It is SQL 2000) I have .bak files for each location. Is there any way to restore a backup into a database, combining the data?
3
1651
beacon
by: beacon | last post by:
Hi everybody, I have a data access page and I would like to modify the navigation buttons, if possible. I want to combine the MSONavAddNew button with the MSONavSave button so that when the user selects save, it will automatically take them to a new record. I haven't been able to find any literature on how to do this so any help will be greatly appreciated. This is the only thing keeping me from deploying the page. Thanks...
9
2548
by: JRough | last post by:
I tried to pass the $result from a mysql_query in a url like this line Header("Location:clm_historyXL.php?_result=".$result); but on the redirect location clm_history.php page I get an error on this line: $result = $_POST; I need the $result on the clm_historyXL page to print a list to excel because of a header already being sent.
0
8444
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
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
8639
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
6198
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
4198
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
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1775
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.