|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||||
|
|||||
|
Copying records between MySQL tables
PHP 4.3.1.1
MySQL 2.5.2 Windows XP Main problem: I have a list of suggested links and plan to access the page that holds them to check if they should be included or not. I have a button next to each link (eventually) allowing me to either "ADD" them or "DELETE" them to the main links table from the temporary links table. When clicking add, I want to select that specific link and save the entire record into the main links table; likewise for the delete button. The code I have so far is: php Code:
Any ideas? |
|
#2
|
||||
|
||||
|
RE: Copying records between MySQL tables
For starters, your insert statement isn't quite right. It should be more like:
Code:
INSERT INTO urls (name, url, id, description, email) SELECT name, url, id, description, email FROM temp_link WHERE unique='$unique' |
|
#3
|
|||
|
|||
|
RE: Copying records between MySQL tables
Hi honcho,
Thanks for the feedback. Changed the sql to what you suggested but it still isn't writing the new record. I'm having a similar type of problem with another page where I am trying to update the contents of a table: the contents are displayed in form fields and the administrator should be able to alter the data and click update, but it doesn't write the new data to the table. Does this overwriting problem sound like a similar one to the LINKS problem? I have a funny feeling the MySQL server isn't quite set up correctly; does this sound likely? I've spoken to the support guys for the server and he is looking into it. Any feedback much appreciated. |
|
#4
|
||||
|
||||
|
RE: Copying records between MySQL tables
Change the line with "echo('error adding suggested link');" to be:
That will show you the actual error mySQL is having. |
|
#5
|
|||
|
|||
|
RE: Copying records between MySQL tables
Hi honcho,
This extra information might be useful if the script was actually getting as far as that line! What I'm getting when I click "ADD" is simply nothing; no action! |
|
#6
|
|||
|
|||
|
RE: Copying records between MySQL tables
So, when you click the add button it doesn't even submit the page? It doesn't do anything? Can you sit there and click the add button multiple times and it never go away?
Can you show us the code for the add button and the form that goes with it? |
|
#7
|
|||||
|
|||||
|
RE: Copying records between MySQL tables
Entire php code:
php Code:
|
|
#8
|
|||||
|
|||||
|
RE: Copying records between MySQL tables
php Code:
You aren't telling it where to go or how to do it...A form tag should look like so: <form action="myscript.php" method="POST"> |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Copying records between MySQL tables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|