Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Transfer Edited Records From One MySQL Table To Another


What I need is for a user to search a certain database table for a purchase order #. The results then need to be displayed in textboxes so they can be edited as needed.

Then the edited records need to be inserted into another table, and deleted from the former. I have the first two steps coded, but am having trouble figuring out how to do the third correctly. Here is my code:




View Complete Forum Thread with Replies

Related Forum Messages:
Transfer Unique Records
i have a table.in that there are nearly 12000 email ids.in that may be 1000 email ids duplicates(repeated twice).i want to transfer the unique email ids from old table to new table.i tried the code but it is transfering the all ids but not unique.how to solve this.any of your help will be appreciated.here is my code

<?php
$conn4=mysql_connect("localhost","","");
mysql_select_db("mrj",$conn4);
$sql="INSERT INTO cc (email) SELECT DISTINCT email FROM bb";
$result=mysql_query($sql,$conn4) or die(mysql_error());
if($result)
{
echo "transfered";
}
else
{
echo "not";
}...

View Replies !
Having Trouble Looping Through Records In A MySQL Table
I'm having some trouble looping through the records of a MySQL table using PEAR DB. Here is my code:

$navigationSql = "SELECT * FROM nav";
$navigation =& $db->query($navigationSql);
while ($navigation->fetchInto($nav)){
define("NAVIGATION", "<a href="$nav[2]" target="$nav[3]" title="$nav[1]">$nav[1]</a><br />"); }

The when I enter:
print NAVIGATION;

into any of my PHP scripts it should loop through the stuff in table named nav, but it is only displaying the first record and so far everything I've tried does not seem to make it loop through all of the records in the table and I can't figure out why not.

View Replies !
How To Access And Modify And Add Records In MySQL Table From A Windows Client?
The MySQL table is located in a Linux Server OS, so I need the
information from that table for updating Paradox tables in Windows OS.
If a PHP program in the Linux Server can save a file with the
information I need, can I make a PHP program in Windows OS to get the
saved file or even better, to access the table in the Linus Server OS?...

View Replies !
Count,sort,diplay Number Of Records In MySQL Table
I am designing a search engine using PHP/MySQL and I am logging all search terms into a MySQL table. I was wondering how I count the number of occurences of a term in the table, and then sort and display the terms in descending order. For example, if the column in my table with search terms looked something like this:

clothes
casinos
clothes
homes
homes
clothes

How can I count and order the records so that I can display according to how many times they appear, like so:

1. clothes(3 entries)
2. home(2 entries)
3. casinos (1 entry)

View Replies !
Automatic Delete From MySQL Database Table Expired Records?
I have a question . . .

how can i delete from MySQL database table automatic expired records ?
?

One think is to make a service that deleting the expired records . . .

Any other method ?



View Replies !
How To Transfer A Data With An Id To Another Table From A Table?
how am i going to transfer let say a name identified using the suer id and copy the name to the other table having the same user id>?

View Replies !
Transfer Data From An Xls Spreadsheet Into A Table
Is there any way I can transfer data from an excel spreadsheet to my table?? Example:
I have an .xls spreadsheet called hello.xls and it has 5 columns with hundreds of rows of data in it. I want to copy all this data to my table instead of copying line by line which will take me eternity. I have a table called hello which has the same 5 columns.

View Replies !
Session - Sort ALL The Columns Then Transfer That Sorted Table To A New Page For Printing.
I'm not fully conversent with sessions and I suspect they are the answer to this problem but I cannot figure this one out yet.

I have a table with data drawn from a database and some calculated on the page.
e.g.

 1 Name | Score 1 |Score 2 | Average Score  where average score is calculated on the page.
 2 Name | Score 1 |Score 2 | Average Score
 3 Name | Score 1 |Score 2 | Average Score
 4 Name | Score 1 |Score 2 | Average Score
etc.

Can I carry this data to a new page without having to call from the database again.
The reason is that I want to sort ALL the columns (which I can do already) but then transfer that sorted table to a new page for printing.

View Replies !
MySQL Transfer
I am transfering a database from one host to another and I am having problems figuring out how to export it.

