One more question.
How can I get query values assign them to a variable, but not show them?
for example size, $f4 in the following: How can I pass that value $f4 to the form handle page to submit to the database. I can clearly see how to pass $f2 with quantity stuck on the end.
Basically, I need to pass 3 things: 1) item#, 2) item#quantity and 3) size to a new database. - mysql_select_db("inventory");
-
$query="SELECT * FROM pecialtymaster where Dental='Y'";
-
$result=mysql_query($query);
-
$num=mysql_numrows($result);
-
mysql_close();
-
?>
-
-
<form action="inventorymaster_form.php" method="post"
-
name="inventorymaster_form" align="left" class="style3" bgcolor="#ffffff"
-
onSubmit="return verifyForm(this);">
-
-
<table border="1" class="mainmenu" border="0" cellpadding="0"
-
cellspacing="0">
-
<?php
-
echo "<table border='1'>
-
<tr>
-
<th>Item #</th>
-
<th>Item Description</th>
-
<th>Size</th>
-
<th>Distribution Quantity</th>
-
<th>Current Quantity</th>
-
</tr>";
-
?>
-
<?php
-
$i=0;
-
while ($i<$num) {
-
$f2=mysql_result($result,$i,"item_number");
-
$f3=mysql_result($result,$i,"item");
-
$f4=mysql_result($result,$i,"size");
-
$f5=mysql_result($result,$i,"distquantity");
-
?>
-
-
<tr>
-
<td>     <?php echo $f2;?>    </td>
-
<td>     <?php echo $f3;?>    </td>
-
-
-
<td>     <?php echo $f5;?>    </td>
-
<td align="center"> <input type='text' name="<?php echo $f2?>quantity"
-
value="" onkeypress="return noenter()">
-
-
</tr>
-
<?php
-
$i++;
-
}
-
?>
-
</table>
3 2864 dlite922 1,584
Recognized Expert Top Contributor
Don't show them? so don't echo them.
If the other database is on the same host, you can even move the values via SQL. Else just while loop them like you have for the display but do an insert.
Dan
Maybe I'm missing something. The preceding is part of a form. I want to import some values from 1 database table and pass them to a seperate one. The only way I know is to perform an <input...name=. ..> How can I also assign a name to a $variable? I'm new with PHP and mysql so please be patient.
Thanks,
MO
Dormilich 8,658
Recognized Expert Moderator Expert
you don't need a form for that. the job can be done on the server. basicly you do - // not real code
-
R1 = connect MySQL-1
-
R2 = connect MySQL-2
-
R1 : SELECT ... FROM ...
-
R2 : INSERT INTO ... VALUES R1
case 1: both database tables are on the same host, this can be done using a single SQL querz (as dlite mentioned)
case 2: there is a lot of code out there that can make this very easy to code. but this code is not as easy to understand as the standard PHP MySQL-functions.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Orion |
last post by:
Hi, This is kind of last minute, I have a day and a half left to figure
this out. I'm working on a project using ms-sqlserver. We are
creating a ticket sales system, as part of the system, I need to be
able to do a search for specific tickets withing price ranges,
different locations within the theaters, etc. etc.
My problem is in the search one of the criteria is to search for a
group of seats together. For example let's say...
|
by: Pete |
last post by:
Before I get started with the question, does anyone have a (single)
good book recommendation for database design? Not an Access-specific
book, but something geared toward helping me figure out *what the user
wants*. I've had brief formal education about data flow diagramming,
but I'm looking for ... more, now that I'm actually running into
problems I think stem from the fact that my users can't explain what
they need done, compounded by...
|
by: bdt513 |
last post by:
I am trying to extract the values from a query using VBA.
Specifically, I want to concatenate all the values of the "rosEmail"
field from query "qselRosterEmailList" into one string (strEmails). I
can get one record's result by using the DLookup fuction, of course,
but I want to get every record's value. To do this, I believe I need
to build a recordset, but I do not know how.
I've read about doing it using DAO in Access 97, but I am...
|
by: a_munch |
last post by:
Hello, I was wondering if there's any way to create a report that will
show only rows from a query that meet certain criteria? I can't create
a second query that will pull only the records I need for this reason
-- I have a crosstab query that shows data by month, and in order to
show the full 12 months for the year, I have created some dummy data
that has 0 for January through December. I need to have all 12 months
as column headings so...
|
by: Mark |
last post by:
I've run a few simple tests looking at how query string encoding/decoding gets handled in asp.net, and it seems like the situation is even messier than it was in asp... Can't say I think much of the "improvements", but maybe someone here can point me in the right direction...
First, it looks like asp.net will automatically read and recognize query strings encoded in utf8 and 16-bit unicode, only the latter is some mutant, non-standard...
| |
by: Joe-Paul |
last post by:
Hi:
I'm running a simple query on an Access Table from VB6.0. The operator can
make several different selections. Based on their selection, a different,
specific SQL needs to be run. So, when the operator says... "Do it"...the
click procedure goes to a Function (based on their selection)...the specific
function builds the correct SQL and returns it...then it sends that query to
the final procedure to run the sql, retrieve the data and...
|
by: Tom |
last post by:
Hello,
I have a database of employee data in access and I am trying to create
a form with combo boxes for criteria (ex. gender, office, position,
etc.) that let the user select criteria from drop down menus (ex. they
may select Male, New York, Manager) and those criteria will be used to
run a query (ie Query by Form). I can do this with text boxes but when
I tried to use combo boxes no records were returned in the query. Any
idea what...
|
by: John |
last post by:
I run a query in VB that calculates an average and a count. Again in code I
want to grab those 2 values from that query without having to write them
first to a table and read the values from that table. How do I go about
this?
Thanks,
john
|
by: markcarroll |
last post by:
I have a rather complicating query (the SQL is about a page long) so I hope I can solve this without needing to get into specifics.
Basically, the database I am working on has information about investment firms, and what companies they hold shares of. I set up the query to find all the stocks that a specified company held for the most recent date. But we need to display data for the past dates as well.
The way I got the most recent date...
|
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,...
|
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,...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |