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.





Refeshing Page Duplicate Insert


I am creating a registration script for my site and it is posted to itself. The problem is that when all the information is inserted into the database and i display what you have inserted, like username and email etc.

If i refresh the page then it tries to insert it all again flashing up a dublicate entry message. How can i get around this? I thought of a redirect but would prefere not to.




View Complete Forum Thread with Replies

Related Forum Messages:
Insert On Duplicate Key Update
I have the following code: PHP Code:

View Replies !
Duplicate Records On Insert
How can I insert items into a database and when there is a duplicate phonenumber field update the record and continue.

View Replies !
Duplicate Entry - Insert A Record To My Database
When I am trying to insert a record to my database I get this error: Duplicate entry ?' for key 1

but when I check my database from phpMyAdmin I dont have any record with this ID. show me 17866 for Next Autoindex in Row Statistics section too. What's the problem?

View Replies !
Stop Mysql Insert Duplicate Entry
to keep track of who has dfownloaded files on my site i have a table downloads within this table is 3 rows

id  :  file_id  :  downloaders_id

all are (int) my question is if the same user downloads the file again another entry is made for them (the auto increment id is different) but i didn't want the same user to have more than 1 file_id and downloaders_id the same. i know i can query mysql to see if the details are the same but if i find the entry has already been added wheat's the best way to stop that entry going in.

View Replies !
Duplicate Page On Server
I have a main page and wish to have a user click on a button with the intent to create a subpage of the main Lets say I have my main page on my server in a directory called main, once the user clicks on a button, the contente of the directory called main is copied and pasted into a new directory which would be named by the user.

View Replies !
Insert A Page Break For Printing Purposes After X Records On Page.
I need to insert a page break for printing purposes after X records on page. I'm querying five diffrent records with 5 different results and displaying them like:

$record1
$record2
$record3 and so on

So I want to get total number of records which is pretty easy I just add all the totals let's call it $subtotal. Then I want a page break after every 20 records of the $subtotal. Is this possible?

View Replies !
Insert Page Into Template
I have a script that uses a template for my site. I am trying to add a page(s) to it and have the pages use the template. The template has an area where I want the contents of my other page to appear. The other parts of the script use this PHP Code:

View Replies !
Insert A Page Break
I have a for statement that looks something like this: PHP Code:

for ($i = 1; $i <= 100; $i++) {
        
        echo '<a href="someurl.php?p=$i">Link</a>&nbsp;|&nbsp;'

}

I'd like to put in a <BR> tag after every multiple of 10. I've tried to use a nested for statement, but I just get errors. I don't think I'm doing it right.

View Replies !
How To Insert Tab In An Html Page???
i am making one appllication inwhich the user enters text in textarea field. i am saving this value in database and when user accesses value from database, i want to display text in a format entered by user.

i.e. if the user has entered some text in 2nd line then it should be displayed on second line and not after the end of first line in continuation. if user has entered tab in some location, the tab will be displayed while viewing data from database.

View Replies !
Insert/select From Same Page
I was wondering (and I suspect I already know the answer) if it's possible to insert data into a mysql table and select that same data from within the same php page.

View Replies !
OOP Page: Where To Put Update, Insert, Delete
I have a page that shows info from MySQL. It is for an online education
site. It uses different classes arranged in a hierarchy. Each lesson is
roughly laid out like this:

Lesson
|-Intro
|
|-Section
| |-Procedure
| |-text, video, images
|
|-Section
| |-Procedure
| |-text, video, images
|
|-Summary

I have all the classes working properly for displaying info from the
database. Now I am building the admin site.

Where should I put the update/insert/delete code? Would those go inside the
classes? Should I use the lesson object when doing the maintenance? Or,
should I just have a separate page that handles the database stuff and only
use the objects to display the data from the database?

View Replies !
INSERT Data On Page Load?
I have an avatar system where certain avatars are locked until the user unlocks them by going to certain pages of the site.

So far ( being the newb I am ) I only know how to INSERT data from a form. Is there a way to do it on page load or similar?

I also need it to first check if the data already exists and if not it inserts the data and then displays a message to the user that they have unlocked the avatar. Code:

View Replies !
Traverse And Insert Page Breaks?
My website is going to host various and future pieces of my writing. Some of the pieces are going to be very long, so I need to split them up over multiple pages. I have an input form through which I can type or paste a piece of writing and have it inserted into MySQL. What I need now is to have PHP automatically insert page breaks before the piece is inserted.

I was told I could use regular expressions, or I could use PHP to traverse the string and insert a page break, say, after 1400 characters so long as it ends on a period.

I know of str_replace, but how do I set it go a certain amount of characters? This whole pagination thing has me completely stumped. I'm not looking to paginate display results. I'm displaying one result split up in pages.

View Replies !
Insert To Database On Page Load
I have the code for inserting data to a database form a form (Code below) but I want the data to be entered upon a page loading, how would I do this? Code:

View Replies !
How To Simply Display On My Page Another Insert From A Different Table.
$judet = $_GET["judet"];

$result = mysql_query ("SELECT oras, id_oras FROM orase WHERE id_oras = '{$judet}' ORDER BY oras");

This is a piece of my code. The variable $judet is working perfect but i have a problem with another variable in the same table with judet witch i can't call.Everything from table orase works i just don't know how to simply display on my page another insert from a different table.

View Replies !
Howto Insert Picture Stored In Directory With Url In Db Onto Web Page?
If I read one tutorial more on how to store a image inside a mysql database I will blow my mind.

I read everywhere on the forums to store the image on the harddrive and use the url in the database and then pull the image out of the directory and onto a web page.

I am new to PHP and mysql but have looked now for two weeks on how to code a page to do this. It really has to be simple, so simple no one has taken the time to write a tutorial on it. There are lots, many, plenty, please no more tutorials on using BLOB to store an image inside a database.

What is the code to pull a image from a dir. using a url in the db and put it on a web page, I have been trying my own ideas and not working....NO I don't want to use BLOB.

darn thing with php, you can't see the code that does the trick...all I can see is the std <img scr="blab,blab,blab">

View Replies !
Stopping Another Data Insert When User Reloads Page
My PHP script inserts data into a mysql table that has been passed into it.

My question is, what is the general method by which to ensure that if a user reloads the screen, the same set of data doesn't get duplicated into the database?

For instance, I am inserting ticket data (its an ecommerce event system) into a mysql and really dont want duplicated entries if the user happens to press reload or back or whatever

Any ideas?

View Replies !
Multi Page Form Question Concerning $id = Mysql Insert Id();
I am creating a multi page form. The code below is what I am using. However, I am having a difficult time having it post to MySQL under "pg2" where it posts to MySQL I have the function $id = mysql_insert_id(); to post the id from "pg1" post to the database. However it only post 0 which I think is due to it being in an array. Code:

View Replies !
Use The Php Include Command In Source Code To Insert External Page
Hello, i am trying to use the php include command in source code to insert external page when a main page loads, but get the following errors.. can you help?

View Replies !
Header Problem - Insert The Info Below And Then Jump Back To A Page.
i want to insert the info below and then jump back to a page. Here is insert and the header statement: PHP Code:

View Replies !
Automatically Open Default Mail Program And Insert The Current Page Of Browser As The Body Of The Message.
On my website I would like the facility to click on an image or text that will automatically open up their default mail program and insert the current page on their browser as the body of the message.

I realise that most browsers will have this facility already but I would like to add my own method. Problem is, I have no idea on how to achieve this. I'm sure it can't be that difficult though. It maybe can be done just using HTML, I don't know.

View Replies !
Insert Values - Table Has Four Columns To Insert Into
I have a bunch of information that I want to insert into a table

insert into TABLE values ('hello','I','am','lost');

pretend that the words that are being inserted are coming from a form for another page. In he case I above I have declared that the table has four columns to insert into. What if I do not know how many columns there are?

View Replies !
Insert Into Table - $query = "INSERT INTO Tbl
I have a small problem which I've been working on for a while. PHP Code:

$query = "INSERT INTO tbl(username,ip,link) VALUES("Brin' . $result['id'] . '","$REMOTE_ADDR","http://www.domain.com/sub/start.php?username=Brin"' . $result['id'] . ' )";
mysql_query($query);

Any ideas?

View Replies !
Insert Statement Doesn't Insert Anything
I have an int field in a database and for teh purposes of this case the insert statement doesn't insert anything into the field using the ' ' syntax however in the mysql database this appears as 0. I was wondering can I still use the empty syntax as follows or will it not work as it is 0 does is this not classed as empty?

  if (empty($row['intTest'])){
 
 $sns= "empty";
 }

View Replies !
ON DUPLICATE KEY
I have a query where I'm trying to insert data using the ON DUPLICATE KEY syntax.

When I run the script, I receive the following message:
FS30YF100FS30YF100Unknown column 'a' in 'field list'. PHP Code:

View Replies !
Duplicate A DB
I am writing a script to duplicate dynamic sites that all run from the same server. I have all assets of the management done except for one final thing. I need to make a form that will duplicate a mysql database to a new database with the name coming from a form variable. I have scoured the web for the answer and as you can imagine a Google search like duplicate mysql database results in nothing relevant to the task at hand.

One avenue i thought to try was mysqldump -quick to dump the database to a text file and then open that dump to create a new one. This seams to be a convoluted theory though. Does anyone have any scripts that will do what I am attempting? Or even better, a link to some logic?

View Replies !
Duplicate Key
i've created a table"user" that has :

uid|username

and set the uid as primary key and the username as unique so if u entered a name that has already entered it will return mysql warning "Duplicate entry 'yaddayaddayadda' for key 2". how do i change the warning so that it open a page saying "u have entered a duplicate value "?

View Replies !
Prevent Duplicate
I have this code that inserts the email address into a database but I want to check the database to see if that email address already exists and if so tell the user. I've looked all over to find out how to do this. PHP Code:

View Replies !
Duplicate SQL Entries
I have a buddy system on my site and I have found that duplicate buddies can be added into the database. Here how I have this set up:

user 1 want to add user 2 as a buddy.
user 1 goes to user 2's page and clicks "add as buddy"
A PM goes to user 2 and asks him if he accepts or declines
if user 2 clicks accept a php script is run

Problem:
This script need to detect if that buddy already exists, if so do nothing or overwrite the original. Right now it just adds the entry again. I am using a very simple table:

UID   BID
---------
1   |   2

This would mean user id 1 has a buddy with a buddy id 2

Here is the non-functional code:

$query = mysql_query("UPDATE buddies SET uid='$uid', bid='$bid' WHERE uid='$uid' && bid='$bid'");
print "Buddy Has been overwritten";
//would prefer it not do anything at all if entry exists
if ($query == 0)
{
// No records updated, so add it
$query = mysql_query("INSERT INTO buddies (uid, bid) VALUES ('$uid', '$bid')");
print "Buddy Added";}

View Replies !
Duplicate Enterys
What is the best way to stop duiplicate enterys on to a data base from a website, for instance if the user presses refresh, or presses back and then submits again.

up to yet i have been using a check in the database for the same info being added, and using an if statment..

View Replies !
Duplicate Data
i am doing a simple program to let user entry their travelling claim. how can i notify user when there are duplicate data (they enter same data twice) ?

View Replies !
Duplicate Entry
this functions adds new locations in am_ups_shipment_location table after a tag in XML is detected it is pointed towards this function and this function then goes and adds the new location.

for the first time when i run the php prgoram the new location gets added.but when i refresh ,again the same location gets added but with different id[id is on autoincrement].

here is how my table looks after refresh.[you can see duplicate entry].This is what i dont wnat...i dont want a duplicate entry.
Can you please help me get rid of this duplicate entry by writing some update functions and checking against already present data in the table? Code:

View Replies !
Duplicate Results
I'm fairly new to PHP and after some trial and error managed to get the rsults I want from the following script, except that now some of the results are being duplicated. Code:

View Replies !
Duplicate Dates
I have a table that runs a calendar application. There is a colomn for start datetime and a colomn for end datetime of each event. I'm trying to figure out how I can write a condition (perhaps for a unique key?) that will not allow a new event to be posted if a previously entered event has already posted in that time frame. I was thinking something like:

{datestart_eve} <= {rsEvents.dateend_eve} && {datestart_eve} <= {rsEvents.datestart_eve}

but it's note working.

View Replies !
Duplicate Messages
When I use the mail() function as per the following example. For some reason it sends the message twice. Sometimes the second copy is blank. I always seem to have this problem and can see no reason why this should happen and am beginning to wonder whether this is a browser issue or similar. PHP Code:

$subject="Thank you for your e-mail";

$msg = "Dear ".$name.",";
$msg .= "Thank you for your e-mail.";
$msg .= "This is an automatic reply to let you know that we have received your message and will reply as soon as possible.;...

View Replies !
Duplicate Output?
I'm getting a duplicate output of my html? Don't worry about my html_main stuff.. this is for integration of another product. Although everything outputted is in the $DATA before it goes there.. so before it gets to $DATA it's screwing up. Code:

View Replies !
Duplicate With 2 Arrays
I have an array populated with full urls. Thing is I wish to reduce the urls down to the root domain with no www to make sure there are no duplicates. But I want to output the full urls instead. Kind of using the root to output the full urls. It should gaurantee unique full urls and only 1 page from each domain.

View Replies !
Error Duplicate Key
I have this statement

// auto add to the photo database
$qry = "INSERT INTO photo (UserID) VALUES ('$userid')";
mysql_query($qry) or die ('Error'.mysql_error());

How come I kept getting the ErrorDuplicate key 1? I changed the USERID from PK to nothing.

View Replies !
Duplicate Entries
I'm having a unique problem I have never seen before. I'm using php with mysql. I have a messaging system I created on my website where the members communicate with eachother. Information for each message is placed in the database. The problem I am having is that every now and then there will be duplicate information inserted into the database and with it random numbers.

An example would be inserting the name "JoeSmith" and then I would find a duplicate entry, but like this "JoeSmith08cbac8c". This does not happen all the time but I would like to eliminate it from happening. Has anyone heard of this before and know why it happens?

View Replies !
Get Rid Of Any Duplicate Entries
I know that I could have made a field unique,however, since I am building a directory, I could have multiple fields be unique and I wasn't sure if that was such a good idea.

Now, 1200+ entries into this mess, I want to get rid of any duplicate entries. I know that I could just do a simple SELECT and group by the name, address and phone number (the three main fields that would determine if an entry is duplicate or not).

View Replies !
Duplicate Record
i encountered duplicate record when inserting to mysql, how do u prevent? PHP Code:

$query_categoryObj = "Select category_id from categoryTable where category_name='$category_name'";
$categoryObj = mysql_query($query_categoryObj) or die(mysql_error());
$totalRows= mysql_num_rows($categoryObj);
if($totalRows= 0) {
  $query="Insert into categoryTable(category_name,   category_status) Values('$category_name', &#391;')";
  mysql_query($query);

If user refresh the page, it will insert double.

View Replies !
Duplicate Numbers
I'm looking for a solution that will determine if I have duplicate age_id's I'm pulling from a mysql database.

$user1->age_id
$user2->age_id
$user3->age_id
$user4->age_id

I'm pulling the field 'age_id' from different user records in the mysql database as shown above and I would like to determine if any of the above age_id's are the same. I dont need to know how many duplicates, only if their are any duplicates and if so I will echo a duplicate id image.

View Replies !
Changing Duplicate
I need some help trying to change duplicate array values to unique ones. Is there a way to search for all the 'unknown' values in the array and rename them to something unique?

[name] => unknown
[city] => new york
[zipcode] => unknown
[region] => east
[year] => 2007
[gender] => unknown
[experience] => unknown

I would like to rename them to something unique such as 'unknown 01' , 'unknown 02',etc. dynamically without having to know the key name.

View Replies !
Duplicate Entry?
my management system stopped working because of this error:

Please notify the admin that the script is connecting to the database, but not inserting the information Duplicate entry &#39127;' for key 1

And there isnt a duplicate in the database. This is where the error is said to echo:
login_script.php

PHP Code:

View Replies !
Remove Duplicate Row
I have three tables. This is my very simple Catalog. I have tables for Authors, their Books and map table - Authors-Books. Code:

View Replies !
Duplicate A File
I'm trying to figure out how to duplcate an existing image file and save it in the same directory but with a new name. the new name part is not a problem - I have a random name function - but i can't work out where to go using maybe fopen.

View Replies !
Duplicate Row Setup
I have two tables which might store have duplicate columns, ie first_name is in 'suppliers' and first_name is in 'users'. Having retrieved them from the database i want to setup the rows, only they don't work from I perceived to be the way to do it: PHP Code:

$supplierfirstname= $row['suppliers.first_name'];
$userfirstname = $row['users.first_name'];

View Replies !
Duplicate Records
I have an address field in my DB and I would like to pull up all the addresses that have multiple entries along with all the corresponding entries. I have tried the suggestions suppplied here http://ight=duplicate but to no avail either;

View Replies !
Get Duplicate Values
Any pointers would be really helpful, I have tried array unique and a few others but cannot identify the dupes and get them out.

View Replies !
Checking For Duplicate Users
Can anyone point me in the right direction? I'm looking for help in checking my user table for existing names and passwords before i add a new user.

View Replies !
Trying To Duplicate Form Fields.
What I would like is to when someone writes in one field. The same text is written in a seperate field. But without sending anything. all internally. Anyone have a clue?

View Replies !
Duplicate Emails From Formmail.php
Can anyone tell me why I might be getting 2 email returns for every form post using formmail.php?

Both are identical, both have the same time sent.

I'm using the recipient in the formmail.php script because when I use recipient in my form, it doesn't work.

View Replies !

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