View Replies !
Transfer Between 2 Mysql Databases
I wanted to know how one can transfer between two my sql databases on the same machine using PHP . The updated table in one of the database is to be transferred to an identical table in the other database.

View Replies !
Transfer My MS Access DB To MySQL?
How do I transfer my MS Access DB to MySQL? One issue though, in Access I have some special character such fraction, backquote, etc. how do I replace those characters to ASCI equivalent when transfering to MySQL, or do I have to do it outside MySQL?

View Replies !
Transfer Mysql From Different Server
I want to copy database from this server to another. Is there mysql query can do this secssion.

View Replies !
Data Transfer From MySQL To DB2
I want to transfer from mySQL to DB2. I have already created the tables and indexes. I need to transfer the data from mySQL database to the new DB2 database with same table structure.

View Replies !
Transfer Data From Access To MySQL
How easy is it to transfer datafrom a MS Access database to a MySQL one? How can this be done?

View Replies !
Transfer Excel Sheet To Mysql
Is it possible to transfer a list that I have stored on my computer in microsoft excel to a table in mysql database?

View Replies !
Transfer Image From Mysql To Oracle
This is part of my code When I run my whole program I get this warning
OCI-Lob::save()[function.save]:ORA-22990: LOB locators cannot span transactions

the value of row[1] is coming from mysql. Code:

View Replies !
Can Cookies Be Edited By User?
Can cookies I store on a person's computer be edited by that person?

View Replies !
Recognize Edited Php.ini After Re-starting Apache?
I changed the php.ini file. I am under the impression that I need to re-start apache. I've tried stopping then starting apache. I've also tried just restarting it. These commands seem to be working, but the changes I make to the php.ini file are not put into effect and do not show up when I call phpinfo(). Anyone have any ideas how I can get my new php.ini recognized?

View Replies !
Keep This Text Area From Being Edited In This Form
I need the textarea so it can not be edited by the user..... how can I hide it and keep it so it can not be changed

<textarea name="body" id="body" cols="50" rows="15">'.$_CONFIG['MAIL_BODY'].'</textarea>

this text area has an email message for my inviter script but I dont want the user to be able to alter the body...

how can this be achieved? I manages to hide the subject by ussing type hidden

but I dont know how to do it with this text area.

View Replies !
Displaying # Of Records In A Table
Can anyone throw me a link to some prefab code, or a tutorial on how I can get a page to display the number of records that meet a certain criteria.

example:
I have a page that stores information on audio FX. I'd like to include a feature that would let the users know how many items are in a particular section.

Player (10)
Items (5)
Weapons (0)
etc.

All help appreciated,

View Replies !
Counting Records In A Table
Ok, I am trying to count the number of records in one of my tables. Seems simple. BUT! its not working. It returns a 2 no matter how many records are in there.

Heres the code.

<?php
$sql = "SELECT count(*) from cam";
$result = mysql_query($sql);
?>

I would think this would work.
I have also tried mysql_num_rows, and max(), and sum()...
a little help would be appreciated, and why is it returning a 2?

View Replies !
Delete Records From A Table
I have a table its called queue. It has a field called id. I want to delete all records in the table apart from the ones with id equals to 74 or 75 or 87. How do i do that?

View Replies !
Displaying Records In Table
I have a table that I want to display some records from my database. I have a specific spec I'd like the table to conform to, 3 cells wide.

I can get the data into a cell. But my problem is, I'd like the table to have the 3 cells fill and then have the additional data create a new rows and continue on infinately.

View Replies !
How Do I Get The Total Records From A Table?
It also shows the total submissions. Right now, when you choose to view by a particular topic (for example, select a region - California) the total submissions only shows for those results (which right now is 1). I'd like to show the total results not just for California (which right now is 4). Code:

View Replies !
Retrieve The Last 10 Records In Table
well this is my 1st post & im wondering if someone can give me the syntax to display the last 10 entries in a table for example if there are 100 records 1 to 100 i want to select 90 - 100.

View Replies !
Delete Records From Table 1
I have a script that doesn't delete records from one database when it should, and now I have to do this myself because database is big and causes problems on the server. What I have is:

TABLE 1, field auction
TABLE 2, field id

so I would like to delete all records from TABLE 1 where the value of the field auction doesn't match the value of the field id in TABLE 2. Can someone help me on this, please? I need to get this database cleaned.

View Replies !
Table Row Records For Editing
I have a repeat region of a table called userid. What i¹m trying to accomplish is being able to edit the record and then update it by clicking a submit button on the same line. I¹m doing it this way so the user can quickly update a number of records one at a time. I know I could do this by passing the userid info to a detail page but really want
to do it the way described.

View Replies !
Showing Records In A Table
I am busy with the site of the company I work for. We have a section where al our partners are mentioned. At this moment this is a static part of the website that I want to make dynamically. This is the url of the static page and how it should look like: This is the url of the dynamic page I created but it doesn't work the way that I want: This is the php code I used: Code:

<?php

$i=0;
echo "<tr>";
while (list($id, $vlag, $land, $bedrijf, $website, $email) = mysql_fetch_row($result)){

echo "<td><table>-Content with the data of the records-</table></td>";

if($i % 2 == 0) {
echo "</tr><tr>";.

View Replies !
Can't Insert Spreadsheet Edited In Linux With PHP Script
I have no idea if this is a Linux issue or PHP. Looking for clues here.

I have a PHP script which I use to upload a CSV spreadsheet into a
mySQL database. (The script follows here in a sec.)
I was using WindowsXP and MS Excel to take these sheets, edit it if
needed, and save it in text based CSV. Then use the PHP script to
upload it and insert into the DB.

Now I've eschewed Windows and am using Fedora Core 3. I've tried doing
the same thing I always do, but with Open Office, and I've tried with
Gnumeric and KSpread, and I save it as CSV, but for some reason the PHP
script no longer properly uploads. It acts as if it's an empty file.

I don't think it's file folder or structure issue, because I'll edit it
in one of the three programs and then copy it to a WindowsXP machine
and upload it with the script and I get the same problem.

If I edit it and save it in CSV in MS Excel and then open it in
Notepad, I get proper lines with proper carriage returns in the right
places. If I edit it in a Linux program and then open it in an ASCII
editor it also looks just fine, but if I open it in Windows Notepad,
there carriage returns are in odd places and there's little squares
indicating a hidden or binary character here and there. Weird!

a) Is there anything I can do in one of the Linux programs (preferably
Open Office Calc) to save it properly in ASCII only CSV with proper

carriage returns? or
b) Anything I can do in the PHP to compensate for whatever the Linux
programs are doing to the CSV?

Thanks for any help!!
Here's the PHP:

$uploaddir = '/var/www/html/home/accounts/trackfiles/'
$upfilename = $_FILES['csvfile']['name'];
$uploadfile = $uploaddir . $upfilename;
move_uploaded_file($_FILES['csvfile']['tmp_name'], $uploadfile);
$change_perm = escapeshellcmd("/bin/chmod a+rw -R
/var/www/html/home/accounts/trackfiles");
exec("$change_perm 2>&1", $output);

// INSERT SPREADSHEET DATA INTO DATABASE
$sql = "LOAD DATA INFILE '".$uploadfile."' INTO TABLE `".$tbl."` FIELDS
TERMINATED BY ','".
"OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '
'".
"(".$fields.")";
$result = @mysql_query($sql, $dbconn) or die("Couldn't query DB: " .
mysql_error());

View Replies !
AJAX To Display New Records In A Table
Instead of refreshing the entire page to show the new fields in a
table, I was wondering if it would be possible to use AJAX to display
the new records in a table.

For example:

Messages are entered into the DB. I use PHP to create a table that
displays the messages.

Instead of refreshing the entire page to show the table with new
messages, how can I use AJAX to show the new messages in the table
without refreshing the entire page?

View Replies !
Counting The Number Of Records In Table
I want to count the number of records which apply to a repeating id field. (the user id remains the same, but their are several records which relate to the user. I want to know how many records in the table exist for a specified user id) Does anyone know a function for doing this?

View Replies !
Linking Multiple Records From Another Table
I'm not sure I'm even thinking about this the right way, but here goes:

I have a table of users. Each one of these users may be associated
with none, one, or many records in another table I call a todo table.
table user = 'id', 'name', 'bla bla bla','todo_list'
table todo = 'id','title','other info'

Suppose user 'id=1253' has on his todo list items 756,241, and 672. I
create a string 756,241,672 and store that string in the user's
todo_list field. Then when I want to display the todo items I get the
string with a query, bust it up into an array, iterate the array and
query the todo table.

I have a gut feeling I'm making it way more complicated than need be.
But I can't think of any other way to do it

View Replies !
Table Join Count Records.
got my counting records script just the way I want it, now I've read all the posts on Joins, and read the manual and mysql.com.... but can't seem to get the right number to come out.

I have two tables: table1 & table 2

table one has a field called ID and field two has a field called relID (this is the link between them) I want to count all of the records in table two where the relID is equal to the table 1 ID field. I thought this would do it, but the number it returns is wrong:
PHP Code:

View Replies !
Copy Select Records To New Table
In the table Step I have multiple records for each given id. I want to save the current list of records for an id to a new Step_Old table so I can look back at what I had at a given point in time, since the records for an id in the Step table will change over time.

Now the question... does anyone have a slick way to do this, or do I need to Select all the records I want to save and then save them one by one with a while loop into the Step_Old table?

View Replies !
Displaying Records In A Split Table?
trying to split up results of a query into a split table. example: PHP Code:

View Replies !
Count The Number Of Records In A Table
I just want to count the number of records in a table that meet a certain set of conditions: Getting an error: Warning: mysql_result(): supplied argument is not a valid MySQL result resource code:

View Replies !
Checking $_POST Against Records In Table
I have a table containg name, description, url which contains many records When I submit a new form, I want it to check the url fields in the table and check it against what I have posted. Therefore something like

$check_table = function here to get all urls

if($_POST['url'] == $check_table) {
return false;
} else {
return true}

However, how do I get all the urls and get it to check each one?

View Replies !
Insert Multiple Records In Table
I want to use a form to insert multiple records into a table. I have an book club where a person would rank a book (3 to 1) next to a particular book read for a particular month. 3 being the most favorite book read that month and 1 being least favorite. Below is the table the records would be inserted into.

Key----Month--------Reader---------Rank-------Book
1-------January-------Jim--------------3----------Bible
2-------January---------Jim-------------2----------Koran
3-------January---------Jim-------------1-----------Torah

How can I have a form where the reader sees only (and fills in) the rank and book text fields, and the Key, Month, and Reader fields are filled in behind the scenes with the default info when the form is submitted .

View Replies !
Updating Multiple Records Of A Table
I would like to update multiple records of a table in the database. Code:

View Replies !
Delete Selected Records From Table.
Can anyone see why this connection doesn't work? It's suppose to delete selected records from my table.

<?php

if (isset($_POST['delete'])) // && isset($_POST['delcus']))
{

foreach ($_POST['delcus'] as $val)
{
echo "$val";
$conn= mysql_connect( "localhost", "user", "password" );
$sql = mysql_select_db( "snow" );
$del = mysql_query("DELETE * FROM request WHERE qid =" .$val);
//$rows = mysql_num_rows($del);
$rs = mysql_query($conn, $sql, $del);
if($rs)
.........................

View Replies !
Having Trouble Inserting Records To A Table.
currently i am using the code:

$query ="INSERT INTO table_name (Field_name) VALUES ($name)";
$result = mysql_query($query);

and it doesnt seem to be inserting.

am i doing it wrong?

View Replies !
Checking If Any Records Exist In A Table
I've had a few problems with the mysql_fetch_array() string, and have worked out that it's because there are no records in the table.

Does anyone know of a way of checking if there are any records, so that I can create an if statement?

View Replies !
How To Paginate Table To 1/2 Records Per Column
I am setting up a scrapbook page and we will be adding images all the time. I have a dynamic table to show the image, link and description but I want to break the columns to automatically show 1/2 the images in the first column, and the other 1/2 (or less if its an odd number of images) in the right column. Code:

View Replies !
Browser Problems: Printing Edited Images That Used Variables
Ok, I've developed a website that somebody asked me to make, more as a joke than anything else. I've only gotten the PHP script working - haven't started on the site design yet.

Open up IE 7 (maybe 6 and before do this to; I'm not sure. I only KNOW that firefox WORKS, and IE 7 does NOT work). Code:

View Replies !
Adding Multiple Records To A Table In One Form.
I have one form in a php page. In that form there are several rows, each with several input boxes. These rows represent individual products and their price.

You may add as many products as you want by clicking a add product button and it will add another row using javascript.

When you are finished adding your products you then click submit. For each product I would like it to insert an individual record in the products table.

For example if you add 10 products, when you click submit it will add 10 records in the product table.

View Replies !
Select All The Records In A Table That Were Input Last Month
I am trying to select all the records in a table that were input last month, example:if month today is October select all record with month of September The query I am using is
PHP Code:

SELECT payments.*, members.*
FROM payments, members
WHERE payments.coupon_id  = &#39198;C554360'
AND payments.member_id = members.member_id
AND payments.begin_date < NOW() - INTERVAL(1 MONTH)

This display an error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'MONTH)' at line 1 I am not sure if my query is written correctly.

View Replies !
SQL Question (selecting Records From A Table With A Codthat Do Not Appear On Another)
I need to select the records from a table that DO NOT have a record in another table. For Example:

Table1
Code | Name
0 | AA
1 | A0
2 | A00

Table2
Code1 | Code2
1 | 100
2 | 200

So the SQL would return only the record "0 | AA" from the table "Table1". Any ideas?

View Replies !
Query Problem: Counting Records From Another Table Without Using A Subquery
I'm working on a rather complex SQL query, which retrieves a list of clients that match certain criteria. One of the criteria I need to test is the number of business days that have elapsed since the client's enrollment.

To facilitate this, I've created and populated a table called business_days - containing one record for every business day (non-weekends and non-holidays) for the next ten years. Using this, I can just count the number of business_days between two dates, like this: Code:

View Replies !
Moving Through Records In Table In A Single Record Page
I'm trying to create a updates pages that I can move either to the previous
record or the next record within a recordset without having to return to the
repeating list of records after each up date.

Assuming I have done the recordset correctly, which I have and the update
records command as well here is the code I'm trying to use: Code:

View Replies !
Create Dynamic Table With 3 Columns And Unknown Number Of Records?
I'm trying to create a table with only 3 columns, but the problem is I don't know how many records will populate the table so need it to automatically create <tr> and </tr> tags every 3 records. How best can I do this?

At present the code below just lists every single record in one continuous row - but as I said, I want to only display 3 records per row. Code:

View Replies !
MYSQL To MYSQL Transfer
I've got a MYSQL Database, essentially I plan on having a script execute on a local timer that will check the database if there are any entries, if so it will grab all of them and insert them into a local mySQL database that is on that computer. Now, I believe I can do this using SOAP to call a php function off the web server. Does anyone know coding to Grab all entries in a MYSQL Database table, and essentially insert them into another MYSQL (Which would be local on the computer executing the script). I also plan on actually deleting any entries that have been grabbed and put on this local database.

Summary:
Basically, I'm constantly backing up a MYSQL Database, but not exactly. I'm adding whatever new stuff comes to a complete local MYSQL Database.

View Replies !
Create A Mysql Query That Will Look In A Table And Come Back With The Most Used Phrase In A Certain Cell In The Table?
How can I create a mysql query that will look in a table and come back with the most used phrase in a certain cell in the table?

4|Truck|Chevy
5|Car|Honda
6|Car|Toyota
7|Van|Chevy
8|Car|Mitsubishi
9|Truck|Toyota

I want a print out from mysql to be like this:

Car 3
Truck 2
Van 1

Is there any way to have it count up how many of each unique things there are in a cell in a table, and have it decending from the first one being the highest number?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved